Created
January 2, 2015 17:26
-
-
Save Stantheman/a1b5d1186f63b9e30492 to your computer and use it in GitHub Desktop.
test perf between patched and unpatched go encoding/binary
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 | |
echo "Testing Original" | |
cp binary_orig.go.old binary.go | |
for i in {1..5}; do | |
go test -v -bench='[de]Ints' -run none | grep Read | tee /tmp/tmp.txt | |
done | |
echo "Original read ns/op average: $(tr -s ' ' < /tmp/tmp.txt | cut -d' ' -f3 | numaverage)" | |
echo "Testing Fixed" | |
cp fixed_binary.go.old binary.go | |
for i in {1..5}; do | |
go test -v -bench='[de]Ints' -run none | grep Read | tee /tmp/tmp.txt | |
done | |
echo "Fixed read ns/op average: $(tr -s ' ' < /tmp/tmp.txt | cut -d' ' -f3 | numaverage)" | |
rm /tmp/tmp.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment