ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.61k stars 660 forks source link

Tree mode quite a bit slower than macOS brew's `tree` #234

Open chenglou opened 7 years ago

chenglou commented 7 years ago

Sorry in advance about the vague issue.

Here's the speed of exa on a moderately-sized directory:

exa -T  0.19s user 0.05s system 104% cpu 0.231 total

brew install tree:

tree  0.03s user 0.02s system 76% cpu 0.060 total

I was wondering where the order of magnitude speed difference comes from?

Thanks for your project =)

mqudsi commented 7 years ago

find:

mqudsi@Blitzkrieg /m/d/GIT> time find . >/dev/null
0.15user 2.70system 0:02.85elapsed 100%CPU (0avgtext+0avgdata 1708maxresident)k
0inputs+0outputs (0major+690minor)pagefaults 0swaps

tree:

mqudsi@Blitzkrieg /m/d/GIT> time tree >/dev/null
0.14user 2.78system 0:02.94elapsed 99%CPU (0avgtext+0avgdata 1284maxresident)k
0inputs+0outputs (0major+352minor)pagefaults 0swaps

exa:

mqudsi@Blitzkrieg /m/d/GIT> time exa --tree >/dev/null
3.26user 30.62system 0:12.17elapsed 278%CPU (0avgtext+0avgdata 36884maxresident)k
0inputs+0outputs (0major+67347minor)pagefaults 0swaps

While exa takes 4 times longer to finish going by the wall clock, it's spending 10 times the amount of time in kernel, so it's probably doing a lot of things it doesn't have to (versus doing the same stuff just a lot less efficiently). Of note, I don't think either of the time or the output change with the presence/absence of --git so perhaps exa is spending time doing something that won't affect the output display.

ogham commented 7 years ago

I try to keep exa nice and speedy, but there's still a lot of work that could be done. In this instance, I'm aware of two major slowdowns that would affect tree view, and coincidentally they have reversible issue numbers:

So I'm going to keep this issue open as a reminder that there's work to do.

mqudsi commented 7 years ago

My concern regarding ‘—git’ is that it may be obtaining git info both with and without that flag as it does not affect the runtime.

ogham commented 7 years ago

@mqudsi I don't think it's querying Git without that flag — I think it's just slow!