4 ms·
OTOH, it might be a net negative in latency if you're icache limited. Depends on the access pattern among other things, of course.
by xxpor 2y ago
OTOH, it might be a net negative in latency if you're icache limited. Depends on the access pattern among other things, of course.
- munificent 2y agoYup, you always have to measure. Though my impression is that compilers tend to be fairly conservative about inlining so that don't risk the inlining being a pessimization.
- rasalas 2y agoIn my experience it's the "force inline" directives that can make this terrible. I had a coworker who loved "force inline". A symptom was stupidly long codegen times on MSVC.
- foobazgt 2y agoMy experience has been that it's rather heuristic based. It's a clear win when you can immediately see far enough in advance to know that it'll also decrease the amount of generated code. You can spot trivial cases where this is true at the point of inlining. However, if you stopped there, you'd leave a ton of optimizations on the table. Further optimization (e.g. DCE) will often drastically reduce code size from the inlining, but it's hard to predict in relationship to a specific inlining decision. So, statistics and heuristics.