3 ms·
I ran each test four times and picked the best result — not my first rodeo — but for the first result I picked the wrong time from my output, which obviously di
by atombender 10y ago
I ran each test four times and picked the best result — not my first rodeo — but for the first result I picked the wrong time from my output, which obviously didn't make use of the cache. Here's it again, complete result, added --no-mmap:
# ggrep
zerogravitas$ for x in {1..4}; do (time ggrep erzg4 k.json >/dev/null); done
ggrep erzg4 k.json > /dev/null 1.96s user 0.67s system 99% cpu 2.641 total
ggrep erzg4 k.json > /dev/null 1.95s user 0.68s system 99% cpu 2.660 total
ggrep erzg4 k.json > /dev/null 2.00s user 0.66s system 99% cpu 2.672 total
ggrep erzg4 k.json > /dev/null 1.96s user 0.67s system 98% cpu 2.662 total
# rg
zerogravitas$ for x in {1..4}; do (time rg erzg4 k.json >/dev/null); done
rg erzg4 k.json > /dev/null 1.76s user 1.40s system 99% cpu 3.180 total
rg erzg4 k.json > /dev/null 1.77s user 1.31s system 99% cpu 3.088 total
rg erzg4 k.json > /dev/null 1.74s user 1.36s system 99% cpu 3.128 total
rg erzg4 k.json > /dev/null 1.76s user 1.41s system 97% cpu 3.265 total
# rg --no-mmap
zerogravitas$ for x in {1..4}; do (time rg erzg4 k.json --no-mmap >/dev/null); done
rg erzg4 k.json --no-mmap > /dev/null 0.98s user 0.75s system 99% cpu 1.743 total
rg erzg4 k.json --no-mmap > /dev/null 0.99s user 0.75s system 99% cpu 1.740 total
rg erzg4 k.json --no-mmap > /dev/null 1.01s user 0.76s system 99% cpu 1.772 total
rg erzg4 k.json --no-mmap > /dev/null 0.99s user 0.75s system 99% cpu 1.754 total
# rg -j4
zerogravitas$ for x in {1..4}; do (time rg erzg4 k.json -j4 >/dev/null); done
rg erzg4 k.json -j4 > /dev/null 1.75s user 1.35s system 98% cpu 3.134 total
rg erzg4 k.json -j4 > /dev/null 1.75s user 1.44s system 98% cpu 3.224 total
rg erzg4 k.json -j4 > /dev/null 1.80s user 1.38s system 99% cpu 3.204 total
rg erzg4 k.json -j4 > /dev/null 1.80s user 1.35s system 99% cpu 3.164 total
# rg -j4 --no-mmap
zerogravitas$ for x in {1..4}; do (time rg erzg4 k.json -j4 --no-mmap >/dev/null); done
rg erzg4 k.json -j4 --no-mmap > /dev/null 0.98s user 0.75s system 99% cpu 1.740 total
rg erzg4 k.json -j4 --no-mmap > /dev/null 0.97s user 0.74s system 99% cpu 1.721 total
rg erzg4 k.json -j4 --no-mmap > /dev/null 0.99s user 0.75s system 99% cpu 1.752 total
rg erzg4 k.json -j4 --no-mmap > /dev/null 0.98s user 0.76s system 99% cpu 1.748 total
Sounds like "alias rg=rg --no-mmap" is a good idea on a Mac.
- burntsushi 10y agoWow. Those are awesome results, thank you. > Sounds like "alias rg=rg --no-mmap" is a good idea on a Mac. I will fix that in ripgrep proper by making --no-mmap the default on Mac. :-) It should be an easy one to knock off: https://github.com/BurntSushi/ripgrep/issues/36 https://github.com/BurntSushi/ripgrep/issues/36 > not my first rodeo Right, sorry about that. :-) Just had to cover all my bases! (Also, `-j` on a single file won't do anything, and ripgrep should try to use multiple threads by default when searching multiple files.)
- lobster_johnson 10y agoI suspected that -j wouldn't do anything on a single file. For three large (6.5GB in total) files I'm getting good performance, about 1.6x of what GNU Grep does, best case.