I have a huge problem. I have a common library, that is used all across my project. This library intensively uses boost.spirit
and boost.fusion
. Unfortunately, the library is approx. 700Mb in size. All the boost.spirit
-heavy code is used and it works well. What steps can be done to reduce its output size? Is there is a tool that can help to determine what template instantiations waste most of the space?
At first, I decided to move all spirit-aware code to cpp files. Second, I will try different compiler flags to optimize for size. I don't know what else to do.
Update(details)
I'm using GNU toolchain. Huge library is actually a static library. Executable, that uses this 700Mb library is 200Mb in size. At least half of the code is in *.h files. Some boost.spirit
grammars (very template heavy thing) is also located in *.h files.
Cheers!