3 ms·
Stack allocation that depends on escape analysis is not very predictable at all, unless the programmer can force an error if escape analysis fails. Explicit st
by seanmcdirmid 12y ago
Stack allocation that depends on escape analysis is not very predictable at all, unless the programmer can force an error if escape analysis fails.
Explicit stack allocation via pass/return-by-value structs (as in C#) works well if predictability is a goal.
- pcwalton 12y agoEspecially considering this very article is about the ways that escape analysis can fall down in surprising circumstances.
- seanmcdirmid 12y agoThis is a problem with any optimization that relies on analysis vs. language guarantees; if you can't codify some optimization in your semantics, it might as well not exist and can go away given any small change in your code. You have to track both correctness and performance regressions, with no real easy guidance on the latter.