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

Avoid computing expensive default values when the value is overridden… #624

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

glandium
Copy link
Contributor

@glandium glandium commented Jan 9, 2025

… anyways

The most expensive call at the moment is repo.get_changed_files, which does down the drain if:

  • another default_fn overrides the value
  • an explicit override is given when creating the Parameters

With this change, the default function can return a function as a value, which is not evaluated unless necessary.

Fixes #616

@glandium glandium marked this pull request as draft January 9, 2025 07:05
@glandium glandium marked this pull request as ready for review January 9, 2025 07:24
@jcristau jcristau requested a review from ahal January 9, 2025 09:35
… anyways

The most expensive call at the moment is repo.get_changed_files, which
does down the drain if:
- another default_fn overrides the value
- an explicit override is given when creating the `Parameters`

With this change, the default function can return a function as a value,
which is not evaluated unless necessary.

Fixes taskcluster#616
@ahal ahal merged commit 588dc4f into taskcluster:main Jan 9, 2025
13 checks passed
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.

Filling default Parameters should avoid expensive operations
3 participants