(I have now recreated it on my Mac, under 1.7rc5, the runtime differences 
are still there.) I thought the compiler was removing these as you suggest, 
but then StartEnd and EndStart had wildly different running times, despite 
using the very same values. So I added dummy assignments to double check 
and nothing has changed

https://play.golang.org/p/kpsyWHkFBE

So it seems the behaviour changed between 1.6 and 1.7 - either it better 
hints the CPU, or it eliminates some instructions in the new SSA backend.

On Wednesday, 3 August 2016 23:15:05 UTC+1, Dave Cheney wrote:
>
> You need to use the values to ensure that compiler does not remove the 
> code. Even if the compiler does not do this, your Intel CPU will, if 
> effectively runs an ssa implementation in hardware and will spot the dead 
> stores and skip the load.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to