-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
processing a large ignore file is very slow #134
Comments
I can repro this. It looks like the problem is something to do with
|
NICE FIND. This is definitely the |
Many of the patterns also look like simple literals. We should also investigate to make sure |
This helps #134 by avoiding a slow regex execution path, but doesn't actually fix the problem. Namely, we've gone from "so slow I'm not going to keep waiting for rg to finish" to "wow that was slow but at least it finished before I lost my patience."
OK, this one took me a while because I paid back some technical debt. While this issue can technically still arise, I've reduced the chance of it occurring substantially. There is still another path we can take to fix it for good, but I'll wait until it actually happens so I have a real test case to look at. In particular, I can now search the MySQL repo in reasonable time (three times faster than the silver searcher). As it happens, this repo is a good example of where |
Testcase: pristine git clone of mysql/mysql-server at the current HEAD commit, 71f48ab393bce80a59e5a2e498cd1f46f6b43f9a. Quick comparison of
git grep
andrg
on a fixed-string pattern that is not found anywhere in the repository, after warming up the filesystem cache withgit grep
a few times:Somehow ripgrep is more than three orders of magnitude slower than
git grep
here, at 8 minutes versus 0.1 seconds. This is of course not a very good sample of results but I think with a difference that big you don't really need the details. (Feel free to ask if you can't reproduce it though.)This is with ripgrep 0.2.1, git 2.10.0.
One-shot results from The Silver Searcher 0.33.0 and sift 0.8.0 for further comparison:
The text was updated successfully, but these errors were encountered: