Files
fish-shell/share/functions
Mahmoud Al-Qudsi 96deaae7d8 completions/apt: Read from the dpkg cache directly
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\""'
```
2023-02-05 16:30:34 -06:00
..
2022-10-28 10:01:35 -07:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2019-05-05 12:09:25 +02:00
2020-11-22 14:39:48 +01:00
2020-04-21 21:11:26 +02:00
2022-06-08 21:23:43 +02:00
2022-08-02 00:42:37 -07:00
2022-01-27 16:21:22 -08:00
2017-10-01 01:11:17 -07:00
2022-06-16 18:43:28 +02:00
2022-01-27 16:21:22 -08:00
2022-01-27 16:21:22 -08:00
2022-03-24 20:11:39 +01:00
2016-11-27 21:27:22 -08:00
2023-01-01 19:41:41 -08:00
2022-10-18 18:05:16 +02:00
2021-12-02 02:22:40 -08:00
2021-09-24 18:25:27 +02:00
2021-05-14 21:49:53 +02:00
2022-09-04 09:18:57 +02:00
2017-04-05 15:31:13 -07:00
2022-01-27 16:21:22 -08:00
2022-04-23 16:35:52 -07:00