Servus!
I have investigated the memory allocation while compiling my master state machine with the favor_compile_time policy (5 submachine -> 5 *.hpp-files + 5 *.cpp files + each submachine back-end has the favor_compile_time policy as 2nd parameter) and without the favor_compile_time policy (5 submachines -> 5 *.hpp-files + 1 main.cpp with the instantiation of the master machine)
My results: *Without policy:* Memory allocation: 600 Mb; Compile time: 01:10min; dll size: 1 Mb; Conclusion -> with the "-g3" option we run out of memory and we will receive the curious "out of memory allocation" problem from the cc1plus.exe again.
*With policy:* Memory allocation: 400 Mb; Compile time: 01:50min; dll size: 1.5 Mb; Conclusion -> we can now also use the "-g3" without running into the "cc1plus.exe out of memory problem".
Are you talking about the added compile time of 5 modules or does the parallel build take 01:50min? If latest, I'd be very suprised. The biggest advantage of this mode is the ability to build faster because of parallel building. That the added time is higher is possible yes. For example, the outer fsm still need to instantiate a some templates for its submachines. The gain comes from the process_event instantiations, which are divided between several modules.
But why is the compilation time with "favor_compile_time" bigger than without the policy? And why to hell is the dll file size about 50 % bigger (okay, we have know 5 object files and with additional symbols, maybe this is the reason... I'm not an expert regarding this..)
As I said, with the policy, there is a bit more work for the compiler. How much depends mostly on the number of states of the submachines. The 50% bigger probably come from the symbols yes. gcc is known for this, it's about the only point where VC is better. That said, I'm not a compiler writer ;-)
Christophe, I'm curious about your opinion:)...
BR, Rafael
HTH, Christophe