This is an archive of the discontinued Mercurial Phabricator instance.

grep: speed up `hg grep --all-files some/path` by using ctx.matches(match)
ClosedPublic

Authored by martinvonz on Jan 10 2020, 1:41 PM.

Details

Summary

ctx.matches(match) avoids walking unintersting parts of the tree when
using tree manifests. That can make a very big difference when
grepping in a small subset of the tree (2.0s -> 0.7s in my case, but
can of course be made more extreme by picking a smaller subset of
files).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Jan 10 2020, 1:41 PM
pulkit accepted this revision.Jan 13 2020, 7:31 AM
This revision is now accepted and ready to land.Jan 13 2020, 7:31 AM