C++ templates spew out a huge amount of symbols and a typical C++ library can easily surpass 30,000 symbols which is around 5-6Mb! Therefore if you cut out the 60-80% of unnecessary symbols, your DSO can be megabytes smaller! ELF's exported symbol table format is quite a space hog, giving the complete mangled symbol name which with heavy template usage can average around 1000 bytes. It reduces the size of your DSO by 5-20%. This gives greater latitude especially to the inliner which no longer needs to keep an entry point around "just in case". Furthermore when most of the symbols are bound locally, they can be safely elided (removed) completely through the entire DSO. PLT indirections (when a function call or variable access must be looked up via the Global Offset Table such as in PIC code) can be completely avoided, thus substantially avoiding pipeline stalls on modern processors and thus much faster code. It lets the optimiser produce better code. For example, a huge C++ template-based library which was tested (the TnFOX Boost.Python bindings library) now loads in eight seconds rather than over six minutes! It very substantially improves load times of your DSO (Dynamic Shared Object). Put simply, it hides most of the ELF symbols which would have previously (and unnecessarily) been public. Why is the new C++ visibility support so useful? This copy in the GCC wiki has some corrections that may not be present on Niall's site. Note: the text on this page was almost entirely written by Niall Douglas, the original author of the patch, and placed on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |