mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
96deaae7d8
I have no idea why `apt-cache --no-generate show` is so slow since it basically dumps the contents of the cache file located at `/var/lib/dpkg/status`. We are technically bypassing any waits on the cache lock file so this may produce incorrect results if the cache is being regenerated in the moment, but that's a small price to pay and the results are likely confined to simply not generating comprehensive results. With this change, we no longer need to truncate results to the first n matches and we no longer only print packages beginning with the commandline argument enabling fish's partial completions logic to offer less-perfect suggestions when no better options are available. Even though we are generating more usable completions, we still trounce the old performance by leaps and bounds: ``` Benchmark #1: fish -c "complete -C\"apt install ac\"" Time (mean ± σ): 2.165 s ± 0.033 s [User: 267.0 ms, System: 1932.2 ms] Range (min … max): 2.136 s … 2.256 s 10 runs Benchmark #2: build/fish -c "complete -C\"apt install ac\"" Time (mean ± σ): 111.1 ms ± 1.8 ms [User: 38.9 ms, System: 72.9 ms] Range (min … max): 108.2 ms … 114.9 ms 26 runs Summary 'build/fish -c "complete -C\"apt install ac\""' ran 19.49 ± 0.44 times faster than 'fish -c "complete -C\"apt install ac\""' ``` |
||
---|---|---|
.. | ||
completions | ||
functions | ||
groff | ||
tools | ||
__fish_build_paths.fish.in | ||
config.fish |