1

I'm working on a large code base with thousands of small classes in individual header and source files which are compiled into a single shared object as follows

g++ -o Class1.o Class1.cxx
g++ -o Class2.o Class2.cxx
g++ -o Class3.o Class3.cxx
...
g++ -o Final.so Class1.o Class2.o Class3.o ...

It is my understanding that the compiler can't inline across different object files. Given that this is a large code base where (what should be) a simple getter function can make up to ten calls to members of different classes, is there scope for optimization by compiling all files simultaneously into the shared object or by using the -flto flags?

iwans
  • 445
  • 3
  • 13

0 Answers0