2 ms·
Some optimizations are disabled when Golang is running benchmarks.
by Kubuxu 9y ago
Some optimizations are disabled when Golang is running benchmarks.
- iand 9y agoI don't think that is correct. Do you have a link to more information about it. When writing benchmarks in Go you always need to take steps to circumvent the optimizer detecting functions with no side effects. Assigning the result of a benchmark to a public package level variable is usually enough.
- cormacrelf 9y agoAs in Rust, which has a test::black_box, which is unintelligible to the optimizer.