-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Ripgrep interactive mode is extremely slow #488
Comments
No idea what's going on there. Make sure to install the latest version of ripgrep (0.7.1). |
Yeah, I've got the latest installed. Do you have any tips for me to debug this, or is this something I just need to live with? Is this something I need to file with ripgrep? |
Since it's not an issue of fzf, I can't really help. If ag works great, why don't you just use it? It's sufficiently fast for most use cases. By the way, I'm not sure starting ag or rg without any keyword is a good strategy since they are much more efficient for searching inside files and fzf will have to need a lot of memory to keep every line in memory. These are the binding I use with ag. |
Yeah, I'll do that. Thanks for taking a look at this. Appreciate all your work! |
@hahuang65 The |
Oh good tip. I'll try that. Thanks |
So I wrote up this whole thing but i got ahead of myself so i'm rewriting my comment. It looks like ag and rg have quite different methods of outputting content, and rg is (for now) much slower at output (I/O). rg is quite more speedy at doing actual searching however. But the way you're using this is such that hundreds of thousands of lines (no doubt something like nearly every nonempty line getting matched and sent into FZF for fuzzy matching) are produced, so rg happens to be sluggish in comparison to ag and grep. I've noticed this. It's pretty clear that this is what happens (and it may not be obvious): FZF is adept at accepting megabytes upon megabytes of buffer to let you rapidly fuzzy search over. Indeed, it's so fast that the bottleneck of rg's output I/O is what's become conspicuous here. That's it. The discrepancy observed here is it takes rg a few seconds to get through assembling what is likely to be hundreds of MB of content whereas ag can do it 5 times faster or so. If you already have a starting point of some token to search for, you would be very well served to provide it as an arg to As nice as it is that FZF can consume these buffers pretty much as fast as they can be generated, it's probably overkill in most cases, but very powerful! It's simply another testament to the greatness of this software. |
Thanks for doing the investigation and explaining it to me. It really helps! |
@unphased Can you provide a reproducible test case outside of fzf and contribute it to ripgrep so that we can fix it? A bug was already filed but it lacks details: BurntSushi/ripgrep#696 |
Further investigation indicates that The quick workaround for OP and others troubled by the behavior is to configure an |
Using
vs.
has some interesting issues:
:Rg <term> <CR>
is LIGHTNING fast.<leader>/
to use:Rg
in interactive mode is 10 times slower than:Ag
in interactive mode.Is there any reason why interactive mode for ripgrep is much slower than the_silver_searcher? Is it the way I configured
:Rg
?The text was updated successfully, but these errors were encountered: