Timeline for Most efficient grep method
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 23, 2012 at 12:26 | comment | added | manatwork |
@poige, it's Frugalware GNU/Linux and used GNU grep 2.14.
|
|
| Oct 23, 2012 at 12:21 | comment | added | poige | @manatwork, 10x! It's strange a bit, what's your distro? | |
| Oct 23, 2012 at 12:12 | comment | added | manatwork |
@poige, the only difference is a warning: “grep: the --mmap option has been a no-op since 2010”. The times are the same as without --mmap.
|
|
| Oct 23, 2012 at 11:37 | comment | added | poige |
@manatwork, can you also make those tests with --mmap?
|
|
| Oct 23, 2012 at 10:06 | comment | added | manatwork |
@Marco, why I suggested -f is to avoid Jasper's initial intention of using multiple grep calls, each with a subset of the code list. grep, especially GNU grep, is strong in optimization, is better to just let it work instead of spoonfeeding it. Of course, @poige's -F still improves a lot. pastebin.com/P8tTEmie
|
|
| Oct 23, 2012 at 9:36 | comment | added | Marco |
@poige The performance increase comes from -F (which is not mentioned in this answer) and not from -f, right?
|
|
| Oct 23, 2012 at 9:31 | comment | added | poige |
@Marco, it would be faster with --fixed-strings aka -F aka fgrep
|
|
| Oct 23, 2012 at 9:27 | comment | added | Marco | Is that actually faster or just more convenient to work with? | |
| Oct 23, 2012 at 9:25 | comment | added | Jasper | Hmm the first few runs it seemed faster but that might be human interpretation. Need to run time on it as well. Is it also possible to delete the grepped lines from the file? | |
| Oct 23, 2012 at 9:15 | history | answered | manatwork | CC BY-SA 3.0 |