Re:Random Acts of Optimization
by vitalyd on Thursday October 29, 2015 @06:34PM
(#10474871)
>For example, error paths are generally very cold, but how is a compiler supposed to know that a path is an error path? They just look like regular conditionals.
At least for .NET that path is likely throwing an exception. If you don't have a profile, statically assuming those paths are cold is likely to be correct.
Re:Random Acts of Optimization
by haberman on Thursday October 29, 2015 @07:01PM
(#10475035)
That's an interesting point -- my background is more in C and C++-without-exceptions. But in exception-based languages, I can see how the presence of "throw" would be a very useful signal for static analysis.
At least for .NET that path is likely throwing an exception. If you don't have a profile, statically assuming those paths are cold is likely to be correct.