Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
precompiled prefix header
03-22-2007, 05:22 PM,
#1
precompiled prefix header
after the release has been made, would you be interested to consider using a global header file for all external includes?

i've tried it out today and here are the results:
- cuts about 500 lines of redundant code
- reduces compilation time from 22 to 18 secs and further down to 12 when precompiling the prefix header (these are for a debug build on my machine)

in case you are interested i've uploaded the patches:
new include/pch.h file:
http://pastebin.ca/407011
svn diff for include directory:
http://pastebin.ca/407015
svn diff for src directly:
http://pastebin.ca/407020

you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...
Reply
03-22-2007, 05:32 PM,
#2
 
I'm all for cutting down on redundancy. Are there any possible ill side-effects we may run into? I'm trying to imagine some but not coming up with much. I'm thinking this is probably a pretty good idea. Any thoughts, Joe (or anyone else)?
Reply
03-22-2007, 05:53 PM,
#3
 
can't think of any.
i actually expected the build time to go up when not precompiling the prefix header, but that doesn't happen, on the contrary.

also since it modifies also things in vamos it might make syncing with upstream more difficult, but it seems you aren't planning to resync with them anyway (is vamos still under development?) and we have already diverged quite much here.
Reply
03-22-2007, 06:28 PM,
#4
 
As far as I know Sam (Vamos author) hasn't done anything with it in almost two years. Last I heard from him he was very busy and didn't have much time for it anymore. I'm pretty sure we're the only relatively large project that uses it. And yes, we have made a few changes to the Vamos code by now.

Now that you mention it...I have been thinking about setting up a Vamos SVN repository and using the svn external feature to grab it when people check out VDrift. This might encourage other developers to use Vamos more which means more people contributing back to the library. Another idea which might actually be much better would be to work some of the lower-level stuff in VDrift back into Vamos (or some new library containing it and more stuff) which would ultimately be more useful than Vamos by itself. This is a big digressional tangent that has nothing to do with your quetsion...and will need some more discussion before any of that happens.

So my point is, don't worry about Vamos too much in this respect, making changes is OK. Smile
Reply
03-22-2007, 10:53 PM,
#5
 
reducing compile times sounds good to me....
Reply
03-27-2007, 06:22 PM,
#6
 
so should i just commit this to trunk?
Reply
03-27-2007, 06:25 PM,
#7
 
Sure, go ahead.
Reply
03-27-2007, 07:30 PM,
#8
 
ok commited hope everything is alright

don't forget:
>you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...
Reply
03-27-2007, 09:30 PM,
#9
 
abs1nth Wrote:ok commited hope everything is alright

don't forget:
>you'd also need to modify the scons scripts to pass "-include include/pch.h" to gcc ...

nothing compiles anymore. can we please fix it?

--alex--
Reply
03-27-2007, 10:21 PM,
#10
 
alex25 Wrote:nothing compiles anymore. can we please fix it?

i'm sure someone will fix the SConstruct files soon enough
Reply
03-28-2007, 12:14 AM,
#11
 
*looks around*

where's thelusiv? :-)

if it doesn't get fixed by tomorrow I'll give it a shot, but we probably don't want that....
Reply
03-28-2007, 12:18 AM,
#12
 
abs1nth Wrote:i'm sure someone will fix the SConstruct files soon enough

huh?! shouldn't whoever broke it fix it? just wondering...

--alex--
Reply
03-28-2007, 12:26 AM,
#13
 
guess fixing it would need something like inserting

local_env.Append(CCFLAGS = '-include ../include/pch.h')

at line 72 in src/SConscript

but thats just a wild guess ;-)
Reply
03-28-2007, 01:54 AM,
#14
 
That didn't work, and I've tried quite a few other methods like adding it to the SConstruct but for some reason, no matter what it always says it can't find the file. However if I just add a
Code:
#include "pch.h"
to the files that complain about it, it's fine. abs1nth, is this going to mess up your build system somehow?
Reply
03-28-2007, 09:08 AM,
#15
 
thelusiv Wrote:That didn't work, and I've tried quite a few other methods like adding it to the SConstruct but for some reason, no matter what it always says it can't find the file.

what about:
local_env.Append(CCFLAGS = '-include #/include/pch.h')

thelusiv Wrote:to the files that complain about it, it's fine. abs1nth, is this going to mess up your build system somehow?

should be fine ;-)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)