3 ms·
It was addressed that it didn't optimize it this way, but no one has clarified why it didn't. I'm curious!
by rocky1138 8y ago
It was addressed that it didn't optimize it this way, but no one has clarified why it didn't. I'm curious!
- ygra 8y agoA Just-in-time compiler has to find a balance between compilation time (which slows down your program or makes it slower to start) and optimization quality. So a lot of optimizations that are OK in C++ where you have lots of time because of AOT compilation are not feasible for a JIT. Things could be different by now, though, with RyuJIT and tiered compilation. That article is quite old (although processors still work the same, just with larger caches).
- monocasa 8y agoConstant propagation is pretty cheap though and is a common JIT compiler technique.