Created
August 3, 2017 10:54
-
-
Save ian-kent/e2948b40e1c657eb52190c5821d7bad5 to your computer and use it in GitHub Desktop.
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
package log | |
import ( | |
"testing" | |
stdlog "log" | |
) | |
func BenchmarkLog(b *testing.B) { | |
HumanReadable = false | |
for n := 0; n < b.N; n++ { | |
Debug("test", nil) | |
} | |
} | |
func BenchmarkStdLog(b *testing.B) { | |
for n := 0; n < b.N; n++ { | |
stdlog.Println("test test test test test test test test test test test test test test test") | |
} | |
} |
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
go test -run=^$ -bench=. -cpuprofile=cpu.out | |
go tool pprof log.test cpu.out | |
from inside pprof - run 'pdf' command | |
then open output001.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment