logoalt Hacker News

pton_xdtoday at 8:11 PM1 replyview on HN

"More importantly, when this loop matters enough for me to care about a 5x speedup, I want the vectorization to be explicit and predictable. I don't want an unrelated code change or compiler update to quietly turn it back into a scalar loop."

Only tangentially related but this is by far the most painful part about optimizing code for JIT compilers like V8. Even changing a constant from 1 to 1.0 somewhere else can change the optimizations performed and lead to an unexpected performance decrease.


Replies

pjmlptoday at 9:17 PM

Proving the point that the compilers aren't deterministic as some folks argue.

This is especially painful with dynamic languages, like in JavaScript's case.

However JIT also have positives hence their widespread use.