From 137e3f7a43f0429098b8878a00db449fa85fea97 Mon Sep 17 00:00:00 2001 From: Jon San Miguel Date: Thu, 27 Sep 2018 19:15:36 -0700 Subject: [PATCH] Improve multitask performance --- lib/rake/task.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rake/task.rb b/lib/rake/task.rb index c56118f01..7b7057ce5 100644 --- a/lib/rake/task.rb +++ b/lib/rake/task.rb @@ -248,7 +248,8 @@ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc: r.invoke_with_call_chain(prereq_args, invocation_chain) end end - futures.each(&:value) + # Iterate in reverse to improve performance related to thread waiting and switching + futures.reverse_each(&:value) end # Format the trace flags for display.