|
As a compiler guy, I'd appreciate some look at the layers of abstraction in-between (so, ASM).
Microbenchmarks are famously jittery on modern CPUs due to cache effects, branch prediction, process eviction, data dependencies, pipeline stalls, OoO execution, instruction level parallelism, etc. You have to be really careful to ensure the numbers you're getting are really coming from the thing you're trying to benchmark, and aren't corrupted beyond recognition by your benchmarking harness. Some of these questions would surely be trivial if I actually knew any Go, but I'm left wondering: * What does the machine code / assembly look like for this? What does the cast compile down to? * What's `int` an alias for? I assume 64-bit-signed-integer? * Are integer casts checked in go? Would an overflowing cast fault? |
* Architecture based, so 32 or 64 bit signed integer.
* No faults. Signed become -1 and unsigned become MAX.