Repository navigation
File Search: count each hit's path once, not on every sort comparison #2016
Unanswered
iammerlijn
asked this question in
Vouch Request
Replies: 1 comment 4 replies
|
Did a small bench;
|
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What do you want to work on?
I want to make File Search sorting more efficient. Today, the result sorter repeatedly calculates the length of each file path while comparing results. The path never changes during a search, so this work is repeated unnecessarily.
The improvement is small in code size, but meaningful for larger overlays. In benchmarks, it reduces the search call by 22% to 46% for a 1,000-file overlay. At 12,000 files, search time drops from 28.7 ms to 6.0 ms.
How do you plan to do it?
calculate each result's path length once when the result is created and store it alongside the existing result data. The sorter can then read that stored value instead of recalculating the length for every comparison.
This is a focused change of roughly 10 added lines and one removed line. It does not change search behavior or result ordering. It only avoids repeated computation during sorting.
I will also run the existing File Search tests and benchmarks to confirm that the output remains unchanged and the measured improvement holds.
I confirm that:
All reactions