Created
March 28, 2016 12:48
-
-
Save anonymous/01a7d9022b63eceee7ab to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/zsh | |
SHELL=/usr/bin/zsh | |
do_perf () { | |
printf "Going to run: %s\n" "$1" | |
for i in {1..5}; do | |
time $SHELL -c "$1" | |
done | |
printf "\n" | |
} | |
# cache stuff: | |
find /usr -name "*c*" -exec cat {} \; >/dev/null 2>&1 | |
do_perf('find /usr -name "*c*" -type f -exec cat {} \; | wc -l') | |
do_perf('find /usr -name "*c*" -type f -exec cat {} + | wc -l') | |
do_perf('find /usr -name "*c*" -type f -print0 | xargs -0 cat | wc -l') | |
do_perf('for i in /usr/**/*c*(.); do cat $i; done | wc -l') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment