Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Have you flushed disk cache before each invocation? If not then it's very possible that you're comparing apples to oranges. During first test OS has to read the files from drive. It will also place them in RAM for caching purposes (provided that you have some free RAM). In second and third tests those files might not be read from hard drive but from RAM which is several orders of magnitude faster. Commented Nov 24, 2016 at 9:03
  • Good point, but I'm pretty sure that it's not the case. With the disk cache flushed, running ack twice will result in almost identical benchmarks. The reason behind ag and rg's better numbers lies behind their different implementations. To be 100% sure of this, I just did the same experiment with disk cache flushed, same results. Commented Nov 24, 2016 at 12:13
  • @matt The results are here are consistent with my own: blog.burntsushi.net/ripgrep Commented Nov 24, 2016 at 15:58