Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » [FEATURE] PCH support
[FEATURE] PCH support [message #33373] |
Fri, 29 July 2011 11:43 |
Shire
Messages: 41 Registered: September 2006 Location: Russia, Yamal peninsula
|
Member |
|
|
Currently, TheIDE have no support for PCH compiling. PCH technology significally reduces partial rebuild time. I wrote small patch for MSC and GCC compilers.
Patch changes:
- remove build time bm* macros such bmYEAR and bmSECOND
- add flag PCH and corresponding checkbox in Output mode configuration dialog
- remove old automatic PCH switch in MSC builder
- change .pdb generation behavior. Now builder generates one .pdb for MSC >= 8 and multiple .pdbs (per thread) for MSC < 8. When compiling by MSC < 8 with PCH, compilation performs in one thread and generates one .pdb file.
- PCH compilation runs in parallel with source files. When PCH becomes ready then compilation performs using PCH
- BLITZ can also use PCH
- tested with MSC (7.1, 8.0, 9SP1, 10SP1), MinGW 3.4.5, TDIMinGW 4.5.1, GCC 4.4.5, GCC 4.7.1
How to enable PCH? Enter Package organizer, select header file, add compiler flag "PCH". Now open "Output mode" dialog, and set checkbox "PCH" for this package.
UPD:
Currently PCH can be used only for C++ files.
When PCH is enabled, it will be force included in every suitable C++ file.
If you want to disable PCH inclusion, set attribute "Optimize for speed" or compiler option (like "-DNOPCH") to C++ file.
UPD2:
Updated due to changes in ide/Builders package.
Unusable manifest embedding and output binary date correction (see here) removed.
UPD3:
Updated due to changes in ide/Builders package.
[Updated on: Thu, 26 December 2013 07:45] Report message to a moderator
|
|
|
Re: [FEATURE] PCH support [message #33375 is a reply to message #33373] |
Fri, 29 July 2011 13:15 |
|
Hi Shire!
One curious question: How much does it actually affect the build times? I believe that with BLITZ minimizing the count of header inclusions, the difference should be very small. Also, if I understand the theory behind precompiled headers correctly (I never used it), it is not very useful, unless your code is designed properly. Which most of the U++ probably isn't. So it will only help you on your own packages at this moment, right?
Best regards,
Honza
PS: What is the format of the patch? I'd recommend you to use 'svn diff' (assuming you use SVN), as it is best portable... Or just post all changed files in zip archive, it is often easier than deciphering weird diff format
|
|
|
Re: [FEATURE] PCH support [message #33376 is a reply to message #33375] |
Fri, 29 July 2011 14:53 |
Shire
Messages: 41 Registered: September 2006 Location: Russia, Yamal peninsula
|
Member |
|
|
Weird diff format? It human readable! Use "patch" tool, Luke. See attachment.
I have no access to external SVN repository here.
Build time reducing in 1.5-3 times per single C++ file depend on compiler.
Benchmarks performed on uppsrc/ide package in full debug.
First build was full, with all files included. For include all files in blitz batch their dates made equal.
Second build performed after touching 4 files (Assist.cpp, AutoSetup.cpp, idewin.cpp, idebar.cpp).
Third build (touched same files) executed only for Blitz.
Core 2 Duo 2.4GHz, 2Gb RAM, WXP Pro, MSC 10SP1
No options (compile everything)
Toggle Spoiler
Full
ide: 45 file(s) built in (1:14.14), 1647 msecs / file, duration = 79610 msecs, parallelization 100%
Partial
ide: 4 file(s) built in (0:06.98), 1745 msecs / file, duration = 7515 msecs, parallelization 100%
PCH
Toggle Spoiler
Full PCH
ide: 46 file(s) built in (0:17.82), 387 msecs / file, duration = 19250 msecs, parallelization 100%
Partial PCH
ide: 4 file(s) built in (0:01.07), 268 msecs / file, duration = 1172 msecs, parallelization 95%
Blitz
Toggle Spoiler
Full Blitz
ide: 45 file(s) built in (0:07.44), 165 msecs / file, duration = 8312 msecs, parallelization 4%
Partial Blitz-2
ide: 44 file(s) built in (0:10.70), 243 msecs / file, duration = 11437 msecs, parallelization 96%
Partial Blitz-3
ide: 4 file(s) built in (0:06.88), 1721 msecs / file, duration = 7485 msecs, parallelization 100%
Blitz PCH
Toggle Spoiler
Full Blitz PCH
ide: 46 file(s) built in (0:07.90), 171 msecs / file, duration = 8391 msecs, parallelization 48%
Partial Blitz PCH-2
ide: 44 file(s) built in (0:04.50), 102 msecs / file, duration = 4672 msecs, parallelization 58%
Partial Blitz PCH-3
ide: 4 file(s) built in (0:01.02), 256 msecs / file, duration = 1156 msecs, parallelization 94%
TDI-mingw 4.5.1
No options (compile everything)
Toggle Spoiler
Full
ide: 45 file(s) built in (1:33.89), 2086 msecs / file, duration = 100406 msecs, parallelization 100%
Partial
ide: 4 file(s) built in (0:11.66), 2917 msecs / file, duration = 12359 msecs, parallelization 95%
PCH
Toggle Spoiler
Full PCH
ide: 46 file(s) built in (0:51.11), 1111 msecs / file, duration = 54797 msecs, parallelization 100%
Partial PCH
ide: 4 file(s) built in (0:05.16), 1291 msecs / file, duration = 5547 msecs, parallelization 98%
Blitz
Toggle Spoiler
Full Blitz
ide: 45 file(s) built in (0:28.86), 641 msecs / file, duration = 29438 msecs, parallelization 2%
Partial Blitz-2
ide: 44 file(s) built in (0:31.03), 705 msecs / file, duration = 31907 msecs, parallelization 73%
Partial Blitz-3
ide: 4 file(s) built in (0:10.46), 2616 msecs / file, duration = 11062 msecs, parallelization 94%
Blitz PCH
Toggle Spoiler
Full Blitz PCH
ide: 46 file(s) built in (0:29.18), 634 msecs / file, duration = 29672 msecs, parallelization 38%
Partial Blitz PCH-2
ide: 44 file(s) built in (0:25.95), 589 msecs / file, duration = 26407 msecs, parallelization 54%
Partial Blitz PCH-3
ide: 4 file(s) built in (0:04.82), 1205 msecs / file, duration = 5188 msecs, parallelization 100%
[Updated on: Mon, 11 March 2013 04:06] Report message to a moderator
|
|
|
|
Re: [FEATURE] PCH support [message #33378 is a reply to message #33376] |
Fri, 29 July 2011 15:29 |
|
Shire wrote on Fri, 29 July 2011 14:53 | Weird diff format? It human readable! Use "patch" tool, Luke. See attachment.
I have no access to external SVN repository here.
| I know it is human readable, I read it I'm just not used to see the "new-style context format". Also, I use 'patch' when I want to apply a patch, but I know for sure that some devs don't, since they don't have the GNU userland on windows. Most notably Mirek, who IIRC applies the patches in TortoiseSVN, which only understands unified diff format ('diff -u').
Shire wrote on Fri, 29 July 2011 14:53 | Build time reducing in 1.5-3 times per single C++ file depend on compiler.
Benchmarks performed on uppsrc/ide package in full debug.
First build was full, with all files included. For include all files in blitz batch their dates made equal.
Second build performed after touching 4 files (Assist.cpp, AutoSetup.cpp, idewin.cpp, idebar.cpp).
Third build (touched same files) executed only for Blitz.
|
Well, those numbers seem quite interesting. I must admit that they surprised me I will give it a closer look as soon as I have a little free time, hopefully over the weekend.
Honza
|
|
|
|
Goto Forum:
Current Time: Sun Dec 22 05:16:57 CET 2024
Total time taken to generate the page: 0.03563 seconds
|