summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2020-11-11 14:44:47 +0000
committerJunegunn Choi <junegunn.c@gmail.com>2020-11-13 02:16:54 +0900
commitef2c29d5d4974cc773149d368488a6d8a0fcc1fc (patch)
treebb91ec675491d30e02823277ac53c3dc3f2d5bde /plugin
parent218b3c8274193c7ea128d164c7924fcb46c2db65 (diff)
downloadfzf-ef2c29d5d4974cc773149d368488a6d8a0fcc1fc.tar.gz
[bash-completion] Optimize __fzf_orig_completion_filter
Commit d4ad4a25 slowed loading of completion.bash significantly (on my laptop from 10 ms to 30 ms), then 54891d11 improved that (to 20 ms) but it still stands out as the heavy part of my .bashrc. Rewriting __fzf_orig_completion_filter to pure bash without forking to sed/awk brings this back under 10 ms. before: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 21.2 ms ± 0.3 ms [User: 24.9 ms, System: 6.4 ms] Range (min … max): 20.7 ms … 23.3 ms 132 runs after: $ HISTFILE=/tmp/bashhist hyperfine 'bash --rcfile shell/completion.bash -i' Benchmark #1: bash --rcfile shell/completion.bash -i Time (mean ± σ): 9.6 ms ± 0.3 ms [User: 8.0 ms, System: 2.2 ms] Range (min … max): 9.3 ms … 11.4 ms 298 runs Fixes: d4ad4a25db5f ("[bash-completion] Fix default alias/variable completion") Fixes: 54891d11e09d ("[bash-completion] Minor optimization")
Diffstat (limited to 'plugin')
0 files changed, 0 insertions, 0 deletions