Skip to content

Commit 137e3f7

Browse files
committed
Improve multitask performance
1 parent 124a03b commit 137e3f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rake/task.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc:
248248
r.invoke_with_call_chain(prereq_args, invocation_chain)
249249
end
250250
end
251-
futures.each(&:value)
251+
# Iterate in reverse to improve performance related to thread waiting and switching
252+
futures.reverse_each(&:value)
252253
end
253254

254255
# Format the trace flags for display.

0 commit comments

Comments
 (0)