3 ms·
It's not weird because ripgrep has had more features than ag for a long time. Originally ripgrep didn't have multi-line support or support for fancy regex featu
by burntsushi 5y ago
It's not weird because ripgrep has had more features than ag for a long time. Originally ripgrep didn't have multi-line support or support for fancy regex features like look-around, but it has both of those now. It also has support for automatic UTF-16 transcoding, preprocessors for searching non-text files and overall less buggy support for gitignore. (Look at ag's issue tracker.)
And then there's also the fact that ag isn't that great as a general purpose grep tool. It really falls over in terms of speed when searching, say, bigger files:
$ time rg 'Sherlock Holmes' OpenSubtitles2018.raw.en | wc -l
7673
real 1.475
user 1.115
sys 0.356
maxmem 12511 MB
faults 0
$ time ag 'Sherlock Holmes' OpenSubtitles2018.raw.en | wc -l
7673
real 20.276
user 19.850
sys 0.413
maxmem 12508 MB
faults 0
A lot of people like to comment and say, "well ag is fast enough for me." Well, OK, that's fine. But if you're wondering about why other people might mention ripgrep more, well, maybe it isn't just about the way you use the tools. For example, if you only ever search tiny repositories of code, then you aren't going to care that ripgrep is faster than ag. Which is perfectly reasonable, but it should also be reasonable to be aware that others might actually search bigger corpora than you.
- chx 5y agoripgrep regexp has lookaround? The linked docs still doesn't say that. https://docs.rs/regex/1.5.4/regex/#syntax https://docs.rs/regex/1.5.4/regex/#syntax > This crate provides a library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. Edit: I see. It can use pcre2 but it's a build time option which of course Ubuntu has off.
- burntsushi 5y ago> Edit: I see. It can use pcre2 but it's a build time option which of course Ubuntu has off. That's unfortunate. Perhaps a bug report to the packagers is in order? Archlinux enabled it: https://github.com/archlinux/svntogit-community/blob/0dc033f5d0a476671dc0971a02eb9baa51cabc73/trunk/PKGBUILD#L26 https://github.com/archlinux/svntogit-community/blob/0dc033f...
- chx 5y agohttps://bugs.launchpad.net/ubuntu/+source/rust-ripgrep/+bug/1950866 https://bugs.launchpad.net/ubuntu/+source/rust-ripgrep/+bug/...