Created
May 15, 2012 14:46
-
-
Save Stantheman/2702322 to your computer and use it in GitHub Desktop.
comparing here strings and pipes
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
#!/bin/bash | |
for i in {1..1000}; do | |
sed 's/lo//' <<< "hello world\n" | |
done |
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
➜ ~ time ./pipes.sh &>/dev/null | |
./pipes.sh &> /dev/null 0.46s user 5.36s system 121% cpu 4.806 total | |
➜ ~ time ./herestring.sh &>/dev/null | |
./herestring.sh &> /dev/null 0.39s user 3.54s system 99% cpu 3.960 total | |
➜ ~ time ./pipes.sh &>/dev/null | |
./pipes.sh &> /dev/null 0.43s user 5.31s system 121% cpu 4.724 total | |
➜ ~ time ./herestring.sh &>/dev/null | |
./herestring.sh &> /dev/null 0.38s user 3.60s system 99% cpu 4.001 total | |
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
#!/bin/bash | |
for i in {1..1000}; do | |
echo "hello world" | sed 's/lo//' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment