fish-shell/share
Johannes Altmanninger ad9b4290e5 completions/git: cache subcommand computation
Whenever completing any git commandline, we invoke __fish_git_using_command
173 times*. Every invocation calls "commandline" and "argparse"
to the same effect. Let's parse the command line once, and reuse the results
later.

I'm observing a speed-up from 200ms to 120ms with

    perf stat -r 10 buildrel/fish -c 'complete -C "git checkout ">/dev/null'

Alternative solutions:
1. teach fish to cache such things automatically.
2. rewrite git completions to compute most completions in a single function,
   which will naturally avoid redundant work. This sounds viable but it's
   a lot of work.

* we have a thousand uses of __fish_git_using_command, so I'm not sure why
it's only 173.

See the discussion in #8266
2022-05-01 16:37:55 +02:00
..
completions completions/git: cache subcommand computation 2022-05-01 16:37:55 +02:00
functions feat: more completion for umount (#8908) 2022-04-26 21:11:54 +02:00
groff workaround broken groff man page config 2016-10-19 13:43:04 -07:00
tools Fix style of eq operator 2022-04-28 17:37:47 +02:00
__fish_build_paths.fish.in Rename "snippets" to "conf" internally, and document them as snippets 2016-04-06 09:33:09 +08:00
config.fish Move executable-check to C++ 2022-03-31 15:16:01 +02:00
lynx.lss Install custom LSS script to /usr/local/share/fish on make install 2017-09-26 14:31:11 -05:00