cmd/compile: slice hint seems to perform better than loop bound check #32492
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
CL 164966 was submitted was a BCE optimization to math/big.
It had a surprising comment -
To test it out, I ran the same benchmarks again by hoisting the bounds check out of the loop, and got an improvement. This issue is to investigate why I see an improvement but @josharian did not.
Here is what I did:
On a quiet machine, I ran -
gotip test -run=xxx -bench=BenchmarkAddV -tags=math_big_pure_go -count=10
The changes are -
And the benchmark results -
Josh says he did shorter runs. I set count as 10. Perhaps longer runs somehow affect the branch predictor ?
What version of Go are you using (
go version
)?cc'ing folks who were in the original CL - @josharian @mundaym @griesemer
My CPU details are
The text was updated successfully, but these errors were encountered: