瀏覽代碼

Speed build time up by 6 using multiple jobs

Adding aggresive build mode that spawns num_core+1 jobs. This speeds up
build time by 6. On my 8 core machine I'm down from 6m:16s to 1m:34s.
Moritz Wundke 11 年之前
父節點
當前提交
12a3989cd7
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      SConstruct

+ 7 - 0
SConstruct

@@ -6,6 +6,13 @@ import os.path
 import glob
 import sys
 import methods
+import multiprocessing
+
+# Enable aggresive compile mode if building on amulti core box
+if ARGUMENTS.get('spawn_jobs', 'yes') == 'yes':
+	NUM_JOBS = multiprocessing.cpu_count()
+	if NUM_JOBS > 1:
+		SetOption('num_jobs', multiprocessing.cpu_count()+1)
 
 methods.update_version()