-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
bugA bug.A bug.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.
Description
What version of ripgrep are you using?
rg --version
ripgrep 12.1.1 (rev a6d05475fb)
-SIMD -AVX (compiled)
+SIMD +AVX (runtime
How did you install ripgrep?
I run a locally compiled version.
What operating system are you using ripgrep on?
Ubuntu 20.04.
Describe your bug.
Searching for an e-mail pattern is faster using grep than rg. I experience this in my local Maildir and in the Linux kernels linux/fs/ subfolder.
What are the steps to reproduce the behavior?
I use the Linux kernels linux/fs (rev 85a2c56cb4454c73f56d3099d96942e7919b292f) subfolder as an example for a folder we both have access too. In practice I would like to run the commands in my Maildir.
Pattern without match (~25ms vs ~135ms)
cd /path/to/linux/fs
pattern="[A-Z0-9._%+-]*lin[A-Z0-9._%+-]*tor[A-Z0-9._%+-]*@[a-z]+\.[a-z]{2,}"
# some grep warm up runs
time grep -rhioE "$pattern" | len
0
grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} -rhioE 0,02s user 0,01s system 89% cpu 0,025 total
wc -l 0,00s user 0,00s system 4% cpu 0,024 total
# some ripgrep warm up runs
time rg -ioI "$pattern" | len
0
/tmp/rg -ioI "$pattern" 0,34s user 0,01s system 252% cpu 0,137 total
wc -l 0,00s user 0,00s system 1% cpu 0,136 totalPattern with some matches (~50ms vs ~60ms)
cd /path/to/linux/fs
pattern="[A-Z0-9._%+-]*vid[A-Z0-9._%+-]*@[a-z]+\.[a-z]{2,}"
# some grep warm up runs
time grep -rhioE "$pattern" | len
10
grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} -rhioE 0,02s user 0,03s system 98% cpu 0,048 total
wc -l 0,00s user 0,00s system 5% cpu 0,047 total
# some ripgrep warm up runs
time rg -ioI "$pattern" | len
10
/tmp/rg -ioI "$pattern" 0,16s user 0,03s system 294% cpu 0,065 total
wc -l 0,00s user 0,00s system 4% cpu 0,065 totalWhat is the expected behavior?
I would expect ripgrep to be faster than grep.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugA bug.A bug.rollupA PR that has been merged with many others in a rollup.A PR that has been merged with many others in a rollup.