Skip to content

perf(optimize): resolve each dependent's deadline only once - #1056

Open
marco-c wants to merge 1 commit into
taskcluster:mainfrom
marco-c:resolve_deadline_once
Open

marco-c wants to merge 1 commit into
taskcluster:mainfrom
marco-c:resolve_deadline_once

Conversation

@marco-c

@marco-c marco-c commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

To decide whether a task can be replaced, replace_tasks computes the latest deadline of its dependents. It resolved the deadline of every dependent for every task, although tasks such as docker images or toolchains share thousands of dependents. Now each task's deadline is resolved at most once, relative to a single now.

Similarly, IndexSearch parsed the same deadline (and the expiration of tasks used as replacement for multiple tasks) over and over, so parsed timestamps are now cached.

On a synthetic graph of 20,210 tasks where the 210 build and docker tasks are replaced, replace_tasks takes 0.17s instead of 0.24s.

To decide whether a task can be replaced, replace_tasks computes the
latest deadline of its dependents. It resolved the deadline of every
dependent for every task, although tasks such as docker images or
toolchains share thousands of dependents. Now each task's deadline is
resolved at most once, relative to a single `now`.

Similarly, IndexSearch parsed the same deadline (and the expiration of
tasks used as replacement for multiple tasks) over and over, so parsed
timestamps are now cached.

On a synthetic graph of 20,210 tasks where the 210 build and docker
tasks are replaced, replace_tasks takes 0.17s instead of 0.24s.
@marco-c
marco-c requested a review from a team as a code owner September 29, 2026 13:49
@marco-c
marco-c requested a review from hneiva September 29, 2026 13:49

This branch has not been deployed

No deployments
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.

1 participant