4 ms·
Are you sure that the size of the intermediate representation is a good indication of suitability to inline? I think we'd be replacing one arbitrary heuristic w
by chrisseaton 11y ago
Are you sure that the size of the intermediate representation is a good indication of suitability to inline? I think we'd be replacing one arbitrary heuristic with another. If we wanted to do really well we'd look at the cost of the actual operations in both the caller and callee, and reason about how they interact with inlining and things like that, but that's a bottomless pit of a problem and by then the user has browsed to a different page.
- hyperpape 11y agoHotspot and V8 serve very different niches, but doesn't Hotspot use the size of the bytecode for this decision? (Or rather, that's the first step of deciding. It will inline larger methods if they're sufficiently hot).
- spullara 11y agoTrue, just a better heuristic (Hotspot uses it). Not clear that with javascript you have time to do a better job. Even if it was done in the parser I think you could make a better size counter that didn't include comments and names.