aboutsummaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2016-02-16 13:49:49 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2016-02-16 13:56:27 +0900
commit1a444a870705b263cb4ee080ddfafde42c0f5563 (patch)
treea59ca6fda7318cf4f3a7d843e547df95b6063cf4 /main.cc
parent7373ee2bb78ac887d3684ab2d243c3226573b5ee (diff)
[C++] Set CPU affinity
Sticking to a single processor improves the performance while we are running only a single thread.
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.cc b/main.cc
index 0c0dfd0..c732dda 100644
--- a/main.cc
+++ b/main.cc
@@ -21,6 +21,7 @@
#include <time.h>
#include <unistd.h>
+#include "affinity.h"
#include "dep.h"
#include "eval.h"
#include "exec.h"
@@ -133,6 +134,8 @@ static int Run(const vector<Symbol>& targets,
ClearGlobCache();
}
+ SetAffinityForSingleThread();
+
MakefileCacheManager* cache_mgr = NewMakefileCacheManager();
Vars* vars = new Vars();