5

I have root state machine with about 40 transitions (including four substate machines). All worked well, but when i start raising number of transitions compilation time is significantly increased (development of large state-machine become hell). I tried to use boost::msm::back::favor_compile_time policy, and split submachines to muliple translation units, but it does not have effect. Anybody have some workaround about this problem? Boost - 1.53, Compiler - MSVC 2012, Processor - Intel i7


Upd: Best way to reduce time - remove boost msm from project

asaenko
  • 235
  • 1
  • 2
  • 11

1 Answers1

3

"but it does not have effect"

I think the idea is that splitting across TUs speeds things up /because/ you don't always need to rebuild the TUs, not necessarily that a clean rebuild would be quicker.

In fact, I'd expect a (non-parallellized) build to be slower for more TUs, because each TU ends up including 99% of the same code in headers. Pre-compiled headers can alleviate this somewhat.

In this respect, adding the relevant headers (and pre-processor #defines) to stdafx could help.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Precomiled headers can't help there due nature of boost msm - very big part of changes are occured in headers (transition_table,template actions), so when headers will be changed, precompiled header will be fully rebuild. – asaenko Apr 22 '14 at 11:41
  • @asaenko I'm aware of that :) However, splitting it into separate TUs _entails_ hiding the generic parts into the source files. If you're simply still exposing it in the header, you didn't split anything into TUs, you simply spread it over multiple ones - thereby _increasing_ the compilation time. Believe me, I know, because compiling [tag:boost-spirit] heavy stuff is likely heavier on the compiler :| Anyways, the trick is: at some point you will want to compiler-firewall implementation details – sehe Apr 22 '14 at 11:45