Out of habit, I often write inline function definitions for simple functions like this one (contrived example)
class PositiveInteger { private: long long unsigned m_i; public: PositiveInteger (int i); }; inline PositiveInteger :: PositiveInteger (int i) : m_i (i) { if (i < 0) throw "oops"; }
I usually like to separate interface files and implementation files, but, nevertheless, this is my habit of those functions that the voice in my head speaks about, it will probably suffer greatly in hot spots.
I know that advice is โprofile one,โ and I agree, but I could have avoided the whole burden of profiling if I knew a priori that the compiler would produce the same final object code, whether functions like this were included at the time of compilation or link, (In addition, I believe that the implemented profiling code itself can lead to a time change that hides the effect of very simple functions, such as above.)
GCC 5.1 has just released an LTO ad (link time optimization). How good are they really? What functions can I safely disable, knowing the final executable file, will not be affected?
source share