Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve multitask performance #273

Merged
merged 1 commit into from Nov 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rake/task.rb
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsm Can you add comment for performace reason about reverse_each ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsbt Updated, let me know if you think I need to add more detail.

end

# Format the trace flags for display.
Expand Down