5 ms·
I've been using ag, the silver searcher, for a few years now. It's blazingly fast (easily searching a massive code base in single-digit seconds), automatically
by anyfoo 8y ago
I've been using ag, the silver searcher, for a few years now. It's blazingly fast (easily searching a massive code base in single-digit seconds), automatically ignores files I almost never want to be searched (anything in .git for example), and has convenient defaults around color highlighting and showing context.
I'm more than open to add ripgrep to my collection of everyday tools, however, if there is a real benefit. Does ripgrep do anything that would replace or complement my ag usage?
Note that it may also be possible that for new users, ripgrep is the better tool, but that ag is still more than good enough if you already based workflows and habits around it.
- andy128k 8y agoI also use ag for years. Recently I tried to use rg and found it is even faster than ag. Few times I compared results and somehow ag skipped few files but rg found matches. My reflexes are still to type ag but I already want to switch to rg.
- meowface 8y agoalias ag="rg" is what I've just started doing. Both tools are great, but rg is just better and faster, while also not missing anything that ag has (at least from my own experience).
- dfabulich 8y agoriggrep is shockingly even faster than ag. (I couldn't believe it.) https://blog.burntsushi.net/ripgrep/ https://blog.burntsushi.net/ripgrep/ > My hope is that this article not only convinced you that rg is quite fast, but more importantly, that you found my analysis of each benchmark educational. String searching is an old problem in computer science, but there is still plenty of work left to do to advance the state of the art.
- burntsushi 8y agoripgrep does everything you say about ag, and has much less buggy support for gitignore. It is also quite a bit faster for bigger workloads. For smaller work loads you might not notice a difference. However, ripgrep is good enough to even replace uses of grep where ag might otherwise behave sub-optimally. Specifically, with this release, ag no longer has any major features that ripgrep doesn't have. Additionally, ripgrep gives you almost every flag found in GNU grep, and then some. I think some of this is addressed in the README. :)
- dfabulich 8y agoIt'd be great if you'd go back and update your blog post https://blog.burntsushi.net/ripgrep/ https://blog.burntsushi.net/ripgrep/ now that so many of the "anti-pitch" bullets are fixed (and I can only assume that the numbers have changed in the last two years)
- burntsushi 8y agoYeah, I have been superficially updating that post, but haven't yet for the latest release. Updating the benchmarks is harder because of the analysis. I would need to redo almost all of it, which took weeks. The TL;DR though is that ripgrep is faster than it was then. Other tools like ag and grep have roughly remained the same.
- icc97 8y agoripgrep is simply phenomenal. The rest of my team are stuck using IDEs where they can only look at one project at a time, where as I can structure them as I want and rg over them all.
- acdha 8y agoJust in case you were inclined discount burntsushi’s comment for [justified] pride, it’d be a mistake. I happily used ag for years but switched to ripgrep awhile back after seeing that everything worked a bit faster and better (i.e. I haven’t had to think about gitignore file parsing for at least a year). I don’t even have ag or ack installed anymore, after years of them being one of the first things I’d add to a new system.
- loeg 8y agoI have also been a long-time ag user (including submitting some patches) and transitioned to rg with little effort. Both tools are great and I use them more or less interchangeably.
- coldtea 8y agorg is faster. Handles unicode better. Could never get ag and others to fully respect .gitignore files properly either (had to specially craft dedicated rules for edge cases), this does it out of the box. Plus, I like the regular updates and that you can also use parts of it (regex engine etc) as libraries for your own Rust programs.