I switched from from ripgrep to ugrep and never looked back. It's just as fast, but also comes with fuzzy matching (which is super useful), a TUI (useful for code reviews), and can also search in PDFs, archives, etc. The optional Google search syntax also very convenient. https://ugrep.com
Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
21–30 of 198 posts
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#22Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#23this above all true UNLESS you need multi-line matches with UTF8, where ripgrep is not so fast, because it needs to fall back to the other PCRE2 lib
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#24Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#25Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#26well... it is not faster than qgrep :) even though the way both work - differs greatly, and even though qgrep is based on re2 - the speed comes from the presence of index. but then I wonder why people forget the qgrep option, since with large file stores it makes much more sense to use qgrep AND indices, rather than always go through all the files. this above all true UNLESS you need multi-line matches with UTF8, whe…
Yes, qgrep uses indexing, which will always give it a leg up over other tools that don't use indexing. But of course, now you need to setup and maintain an index. The UX isn't quite as simple as "just run a search."
But there isn't much of a mystery here. Someone might neglect to use qgrep for exactly the same reason that "grep is fast enough for me" might prevent someone from using ripgrep. And indeed, "grep is fast enough" is very much true in some non-trivial fraction of cases. There are many many searches in which you won't be able to perceive the speed difference between ripgrep and grep, if any exists. And, analogously, the difference between qgrep and ripgrep. The cases I'm thinking of tend to be small haystacks. If you have only a small thing to search, then perhaps even the speed of a "naive" grep is fast enough.
So if ripgrep, say, completes a search of the Linux kernel in under 100ms, is that annoying enough to push you towards a different kind of tool that uses indexing? Maybe, depends on what you're doing. But probably not for standard interactive usage.
This is my interpretation anyway of your wonderment of (in your words) "why people forget the qgrep option." YMMV.
I have flirted with the idea of adding indexing to ripgrep: https://github.com/BurntSushi/ripgrep/issues/1497
> this above all true UNLESS you need multi-line matches with UTF8, where ripgrep is not so fast, because it needs to fall back to the other PCRE2 lib
That's not true. Multiline searches certainly do not require PCRE2. I don't know what you mean by "with UTF8," but the default regex engine has Unicode support.
PCRE2 is a fully optional dependency of ripgrep. You can build ripgrep without PCRE2 and it will still have multiline search support.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#27Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#28Earlier quoted context omitted.
What? Git grep is all you ever need in my experience, and it's ~faster than~ (edit: as fast as) ripgrep when searching a git repo.
I really doubt git grep can outperform ripgrep in any tests... please provide some proof.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#29Earlier quoted context omitted.
What? Git grep is all you ever need in my experience, and it's ~faster than~ (edit: as fast as) ripgrep when searching a git repo.
> it's faster than ripgrep when searching a git repo. Source? Ripgrep's benchmarks show it significantly faster.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#30I switched from from ripgrep to ugrep and never looked back. It's just as fast, but also comes with fuzzy matching (which is super useful), a TUI (useful for code reviews), and can also search in PDFs, archives, etc. The optional Google search syntax also very convenient. https://ugrep.com
So weird. I mean, it's just about some open source tool, right? :-/