Project using Boost.Units compiling slowly

Hi, I finally figured out how to use Boost.Units. But now it is compiling very slowly. It compiles in about 30 minutes on my local Windows machine using Cygwin, and in about 15 minutes on my remote CentOS server. There is very little code, but I am using a lot of units. Is there any way to speed it up? I don't know exactly how many units I'm using, because I have several macros for more easily defining them, but I know that there are many. Right now it is just a test program for testing out the units, but obviously I'll be expanding it soon and I'm worried that it is already taking so long to compile. Thanks, Brandon -- www.creatorspiritus.com Blog and forum discussing living a Christ-centered life Follow me on Twitter: http://twitter.com/devbanana Follow creatorspiritus.com on Twitter: http://twitter.com/creatorspiritus

On Thu, Dec 24, 2009 at 8:08 PM, Brandon Olivares
Hi,
I finally figured out how to use Boost.Units. But now it is compiling very slowly. It compiles in about 30 minutes on my local Windows machine using Cygwin, and in about 15 minutes on my remote CentOS server. There is very little code, but I am using a lot of units. Is there any way to speed it up?
I don't know exactly how many units I'm using, because I have several macros for more easily defining them, but I know that there are many.
Right now it is just a test program for testing out the units, but obviously I'll be expanding it soon and I'm worried that it is already taking so long to compile.
For note, templates are basically an entire programming language on its own, but it was not originally conceived to be such a thing, mostly an accident of the type system. Now, since the fact it is a meta-language that came from the type system, it is very slow in most compilers as they did not foresee a need to create a fast type resolution system. GCC4 has been making *great* strides to speed it up, and it is getting even better over time. However, Visual Studio, even the latest versions, have not really helped with compiling speed, they are more interested in working on their .NET stuff then actually making a fast C++ compiler, however, Visual Studio does often optimize template code better then GCC (which will not actually matter for something as simple as the Units sublibrary), but regardless, GCC is getting better, and Clang should be yet even better later on For some types of template code (like Spirit) there are ways to speed things up by moving things across translation units, but with the units sublibrary that is more difficult to do, not a lot you can do, best suggestion is just try the newest compilers (especially with GCC).

On 2009-12-24, OvermindDL1 wrote:
On Thu, Dec 24, 2009 at 8:08 PM, Brandon Olivares
wrote: ... best suggestion is just try the newest compilers (especially with GCC).
Thanks. On my server I'm running gcc 4.1.2, and 3.4.4 on my PC, which might explain the difference in compilation time. I was reading about precompiling headers possibly being a way to speed up compilation. Would that work in this case, and which ones should I precompile? Thanks, Brandon
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Brandon www.creatorspiritus.com Blog and forum discussing living a Christ-centered life Follow me on Twitter: http://twitter.com/devbanana

On Thu, Dec 24, 2009 at 8:51 PM, Brandon Olivares
On 2009-12-24, OvermindDL1 wrote:
On Thu, Dec 24, 2009 at 8:08 PM, Brandon Olivares
wrote: ... best suggestion is just try the newest compilers (especially with GCC). Thanks. On my server I'm running gcc 4.1.2, and 3.4.4 on my PC, which might explain the difference in compilation time.
I was reading about precompiling headers possibly being a way to speed up compilation. Would that work in this case, and which ones should I precompile?
As I recall, but do not quote me on this, precompiled headers do not help when templates are involved and can actually hurt. PCH's are wonderful for non-template headers with thousands of forward declared functions though.
participants (2)
-
Brandon Olivares
-
OvermindDL1