Hacker News new | ask | show | jobs
by bigcheesegs 1848 days ago
Compiler dev here. Do you really think we just come up with code transformations and add them to the compiler just because?

All code transformations have a compile time cost and runtime perf impact. We don't add transformations unless the runtime perf impact greatly outweighs the compile time cost.

These optimizations are added because they measurably improve the performance of real code. This comes up in every review for new or updated optimization passes. This claim that they aren't justified is actually rather insulting to the effort put in to improve perf without taking days to compile.

1 comments

However Fortran, Ada, Java, .NET Native, Swift,... are certainly less subject to such optimizations with surprises.