Closed zhengpd closed 1 month ago
I see. I also tried for 140,000 over files with hyperfine and found fd -Htf
is faster than rg -.g "!.git" --files
, which are the defaults in this plugin. I will set more precedence for fd
over rg
.
hyperfine --warmup 3 'rg -.g "!.git" --files' 'fd -Htf'
Benchmark 1: rg -.g "!.git" --files
Time (mean ± σ): 1.035 s ± 0.048 s [User: 0.735 s, System: 2.309 s]
Range (min … max): 0.966 s … 1.130 s 10 runs
Benchmark 2: fd -Htf
Time (mean ± σ): 845.0 ms ± 30.3 ms [User: 708.9 ms, System: 2449.6 ms]
Range (min … max): 816.9 ms … 914.6 ms 10 runs
Summary
fd -Htf ran
1.23 ± 0.07 times faster than rg -.g "!.git" --files
It might be faster to change the
workspace_scan_cmd
order to tryfd
beforerg
.fd
is designed to list files whilerg
is designed to search files.In my computer
fd
cost less time thanrg
with the tradeoff of higher cpu usage.