Our great sponsors
-
ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
So clearly ripgrep's memory usage isn't scaling to the size of the file. But ZOMG, it uses more memory than GNU grep! In reality, both programs use a very tiny amount of memory. In fact, in some real world use cases, ripgrep may actually use less memory than GNU grep: https://github.com/BurntSushi/ripgrep/issues/1823#issuecomment-799825915
ripgrep doesn't do this. It probably should, but it's not a huge deal since you can force the issue in either tool with the -q/--quiet flag. The optimization is relevant here because Hyperfine will by default attach a program's stdout to the equivalent of /dev/null.