Created
March 4, 2012 12:31
-
-
Save telendt/1972797 to your computer and use it in GitHub Desktop.
multiprocess zgrep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time find /opt/local/share/emacs/23.4/lisp/ -type f -name \*.gz -exec zgrep --color=yes -H -n -e "conf-mode" {} \; | |
real 0m12.239s | |
user 0m7.327s | |
sys 0m6.804s | |
$ time find /opt/local/share/emacs/23.4/lisp/ -type f -name \*.gz -exec zgrep --color=yes -H -n -e "conf-mode" {} + | |
real 0m8.574s | |
user 0m4.950s | |
sys 0m5.995s | |
$ time find /opt/local/share/emacs/23.4/lisp/ -type f -name \*.gz -print | parallel zgrep --color=yes -H -n -e "conf-mode" | |
real 0m5.092s | |
user 0m13.632s | |
sys 0m14.330s | |
$ time find /opt/local/share/emacs/23.4/lisp/ -type f -name \*.gz -print0 | xargs -0 -n 1 -P $( sysctl -n hw.ncpu ) zgrep --color=yes -H -n -e "conf-mode" | |
real 0m3.322s | |
user 0m10.596s | |
sys 0m10.220s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful!