2 ms·
Seeing the actual x86 or x64 code here would be insightful. It's hard to guess (though not impossible, I suppose) why this might be happening given just the cod
by mmastrac 14y ago
Seeing the actual x86 or x64 code here would be insightful. It's hard to guess (though not impossible, I suppose) why this might be happening given just the code, but seeing the emitted assembly would clearly show what improves. It's possible that adding that assignment changes the register allocation/stack spill just enough to be slightly more optimal.
Is there any code before or after that has been omitted that might be contributing to the 5% speedup?
- unwind 14y agoI totally agree, without a disassembly this is hardly a "technique" although I guess the poster is using the word ironically. Still, it would be very interesting to be able to actually try to analyze what's giving the speed-up.
- latitude 14y agoNo, no changes before or after or anywhere else. Just that one line. I have written my share of hand-optimized assembly, but this is just an optimizer peculiarity. I am not after trying to understand why it happened, and I was making a joke calling it a "technique". That said, here's an assembly dump of both versions, just in case :) - Slower version - https://gist.github.com/4454234 https://gist.github.com/4454234 Faster version - https://gist.github.com/4454238 https://gist.github.com/4454238