News for hackers. Stuff that matters.
Re:Why is Rosetta 2 fast? by saagarjha on Wednesday November 09, 2022 @02:11PM (#33536417)
It depends greatly on which optimization levels you’re going through. —O0 to -O1 can easily be a 2-3x performance improvement, which is going to be hard to get otherwise. -O2 to -O3 might be 15% if you’re lucky, in which case -O+LTO+PGO can absolutely get you wins that beat that.
Re:Why is Rosetta 2 fast? by bluGill on Wednesday November 09, 2022 @03:11PM (#33537177)
-O2 to -O3 has in some benchmarks made things worse. In others it is a massive win, but in generally going above -O2 should not be done without bench marking code. There are some optimizations that can make things worse or better for reasons that compiler cannot know.
Re:Why is Rosetta 2 fast? by astrange on Wednesday November 09, 2022 @04:09PM (#33537871)
Over-optimizing your "cold" code can also make things worse for the "hot" code, eg by growing code size so much that briefly entering the cold space kicks everything out of caches.
Re:Why is Rosetta 2 fast? by hinkley on Wednesday November 09, 2022 @04:43PM (#33538323)
I have often lamented not being able to hint to the JIT when I’ve transitioned from startup code to normal operation. I don’t need my Config file parsing optimized. But the code for interrogating the Config at runtime better be.

Everything before listen() is probably run once. Except not ever program calls listen().

Re:Why is Rosetta 2 fast? by hinkley on Wednesday November 09, 2022 @04:41PM (#33538298)
And then there’s always the outlier where optimizing for size makes the working memory fit into cache and thus the whole thing substantially faster.