Repository navigation
ignore: speed up Gitignore::empty - #895
Conversation
|
@sharkdp I think this should resolve the performance regression. I think my initial analysis here wasn't quite the whole story. In addition to the overhead of Here are the benchmarks (first is current master, second is your PR on top of current master and third is this PR): One important observation here is that because Your PR is still a hair faster, but I'm not inclined to it since it spreads case analysis out too much. The likely cause of the performance difference is the additional function calls/copying when calling |
This commit makes Gitignore::empty a bit faster by avoiding allocation and manually specializing the implementation instead of routing it through the GitignoreBuilder. This helps improve uses of ripgrep that traverse *many* directories, and in particular, when the use of ignores is disabled via command line switches. Fixes #835, Closes #836
25e0e21 to
e68cc86
Compare
|
Very cool - thank you very much for looking into this! I've run the benchmark again and see no significant difference between my PR and yours. |
This commit makes Gitignore::empty a bit faster by avoiding allocation
and manually specializing the implementation instead of routing it through
the GitignoreBuilder.
This helps improve uses of ripgrep that traverse many directories, and
in particular, when the use of ignores is disabled via command line
switches.
Fixes #835, Closes #836