New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance data of gitstatus and alternatives with bash-seafly-prompt, including fsmonitor #385
Comments
Thanks for sharing the data! Super useful stuff. |
Adding in starship Cross-Shell Prompt results, just because I was curious. I used starship with out-of-the-box settings, no configuration. Linux:
macOS (
starship is implemented in Rust, but it's Git & other processing is slow. Not my problem since I use my own seafly prompt on Bash, but starship is way slower than it should be, I am very surprised since so many people use it. Too much bloat? Too much shelling out? It is a sluggish prompt in-my-experience. |
Thought you might appreciate how we measure shell performance in zsh: https://github.com/romkatv/zsh-bench. It mentions Starship, too (it's very slow). |
Very interesting indeed. |
Hello @romkatv,
You may be interested in the following performance data I gathered for my bash-seafly-prompt.
Historically I provided two ways to gather Git status, either use this
gitstatus
utility or fallback togit
command to gather: branch, dirty, stage, upstream and stash state via separate invocations ofgit
.Recently I learned that Git
2.11
(Nov 2016) includes a newporcelain=v2
option which can gather all my required states (branch, dirty, upstream, stash etc) in one swoop. However, I soon learned that runninggrep
andawk
is really slow. So instead I created a simple Rust utility git-status-fly to run and parseporcelain=v2
using optimized Rust.Meanwhile I came across #370 and the new
core.fsmonitor
option and I wondered how that would effect matters.So I ran performance tests on my two systems:
Against these four repositories:
Note,
core.fsmonitor
only works on Windows and macOS, not Linux (sadly). Also,feature.manyFiles
provides benefits (especially on macOS) against large and very large repositories (so I enabled it for linux and chromium repositories).Listed is the average time to compute the prompt function in a git repository.
Linux performance results:
git-status-fly
gitstatus
git
fallback16ms
12ms
28ms
21ms
15ms
33ms
61ms
42ms
80ms
260ms
160ms
305ms
Macbook performance results (also with
fsmonitor
results):git-status-fly
git-status-fly + fsmonitor
gitstatus
git
fallbackgit + fsmonitor
fallback32ms
45ms
12ms
61ms
87ms
45ms
45ms
29ms
73ms
89ms
175ms
60ms
165ms
211ms
105ms
2700ms
102ms
2500ms
2600ms
155ms
gitstatus is not
fsmonitor
aware so with or withoutfsmonitor
the same results were produced.fsmonitor
is big win for large and very large repositories, but for small to medium sized repositories it is a performance degradation. So it should only be enabled on a per-repository basis.Invoking a process on macOS is quite slow, much slower than Linux.
gitstatus
being a daemon has benefits, but at the cost of adding an extra 20ms to terminal+shell startup time.Note, a prompt time of
30ms - 35ms
or less feels instant.gitstatus
overall still has the best performance, but mygit-status-fly
utility is reasonably good too.Anyway, there is no issue here, I just thought you may be interested in these results.
Cheers.
The text was updated successfully, but these errors were encountered: