Skip to content
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

Get the number of unmerged files #40

Closed
dorian-marchal opened this issue Jul 5, 2019 · 15 comments

Comments

Projects
None yet
2 participants
@dorian-marchal
Copy link

commented Jul 5, 2019

Is this possible to get the number of unmerged (conflicted) files from git status?

Currently, I parse git status --branch --untracked-files=all --porcelain to construct a prompt with these infos:

  • Number of staged files.
  • Number of unstaged files.
  • Number of untracked files.
  • Number of unmerged (conflicted) files.
  • Is the current branch ahead of its upstream?
  • Is the current branch behind its upstream?

It looks like that:

Screenshot from 2019-07-05 11-34-05

(master is ahead of its upstream, there is 4 files staged, 1 unstaged, 2 untracked and 1 unmerged)

It works well, but it's quiet slow and I thought omkatv/gitstatus could make it faster.

But it seems I can't get the number of unmerged files.
Is their a way to do that?

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 5, 2019

Shouldn't be too difficult to add. Give me a second. I'd like to combine this change with a few others I have in the pipeline to avoid excessive release churn.

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

This is done. gitstatus_query now sets VCS_STATUS_NUM_CONFLICTED and VCS_STATUS_HAS_CONFLICTED. If you want to use VCS_STATUS_NUM_CONFLICTED, it's a good idea to pass -c 99 to gitstatus_start.

@romkatv romkatv closed this Jul 6, 2019

@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

Thank you!

I successfully replaced git status in my bash prompt : https://github.com/dorian-marchal/git-config/blob/master/bash-prompt.sh

In my case, it makes it 2x faster.

On my test repo, gitstatus_query is actually as fast as git status --branch --untracked-files=all --porcelain (~28ms, measured with time), but thanks to the available env var, there is no need for parsing which is pretty slow.

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

On my test repo, gitstatus_query is actually as fast as git status --branch --untracked-files=all --porcelain

This is unexpected. Could you share logs in that repo? Run the following command while in the repo and post its output here.

zsh -dfic '
  GITSTATUS_LOG_LEVEL=DEBUG
  source ~/gitstatus/gitstatus.plugin.zsh
  gitstatus_start MY
  gitstatus_query MY
  sleep 2
  gitstatus_query MY
  uname -a
  typeset -m VCS_STATUS_\* | sort
  cat $GITSTATUS_DAEMON_LOG_MY'
@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

I tested it on https://github.com/redux-saga/redux-saga, but I use the bash binding, not the zsh one.

@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

I compared the "real" time from time command:

$ time git status --branch --untracked-files=all --porcelain
## master...upstream/master
real	0m0,026s
user	0m0,013s
sys	    0m0,021s

$ time git status --branch --untracked-files=all --porcelain
## master...upstream/master
real	0m0,027s
user	0m0,014s
sys	    0m0,028s

$ time git status --branch --untracked-files=all --porcelain
## master...upstream/master
real	0m0,026s
user	0m0,018s
sys	    0m0,017s

$ time gitstatus_query
real	0m0,029s
user	0m0,001s
sys	    0m0,000s

$ time gitstatus_query
real	0m0,025s
user	0m0,000s
sys	    0m0,001s

$ time gitstatus_query
real	0m0,026s
user	0m0,001s
sys	    0m0,000s

$ time gitstatus_query
real	0m0,025s
user	0m0,000s
sys	    0m0,001s
@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

I get 3ms on my machine for this repo.

I understand that you aren't using ZSH but perhaps it's not too difficult for you to install ZSH and copy-paste the command? If it is, do let me know and I'll try to write an equivalent command for bash. There may be a bug somewhere in gitstatus that makes it slow on your machine. I cannot tell without seeing the logs.

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

To clarify, I'm not asking you to switch your shell to ZSH or even to launch an interactive ZSH session. It's just a command. Not unlike grep blah or sed -e blah.

@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

I can do that 👍

Linux dorian-webedia 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
VCS_STATUS_ACTION=''
VCS_STATUS_COMMIT=374fde6e70945e0d20b2e4c221b74f643e26bd2b
VCS_STATUS_COMMITS_AHEAD=0
VCS_STATUS_COMMITS_BEHIND=0
VCS_STATUS_HAS_CONFLICTED=0
VCS_STATUS_HAS_STAGED=0
VCS_STATUS_HAS_UNSTAGED=0
VCS_STATUS_HAS_UNTRACKED=0
VCS_STATUS_INDEX_SIZE=360
VCS_STATUS_LOCAL_BRANCH=master
VCS_STATUS_NUM_CONFLICTED=0
VCS_STATUS_NUM_STAGED=0
VCS_STATUS_NUM_UNSTAGED=0
VCS_STATUS_NUM_UNTRACKED=0
VCS_STATUS_REMOTE_BRANCH=master
VCS_STATUS_REMOTE_NAME=origin
VCS_STATUS_REMOTE_URL=git@github.com:redux-saga/redux-saga.git
VCS_STATUS_RESULT=ok-sync
VCS_STATUS_STASHES=0
VCS_STATUS_TAG=v1.0.5
VCS_STATUS_WORKDIR=/home/dorian/repos/redux-saga
+/etc/zsh/zshenv:15> [[ -z '/home/dorian/.nvm/versions/node/v10.15.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:~/.config/composer/vendor/bin/:/home/dorian/repos/fzf/bin:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/' || '/home/dorian/.nvm/versions/node/v10.15.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:~/.config/composer/vendor/bin/:/home/dorian/repos/fzf/bin:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/:~/.config/composer/vendor/bin/' == /bin:/usr/bin ]]
+zsh:2> /home/dorian/repos/gitstatus/bin/gitstatusd-linux-x86_64 '--lock-fd=3' '--parent-pid=25586' '--num-threads=8' '--max-num-staged=1' '--max-num-unstaged=1' '--max-num-conflicted=1' '--max-num-untracked=1' '--dirty-max-index-size=-1' '--log-level=DEBUG'
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[0]: "/home/dorian/repos/gitstatus/bin/gitstatusd-linux-x86_64"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[1]: "--lock-fd=3"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[2]: "--parent-pid=25586"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[3]: "--num-threads=8"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[4]: "--max-num-staged=1"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[5]: "--max-num-unstaged=1"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[6]: "--max-num-conflicted=1"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[7]: "--max-num-untracked=1"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[8]: "--dirty-max-index-size=-1"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:157] argv[9]: "--log-level=DEBUG"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/thread_pool.cc:81] Spawning 8 thread(s)
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:171] Processing request: "hello" for ""
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/response.cc:69] Replying without git status
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/timer.cc:67] Timing for: request: 0.031ms cpu, 0.030396ms wall
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:174] Successfully processed request: "hello" for ""
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:171] Processing request: "1562431894.9292054176 " for "/home/dorian/repos/redux-saga"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/repo_cache.cc:45] Initializing new repository: "/home/dorian/repos/redux-saga/"
[2019-07-06 18:51:34 00007fb9d0e38700 INFO src/tag_db.cc:188] Parsing "/home/dorian/repos/redux-saga/.git/packed-refs"
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/repo.cc:313] Splitting 360 object(s) into 1 shard(s)
[2019-07-06 18:51:34 00007fb9d1e4f740 DEBUG src/index.cc:308] Repository capabilities for "/home/dorian/repos/redux-saga/": is_filemode_trustworthy = true, index_supports_symlinks = true, index_is_case_sensitive = true, precompose_unicode = false
[2019-07-06 18:51:34 00007fb9cfe36700 DEBUG src/repo.cc:291] git_diff_tree_to_index from "" to ""
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/repo.cc:155] Clean repo: no dirty candidates
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/response.cc:69] Replying with git status
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/timer.cc:67] Timing for: request: 6.033ms cpu, 5.226ms wall
[2019-07-06 18:51:34 00007fb9d1e4f740 INFO src/gitstatus.cc:174] Successfully processed request: "1562431894.9292054176 " for "/home/dorian/repos/redux-saga"
[2019-07-06 18:51:35 00007fb9d1639700 INFO src/check_dir_mtime.cc:93] All mtime checks have passes. Enabling untracked cache: "/home/dorian/repos/redux-saga/.git/"
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/gitstatus.cc:171] Processing request: "1562431896.9373528957 " for "/home/dorian/repos/redux-saga"
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/repo.cc:313] Splitting 360 object(s) into 1 shard(s)
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/repo.cc:137] Index and HEAD unchanged; staged = 0, conflicted = 0
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/repo.cc:155] Clean repo: no dirty candidates
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/response.cc:69] Replying with git status
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/timer.cc:67] Timing for: request: 10.257ms cpu, 9.36747ms wall
[2019-07-06 18:51:36 00007fb9d1e4f740 INFO src/gitstatus.cc:174] Successfully processed request: "1562431896.9373528957 " for "/home/dorian/repos/redux-saga"
@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

This is the "slow" part, on my machine:

while true; do
IFS=$'\x1f' read -rd $'\x1e' -a resp -u $_GITSTATUS_RESP_FD "${timeout[@]}" || return
[[ "${resp[0]}" == "$req_id" ]] && break
done

I imagine this is where the query is done.

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

Thanks!

From the logs we can see that gitstatusd took 5 ms for the first request and 9 ms for the second. It's strange that the second took longer. These numbers are higher than on my machine (I get 2.8 ms) but I also have more CPU cores, so the difference is reasonable.

It seems that bash bindings take ~20 ms on your machine. I profiled the bash version of gitstatus_query on my machine and got 3.5 ms per gitstatus_query call, about the same as in ZSH. Here's the command I used:

time bash -ci '
  source ~/gitstatus/gitstatus.plugin.sh
  gitstatus_start
  gitstatus_query
  sleep 2
  for ((i = 0; i != 1000; ++i)); do
    gitstatus_query
  done'

Baseline that needs to be subtracted:

time bash -ci '
  source ~/gitstatus/gitstatus.plugin.sh
  gitstatus_start
  gitstatus_query
  sleep 2
  for ((i = 0; i != 1000; ++i)); do
    true
  done'

I've got 5.6s for the first command and 2.1s for the second, which gives 3.5ms per gitstatus_query.

This means Bash bindings account for 0.7 ms, while on your machine it's about 20 ms. Strange.

A few questions:

  • What's your Bash version?
  • Do you have CPU doing something or is it idle?
  • Do you have an SSD?
  • Do you use Git fsmonitor?

This is the "slow" part, on my machine:

This is where it's waiting for results from gitstatusd.

@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

I wasn't in a "fresh" bash session when I ran these commands (I sourced my ~/.bashrc a lot in this session).

It it a lot faster in a fresh session (and ~15% faster than git status):

$ time bash -ci '
    source ~/repos/gitstatus/gitstatus.plugin.sh
    gitstatus_start
    gitstatus_query
    sleep 2
    for ((i = 0; i != 1000; ++i)); do
      gitstatus_query
    done'

real	0m5,380s
user	0m0,569s
sys	0m0,088s
$ time bash -ci '
    source ~/repos/gitstatus/gitstatus.plugin.sh
    gitstatus_start
    gitstatus_query
    sleep 2
    for ((i = 0; i != 1000; ++i)); do
      git status --branch --untracked-files=all --porcelain >/dev/null
    done'

real	0m6,280s
user	0m2,096s
sys	0m2,243s
$ time bash -ci '
    source ~/repos/gitstatus/gitstatus.plugin.sh
    gitstatus_start
    gitstatus_query
    sleep 2
    for ((i = 0; i != 1000; ++i)); do
      true
    done'

real	0m2,107s
user	0m0,100s
sys	0m0,019s
$ zsh -dfic '
    GITSTATUS_LOG_LEVEL=DEBUG
    source ~/repos/gitstatus/gitstatus.plugin.zsh
    gitstatus_start MY
    gitstatus_query MY
    sleep 2
    gitstatus_query MY
    uname -a
    typeset -m VCS_STATUS_\* | sort
    cat $GITSTATUS_DAEMON_LOG_MY'

Linux dorian-webedia 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
VCS_STATUS_ACTION=''
VCS_STATUS_COMMIT=374fde6e70945e0d20b2e4c221b74f643e26bd2b
VCS_STATUS_COMMITS_AHEAD=0
VCS_STATUS_COMMITS_BEHIND=0
VCS_STATUS_HAS_CONFLICTED=0
VCS_STATUS_HAS_STAGED=0
VCS_STATUS_HAS_UNSTAGED=0
VCS_STATUS_HAS_UNTRACKED=0
VCS_STATUS_INDEX_SIZE=360
VCS_STATUS_LOCAL_BRANCH=master
VCS_STATUS_NUM_CONFLICTED=0
VCS_STATUS_NUM_STAGED=0
VCS_STATUS_NUM_UNSTAGED=0
VCS_STATUS_NUM_UNTRACKED=0
VCS_STATUS_REMOTE_BRANCH=master
VCS_STATUS_REMOTE_NAME=origin
VCS_STATUS_REMOTE_URL=git@github.com:redux-saga/redux-saga.git
VCS_STATUS_RESULT=ok-sync
VCS_STATUS_STASHES=0
VCS_STATUS_TAG=v1.0.5
VCS_STATUS_WORKDIR=/home/dorian/repos/redux-saga
+/etc/zsh/zshenv:15  [[ -z '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:~/.config/composer/vendor/bin/:/home/dorian/repos/fzf/bin:~/.config/composer/vendor/bin/' || '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:~/.config/composer/vendor/bin/:/home/dorian/repos/fzf/bin:~/.config/composer/vendor/bin/' == /bin:/usr/bin ]]
+zsh:2  /home/dorian/repos/gitstatus/bin/gitstatusd-linux-x86_64 '--lock-fd=3' '--parent-pid=4489' '--num-threads=8' '--max-num-staged=1' '--max-num-unstaged=1' '--max-num-conflicted=1' '--max-num-untracked=1' '--dirty-max-index-size=-1' '--log-level=DEBUG'
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[0]: "/home/dorian/repos/gitstatus/bin/gitstatusd-linux-x86_64"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[1]: "--lock-fd=3"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[2]: "--parent-pid=4489"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[3]: "--num-threads=8"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[4]: "--max-num-staged=1"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[5]: "--max-num-unstaged=1"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[6]: "--max-num-conflicted=1"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[7]: "--max-num-untracked=1"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[8]: "--dirty-max-index-size=-1"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:157] argv[9]: "--log-level=DEBUG"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/thread_pool.cc:81] Spawning 8 thread(s)
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:171] Processing request: "hello" for ""
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/response.cc:69] Replying without git status
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/timer.cc:67] Timing for: request: 0.035ms cpu, 0.034515ms wall
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:174] Successfully processed request: "hello" for ""
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:171] Processing request: "1562433531.3031160831 " for "/home/dorian/repos/redux-saga"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/repo_cache.cc:45] Initializing new repository: "/home/dorian/repos/redux-saga/"
[2019-07-06 19:18:51 00007f519e98a700 INFO src/tag_db.cc:188] Parsing "/home/dorian/repos/redux-saga/.git/packed-refs"
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/repo.cc:313] Splitting 360 object(s) into 1 shard(s)
[2019-07-06 19:18:51 00007f519f9a1740 DEBUG src/index.cc:308] Repository capabilities for "/home/dorian/repos/redux-saga/": is_filemode_trustworthy = true, index_supports_symlinks = true, index_is_case_sensitive = true, precompose_unicode = false
[2019-07-06 19:18:51 00007f519d988700 DEBUG src/repo.cc:291] git_diff_tree_to_index from "" to ""
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/repo.cc:155] Clean repo: no dirty candidates
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/response.cc:69] Replying with git status
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/timer.cc:67] Timing for: request: 6.133ms cpu, 4.22905ms wall
[2019-07-06 19:18:51 00007f519f9a1740 INFO src/gitstatus.cc:174] Successfully processed request: "1562433531.3031160831 " for "/home/dorian/repos/redux-saga"
[2019-07-06 19:18:52 00007f519f18b700 INFO src/check_dir_mtime.cc:93] All mtime checks have passes. Enabling untracked cache: "/home/dorian/repos/redux-saga/.git/"
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/gitstatus.cc:171] Processing request: "1562433533.3094105721 " for "/home/dorian/repos/redux-saga"
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/repo.cc:313] Splitting 360 object(s) into 1 shard(s)
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/repo.cc:137] Index and HEAD unchanged; staged = 0, conflicted = 0
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/repo.cc:155] Clean repo: no dirty candidates
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/response.cc:69] Replying with git status
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/timer.cc:67] Timing for: request: 5.234ms cpu, 4.77906ms wall
[2019-07-06 19:18:53 00007f519f9a1740 INFO src/gitstatus.cc:174] Successfully processed request: "1562433533.3094105721 " for "/home/dorian/repos/redux-saga"
@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

What's your Bash version?

GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

Do you have CPU doing something or is it idle?

Idle.

Do you have an SSD?

Yep.

Do you use Git fsmonitor?

I don't know, so I assume "no" 😄
EDIT: git config core.fsmonitor returns nothing.

@romkatv

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

Now this makes sense!

  • gitstatus_query loop: 5.380s
  • git status loop: 6.280s
  • empty loop: 2.107s

This means gitstatus_query is 27% faster than git status (100 * ((6.280 - 2.107) / (5.380 - 2.107) - 1)).

27% is a small improvement but this includes Bash part, which is constant for all repository sizes. On larger repositories the 1ms taken by Bash is nothing in comparison with the time taken by git and gitstatusd, so gitstatus_query gets a sizable lead where it's most important.

Thanks for your help and perseverance in debugging this!

@dorian-marchal

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

This makes sense, thanks for your time! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.