Open utterances-bot opened 2 years ago
Also the for loop is not need since go test has now a -count=xx argument.
Unfortunately, if I strip off everything except the Benchmark lines, the benchstat command doesn’t output anything. Note that in the benchmark --help, the old.txt comes first and new.txt second. You reversed them in your blog post.
Benchmarking Go code - Jiayu's Blog
I recently attended GopherCon Singapore 2019, and one of the talks was about optimising Go code, by Daniel Martí. I managed to find a set of his slides from a previous conference that he gave the same talk at: Optimizing Go code without a blindfold Daniel Martí at dotGo 2019 https://www.dotconferences.com/2019/03/daniel-marti-optimizing-go-code-without-a-blindfold My main takeaway from his talk the usage of benchstat for computing statistics from multiple runs of go test -bench, which helps to remove noise and identify statistically significant results:
https://blog.jiayu.co/2019/05/benchmarking-go-code/