This is my first attempt at working on mongodb patches.
After kernel code modification "time scons --mute=MUTE --dd mongod" with cacheDir() enabled takes ~16 mins on Ubuntu. Is there a way to compile mongod and 'all' quicker after modifying the kernal code (in my_repo/src/mongo/)?
Details:
It is currently very time consuming to implement fixes to kernel code for mongodb jira patches when each compilation takes this long. An initial compilation of just the source directory containing the modified .h and .cpp files is done which is fairly quick but I need to eventually compile mongod and 'all' to run some minor tests as I incrementally develop. I went through the mongodb docs. and other sources too. Any help is much appreciated. Thanks!
Some general tips:
Build a more specific target than all
. If you are only changing mongod, for example, then: scons mongod
.
If you have multiple processors in your system, run scons with -j numprocs, eg: scons -j4
for a quad core system. This will run more jobs in parallel (the default is 1).
Use --d
(debug build); this builds with optimizations off.
Don't use --dd
(debug build with _DEBUG and extra asserts) unless you really need this and understand the additional overhead.
If you have multiple computers available, you could also set up distcc
for distributed builds across multiple machines.
So putting the above options together, a better command line (assuming 4 cores available) should be: scons -j4 --d mongod
.
You haven't mentioned hardware specs, but SSDs also make things Go Faster.
Just did some a quick check of timing on a Macbook Air (2.0ghz core i7, post-June 2012 model) with the above options. Full build was 8 minutes 15s; incremental build after making small change to cpp file in src/mongo/db/ took ~30s.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With