3 ms·
> On the other hand because of this added indirection, there's usually a greater performance hit to accessing these opaque structs since code can't be inlined.
by juunpp 3y ago
> On the other hand because of this added indirection, there's usually a greater performance hit to accessing these opaque structs since code can't be inlined.
Is this still true? Link-time optimization, which includes inlining, seems to be all the rage these days.
- simias 3y agoFor static linking quite possibly, although you could still have un-optimizeable sources of overhead because of having to indirect through pointers everywhere, for instance in nested structs. Something like a->b->c->d is going to be more expensive than a.b.c.d, for instance. I'm also not sure that dynamic linkers are typically smart enough to do this type of optimization, but I admit that I'm not familiar with the state of the art in dynamic linking technology.