Freestyle is in the top 5 slow building projects (in both release and debug builds) with msvc.
While the code isn't overly complicated or hard to optimize for, there is *A LOT* of it nearly 250 compilation units, all including +- the same set of headers (most of them include python.h which will will be hard to get rid of if we rather just clean up the includes), making bf_freestyle a prime candidate for using pre-compiled headers.
This patch add a blender_precomp macro for specifying a precompiler header+cpp for any given project, with currently only an msvc implementation (i really have no idea how gcc handles this) speeding up the build process 3-5x (depending on compiler/configuration)
Results:
I'd classify this one as a WIP, as there are a couple of open questions
- are we even willing to consider using precompiled headers?
- should there be a global option for turning this on/off?
- if this is a route we want to take, we probably need to expand the macro with some gcc support?
Another option to speed up compilation is trying to merge as many of the .cpp files as we can into a single compilation unit, (also known as a unity build) but imho that's a nightmare for the maintainer
a final option would be: do nothing, although it's slow, it's not *that* slow.




