My laptop id Lenovo Yoga 2 Pro with the following specs:
- OS: Windows 8.1 64 bit
- CPU: 4th Generation Intel Core i3-4030U Processor (1.90GHz 1600 MHz 3MB)
- Memory: 4.0GB PC3-12800 DDR3L SDRAM 1600 MHz
- Storage: 128 Gb SSD
Tool version | Time in seconds | Command line |
pt 1.7.6 | 33.3 | pt /w /stats Norway |
GnuWin grep 2.5.4 | 6.5 | timethis grep -r -w Norway * |
ag 0.18.1 | 8.5 | ag --literal --stats Norway |
ag 0.29.1 | 14.4 | ag --literal --stats Norway |
Honestly, looking at the results, I have no idea why Grep gets a lot of frowning upon and why The Platinum Searcher even gets any attention at all, in my case it has shown the worst performance by far being the resource hog at the same time. Life is full of surprises indeed.
It's quite possible I'm just missing something obvious, but then again, it's a perfect real-life use case. I mean, what can be simpler than running a stupid search against a bunch of files?
P.S. Just ran the tests on a Linux machine (Dell PowerEdge 2950/0DT021).
- OS info: CentOS release 5.7 (Final) x86_64 GNU/Linux version 2.6.18-274.17.1.el5 (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51))
- CPU: 8 core Intel(R) Xeon(R) X5355 @ 2.66GHz stepping 07
- Memory: 16 Gb
- Storage: 750 GB SATAu (7.2K rpm)
Tool version | Time in seconds | Command line |
pt 1.7.6 | 60 | pt -w -stats Norway |
Gnu grep 2.5.1 | 1.3 | time grep -r -w Norway * |
ag 0.29.1 | 2.8 | ag --literal --stats Norway |
And again, The Platinum Searcher is a complete total loser here. I think I'll be sticking to The Silver Searcher for a while (as it seems more flexible than Grep in terms of flexibility when you want to exclude some patterns from your search)...