Page 1 of 1

C++Builder XE2 Compilation Times

Posted: Tue Oct 28, 2014 3:02 pm
by JonathanW
We are currently using TwineCompile version 3.6.0.272 with C++Builder 5 and C++Builder XE2.

One of our largest projects has about 400,000 lines of code over 700 source files. When building this project under C++Builder 5, TwineCompile made a huge improvement, dropping our compile times from over 30 minutes to less then 1 minute.

We are now working on bringing the project over to C++Builder XE2. The source remains the same but a new set of project files has been created. Unfortunately, enabling TwineCompile on this project causes build times to increase. With TwineCompile disabled, the project compile time is about 134 seconds. With TwineCompile enabled, compile time increases to 276 seconds.

I have found that if I select the option "Use PCH File for Each Thread", the compile time using TwineCompile drops to about 90 seconds. But I'm a bit fuzzy what this option actually does, and I was under the impression that I should not have that option selected because my project uses a common header file. Is this correct? Are there any other settings which might improve my compile times?

Thanks in advance!

Re: C++Builder XE2 Compilation Times

Posted: Wed Oct 29, 2014 7:56 am
by jomitech
That setting is good to use if you don't have an injected header file. It makes sure that each thread uses a separate PCH file, which allows the C++Builder compiler to keep updating the PCH file. With that option off, only the first file generates the PCH file, and all subsequent files just read it. If the project does not have a consistent header structure, this can negate the benefit of the single PCH file.