Hacker News new | ask | show | jobs
by ajg1977 4892 days ago
Well that point is complete nonsense so you should undrive it.

Just because a piece of code incurs hardware related performance issues does not mean it's "no longer close to the real machine". Cache misses? Reorder your data, or start inserting prefetch statements. Mispredicted branches? Issue a hint, or structure your code better.

Both of these are profile-guided optimizations. It's very difficult for compilers to optimize for access patterns that will only become clear in the context of execution, and often depend on your target spec machine.

1 comments

But a JIT can perform such optimizations. Which doesn't help Haskell, but may help JavaScript or Lua beat C in some cases.
I'm doubtful that a JIT could realistically adapt its output based on runtime performance metrics, but if you have links I'd love to read more.