News for hackers. Stuff that matters.
Re:Compiler Optimizations are Awesome by Sean1708 on Thursday June 01, 2017 @09:22AM (#14459998)
Certainly in my experience it's about 90-9-1; where 90% of the runtime is "cold", 9% is "warm" (optimising compiler is good enough), and 1% is "hot". I'm literally writing some code right now where -O2 pushes us from "not fast enough in the average case" to "just about fast enough in the worst case". I fully accept that things might be different in Web Development, but are optimising compilers really that common in Web Dev?
Re:Compiler Optimizations are Awesome by tom_mellior on Thursday June 01, 2017 @02:39PM (#14463135)
>> [99% of all code is cold] > in my experience it's about 90-9-1

I don't think such numbers can be meaningfully presented as representative data. They are probably true for certain specific application domains such as crypto or signal processing, if you squint at the data just the right way (i.e., by benchmarking a crypto library with a tiny driver program, not as part of a real application).

I did some profiling on the SPEC CPU 2000 benchmarks some years ago. I don't have the exact numbers lying around. But I recall large variation among the different benchmarks, with anything from 90% of execution time in the top function to the top 60% of execution time spread evenly (i.e., 20% each) over the top three functions. So some things certainly follow the patterns above, and others... don't.

I've also several times optimized programs until their profile was so flat that you could say that 100% of the code was lukewarm.

Re:Compiler Optimizations are Awesome by emilecantin on Thursday June 01, 2017 @11:01AM (#14460787)
There's an impressive amount of resources poured into making Javascript faster; we often have to think about what the interpreter will do with the code we write in order to let it do some optimisations.
Re:Compiler Optimizations are Awesome by Sean1708 on Thursday June 01, 2017 @11:29AM (#14461090)
Ah yeah, that's a good point.