Code review comment for lp:~jpakkane/unity-scopes-api/visibility

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

The performance improvement does not come from these few methods. They come from all the small helper functions and the like that come from libraries, especially templates. Because of the symbol map these are not exported but this is not known at compile time and thus the compiler needs to assume the worst. Gcc's wiki and Ulrich Drepper's shared library tutorial paper have a more through discussion on this subject. As an example, on a debug build the test .so (which has all symbols) shrinked from 40MB to 38MB. The symbol stripped one stayed roughly the same size.

As far as the ABI is concerned this may or may not be an ABI break. The reasons for this are a bit complicated. Since the destructors are compiler generated, they are inline and also show up in the .so. However those methods are never called in the .so, but rather the inlined version in the client is called. (To be precise, either one could be called, but gcc probably always uses the inline ones).

This has the downside that if we ever ever create an actual method for one of these, the visible ABI does not change but we have silently broken the ABI. Any code linked against the old version will call its own inlined destructor instead of the one in the .so which causes things so fail, eiher violently or silently.

If we are really serious about ABI then we can't merge this. But on the other hand we can never create an implementation for these affected methods either.

« Back to merge proposal