From 2b1ce98364d13e5069d4910cdaf0b3f6cfac2133 Mon Sep 17 00:00:00 2001 From: Rick Richardson Date: Thu, 19 Oct 2017 12:23:26 -0700 Subject: [PATCH] Moved compile_object outside of mutex lock to improve parallelism --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index efd42a8..6161e96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -823,7 +823,8 @@ impl Build { objs.par_iter().with_max_len(1).for_each( |&(ref src, ref dst)| { - results.lock().unwrap().push(self.compile_object(src, dst)) + let res = self.compile_object(src, dst); + results.lock().unwrap().push(res) }, );