2 ms·
Ah yes this kind of interface ok indeed this doesn't seem like a useful layer when running the program. Maybe the compilers could optimize this though
by ttoinou 1y ago
Ah yes this kind of interface ok indeed this doesn't seem like a useful layer when running the program. Maybe the compilers could optimize this though
- jeremiahar 1y agoIn my experience, as long as there's only a single implementation, devirtualization works well, and can even inline the functions. But you need to pass something along the lines of "-fwhole-program-vtables -fstrict-vtable-pointer" + LTO. Of course the vtable pointer is still present in the object. So I personally only use the aforementioned "thin headers" at a system level (IRenderer), rather than for each individual object (ITexture).
- drysine 1y agoThey can sometimes https://quuxplusone.github.io/blog/2021/02/15/devirtualization/ https://quuxplusone.github.io/blog/2021/02/15/devirtualizati...