Tuesday, January 26, 2010

Make -J

System 1
CPU: AMD Phenom ii 940 3.6ghz
Memory: 4096 DDR2 1000mhz 5-5-5-15 @2.0v
Motherboard: ASUS M3A78-CM

Steps for proper multithreaded emulation using virtual machines. In order to utilize your CPU's cores you must enable either VT-X or AMD-V depending on your CPU's architecture. Some motherboards will disable these features by default. It's not always easy to find these options in your BIOS as they might not be labelled as VT-X [intel] or AMD-V [AMD]. For example It might come up as SVM or secure virtual machine. Once you have found these in the BIOS enable the feature on the hypervisor. My choice for hypervisor was VirtualBox. Follow these steps and compilation times will improve and you will be able to utilize your cpu's cores.

System 2
Processor: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
RAM: 4096 DDR2 [unsure of frequency / timings ]
Motherboard: Intel DQ35JOE
[ benchmarks were all done on system 2 ]

Make

real 0m55.661s

user 0m26.299s

sys 0m28.122s

Make

real 0m56.408s

user 0m26.324s

sys 0m28.234s

Make -j2

real 0m31.994s

user 0m25.047s

sys 0m24.933s

Make -j2

real 0m31.591s

user 0m24.953s

sys 0m25.034s

make -j3

real 0m25.007s

user 0m23.618s

sys 0m24.088s

Make -j3

real 0m25.661s

user 0m23.808s

sys 0m23.964s

make -j4

real 0m39.048s

user 0m58.727s

sys 0m28.605s

Make -j4

real 0m22.115s

user 0m23.160s

sys 0m23.179s

Make -j6

real 0m20.827s

user 0m23.418s

sys 0m23.376s

Make -j6

real 0m20.331s

user 0m23.284s

sys 0m23.703s

Make -j8

real 0m20.179s

user 0m23.637s

sys 0m23.953s

Make -j8

real 0m20.708s

user 0m23.706s

sys 0m23.896s

Make -j

-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If
there is more than one -j option, the last one is effective. If
the -j option is given without an argument, make will not limit
the number of jobs that can run simultaneously.

Both machines I used were QUAD cores, and the results were fairly obvious. The -j option increases the amount of jobs and it seems the compilation running just one job at a time is much slower than running multiple jobs. It's seems optimal to run between 6 and 8 jobs on the Q6600 quad core.


No comments:

Post a Comment