opened
matklad
username_0
format directories
issue
created
matklad
username_0
Formatting nixpkgs after this change I get

```
λ time ../nixpkgs-fmt/target/release/nixpkgs-fmt .
real 12.81s
user 24.74s
sys  0.77s
rss  464100k

17:54:53|~/projects/nixpkgs|master⚡*
λ git diff | wc -l
1763412
```

Note that this effectively uses two cores out of 4cores/8hyperthreads machine, which I can't really explain without digging into. That said, 10 seconds for nixpkgs seems like a reasonable time which shouldn't be optimized further
comment
created
matklad
username_0
@username_1 I wonder why it took you 10 minutes for nixpkgs in https://discourse.nixos.org/t/nixpkgs-fmt-beta-0-3-1/3812/5?u=username_0? That is excessive... I guess that either you used the debug version of the build, or that whichever directory traversal was the bottleneck. 

To be clear, I haven't really optimized the formatter at all, it currently allocates all other the place, so, if we care about perf, I'd say another order of magnitude could be possible, but is probably unnecessary.
comment
created
zimbatm
username_1
Yeah I did all of things wrong. I was using the debug build with `git ls-files | grep -e ".nix$" | xargs nixpkgs-fmt`.

Having the path traversal builtin is really nice, it's going to be more convenient to use on code bases without the pre-commit hook.

bors r+
comment