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

get_work optimizations #1046

Merged
merged 3 commits into from
Jul 8, 2015
Merged

get_work optimizations #1046

merged 3 commits into from
Jul 8, 2015

Conversation

daveFNbuck
Copy link
Contributor

This combines three optimizations for get_work. The first one removes the number of dependencies computation from ranking, as I noticed that this was a large component of get_work time and I no longer think it makes much of a difference overall. Next, I limit upstream_status computation to not look past DONE tasks, giving a decent performance boost when many tasks are DONE. Finally, I remove unnecessary computation in get_work that occurs after finding a best_task.

Removes the computation of number of dependents from the rank function, as it's
one of the more expensive parts of get_work and probably doesn't make much of a
difference anyway.
It doesn't really make sense to keep traversing past DONE tasks to find upstream
status, so this change avoids looking at dependents of DONE tasks when computing
upstream dependencies. This can save a lot of time in get_work if there are many
DONE tasks with lots of dependencies.
After finding best_task, get_work can return immediately, except that it needs
to compute the number of PENDING tasks. However, it still does a lot of other
unnecessary work. This speeds up get_work by checking earlier whether a
best_task has been found yet and skipping the other work if so.
@Tarrasch
Copy link
Contributor

Tarrasch commented Jul 8, 2015

LGTM. Very nice that you split up the commits. I really want to merge. Anyone else wants to review first?

@erikbern
Copy link
Contributor

erikbern commented Jul 8, 2015

LGTM

Tarrasch added a commit that referenced this pull request Jul 8, 2015
@Tarrasch Tarrasch merged commit 68a4154 into spotify:master Jul 8, 2015
@Tarrasch
Copy link
Contributor

Tarrasch commented Jul 8, 2015

Thanks @daveFNbuck! :)

@daveFNbuck daveFNbuck deleted the faster_get_work branch July 8, 2015 13:11
@daveFNbuck
Copy link
Contributor Author

No problem. I hope this works well for you guys too.

On Wed, Jul 8, 2015 at 5:13 AM, Arash Rouhani notifications@github.com
wrote:

Thanks @daveFNbuck https://github.com/daveFNbuck! :)


Reply to this email directly or view it on GitHub
#1046 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants