From dfc28f4813dadac5efa13f581f62f0fa0e104eae Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 16 Apr 2018 15:11:20 +0800 Subject: [PATCH] Improve CPU core detection in Vagrantfile Use single `grep` with `^` condition instead of `grep` + `cat` + `wc` --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index b28495648..46d6882e5 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -156,7 +156,7 @@ def suggestedCPUCores() when /darwin/ Integer(`sysctl -n hw.ncpu`) / 2 when /linux/ - Integer(`cat /proc/cpuinfo | grep processor | wc -l`) / 2 + Integer(`grep -c ^processor /proc/cpuinfo`) / 2 else 2 end