-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve multitask performance #273
Conversation
@hsbt is there anything more that this PR needs to be merged? |
Interesting! @hsbt anything blocking us from merging this? |
@@ -248,7 +248,7 @@ def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc: | |||
r.invoke_with_call_chain(prereq_args, invocation_chain) | |||
end | |||
end | |||
futures.each(&:value) | |||
futures.reverse_each(&:value) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
2 similar comments
@jsm Thanks! |
Thread context switches are expensive, iterating through promises in reverse minimizes them.
See my blog post about it here: https://medium.com/@sanmiguelje/optimizing-rake-multitask-fece36a16c8f