5 ms·
Maybe some day they will add profile guided optimization to C compilers.
by tedunangst 14y ago
Maybe some day they will add profile guided optimization to C compilers.
- taf2 14y agoyou're kidding right? and at least referring to gcc's -fprofile-generate -fprofile-use right?
- tptacek 14y agoProfile-guided optimization is decades old. It was, for example, one of the things people loved about the (Ultrix?) DEC Alpha compiler was profile-driven optimization.
- wglb 14y agoFirst VMS. That was one of the outstanding compilers ever written.
- pbiggar 14y agoThere is a major difference between performing profile-generated optimizations at compile-time based on sample data, and performing it at run-time based on real data. It is one pretty good way in which JITs could beat programs implemented directly in C.
- gillianseed 14y agoNot really since the 'sample' data is 'real' data which has been gathered during run-time.
- pbiggar 14y agoThat is the most optimistic statement about profile-directed optimization that I have ever read.
- thedigitalengel 14y agoThey're not the same. VMs can assume invariants (which may not always hold) and compile specialized methods which depend on those assumptions and then fall back to a non-optimized version during the execution of a method. To do something like that (OSR) in C, you'll have to have a very sophisticated runtime.