[sldev] Re: shared objects output during standalone build
Paul TBBle Hampson
Paul.Hampson at Pobox.com
Wed Jul 18 05:07:56 PDT 2007
On Tue, Jul 17, 2007 at 09:20:44AM -0400, Dana Fagerstrom wrote:
> One thing many people don't realize is that scons supports the -j
> option just like make/dmake. That option instructs scons to perform
> multiple compiles. On a "fast" system a "-j 2" or even "-j 4" will
> greatly decrease build time.
> On my Ultra 40 (2 AMD dual core CPUs) I run with "-j 8" and a complete
> build plus packaging is completed in less than an hour.
Indeed, the usual recommendation is -j 2xCPUs (I guess CPU cores, these
days) I believe on the assumption that the build will be IO-bound, hence
allowing one process to run the compiler while the other is waiting on
the disk.
If your build is RAM-bound, then -j is disasterous, as when the
scheduler decides to switch builds (ie due to disk IO waiting) you then
have the disk get hammered with swapping, also preventing any useful
work getting done in that spare CPU time, so making it worse.
If you're RAM-bound, the usual way to improve things is to split your
build up into smaller libraries, or move stuff off into shared objects
where the linker doesn't need the whole object in RAM to get to and use
the symbol table.
Another option is to refactor your headers so that most of the
compilations #include less stuff. I doubt that precompiled headers will
actually help with RAM usage during the compilation itself, (since once
they're compiled, they're compiled anyway) but if your preprocessor is
getting RAM-bound, pre-compiled headers will at least reduce the
occurance of that step.
I note that ccache is setup in SConstruct, but I presume that's only for
repeat-builds and server builds, since I don't see where the slviewer
build process would recompile the same object... Anyone care to
enlighten me? If I was going to go to the effort, I've got an old G3 box
here I could run up with distcc, but I've not any other use for it now,
so I don't yet feel any kind of need to do so.
--
-----------------------------------------------------------
Paul "TBBle" Hampson, B.Sc, LPI, MCSE
On-hiatus Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.com
Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
-- Kristian Wilson, Nintendo, Inc, 1989
License: http://creativecommons.org/licenses/by/2.1/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070718/61b83d32/attachment.pgp
More information about the SLDev
mailing list