Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Shire is currently offline  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.
index.php?t=getfile&id=4322&private=0

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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1758
Registered: August 2008
Location: Czech Republic
Senior Contributor

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 Wink
Re: [FEATURE] PCH support [message #33376 is a reply to message #33375] Fri, 29 July 2011 14:53 Go to previous messageGo to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
Weird diff format? It human readable! Use "patch" tool, Luke. Wink 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

PCH
Toggle Spoiler

Blitz
Toggle Spoiler

Blitz PCH
Toggle Spoiler

TDI-mingw 4.5.1
No options (compile everything)
Toggle Spoiler

PCH
Toggle Spoiler

Blitz
Toggle Spoiler

Blitz PCH
Toggle Spoiler

[Updated on: Mon, 11 March 2013 04:06]

Report message to a moderator

Re: [FEATURE] PCH support [message #33377 is a reply to message #33375] Fri, 29 July 2011 15:19 Go to previous messageGo to next message
Shire is currently offline  Shire
Messages: 41
Registered: September 2006
Location: Russia, Yamal peninsula
Member
Quote:

I believe that with BLITZ minimizing the count of header inclusions, the difference should be very small

Blitz reduces build time by pipelining all .cpp files in one, invoking compiler one time.
This is very good for library packages without changes.

But when you develop and change some few files in some few packages, blitz often make full rebuild of these packages to exclude new changed files from its batch and build all changed files independently. This takes too many time for partial build and can be accelerated by using precompiled header (and, in some cases, turn off blitz).

PCH can be useful on currently changing packages - main and dependent developing packages.
Re: [FEATURE] PCH support [message #33378 is a reply to message #33376] Fri, 29 July 2011 15:29 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1758
Registered: August 2008
Location: Czech Republic
Senior Contributor

Shire wrote on Fri, 29 July 2011 14:53

Weird diff format? It human readable! Use "patch" tool, Luke. Wink See attachment.
I have no access to external SVN repository here.
I know it is human readable, I read it Wink 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 Smile I will give it a closer look as soon as I have a little free time, hopefully over the weekend.

Honza
Re: [FEATURE] PCH support [message #40395 is a reply to message #33373] Mon, 29 July 2013 21:20 Go to previous message
Alboni is currently offline  Alboni
Messages: 182
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
TortoiseSVN is very good for seeing what has changed.
Previous Topic: [BUG] MscBuilder crashes the IDE when building all shared.
Next Topic: [Solved] Default compiler flags
Goto Forum:
  


Current Time: Thu Nov 21 17:36:41 CET 2019

Total time taken to generate the page: 0.00858 seconds