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

Add benchmark for high pin_subpackage count recipe #5246

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

mbargull
Copy link
Member

Description

This is a performance regression benchmark for gh-5224.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • [ ] Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Mar 20, 2024
@mbargull mbargull force-pushed the pin_subpackage-benchmark branch from 83d87f3 to 13ce323 Compare March 20, 2024 10:29
Copy link

codspeed-hq bot commented Mar 20, 2024

CodSpeed Performance Report

Merging #5246 will not alter performance

⚠️ No base runs were found

Falling back to comparing mbargull:pin_subpackage-benchmark (60cce81) with main (3b1f4f1)

Summary

✅ 2 untouched benchmarks

🆕 1 new benchmarks

Benchmarks breakdown

Benchmark main mbargull:pin_subpackage-benchmark Change
🆕 test_pin_subpackage_benchmark N/A 116.9 s N/A

@mbargull mbargull force-pushed the pin_subpackage-benchmark branch from 74d9e5a to 3d79e09 Compare March 20, 2024 12:26
@kenodegard
Copy link
Contributor

@mbargull this looks promising! is this ready for review?

@mbargull
Copy link
Member Author

@mbargull this looks promising! is this ready for review?

In principle yes.
IDK if we want to merge this yet, though, since it takes about 15 minutes CI time even in the further cut down version.
We could postpone merging this until we flesh out PRs addressing gh-5224 and base those PRs on this one in the mean time if we don't want to run this without improvements all the time.

Comment on lines +319 to +328
for version_count, package_count in [(1, 4), (4, 3), (4, 3)]:
zipped = []
for package, versions in islice(packages, package_count):
zipped.append(package)
variant[package] = list(islice(versions, version_count))
variant["zip_keys"].append(zipped)
# for version_count, package_count in [(3, 1), (2, 4), (1, 327)]:
for version_count, package_count in [(3, 1), (2, 4), (1, 33)]:
for package, versions in islice(packages, package_count):
variant[package] = list(islice(versions, version_count))
Copy link
Member Author

Choose a reason for hiding this comment

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

To simplify things, it would probably suffice only add the single-entry keys since their number is far greater than the other entries (and zip_keys).
As is, these numbers just closely recreate those from conda-forge's cbc.yaml.
(Overall, the impact on the variant size mostly affects the .config.Config.copy impact on the overall run time, I'd assume.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I say we leave this for now, we can always simplify it later once we've achieved some speedup.

@mbargull mbargull marked this pull request as ready for review March 21, 2024 15:37
@mbargull mbargull requested a review from a team as a code owner March 21, 2024 15:37
This is a performance regression benchmark for
conda#5224

Signed-off-by: Marcel Bargull <[email protected]>
kenodegard
kenodegard previously approved these changes Mar 21, 2024
Copy link
Contributor

@kenodegard kenodegard left a comment

Choose a reason for hiding this comment

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

As long as the entire benchmark job completes under 30 min I'm ok with proceeding

I think there's value in getting to see the speed delta for this benchmark in the other PRs (we can always disable this once we've made the improvements)

Comment on lines +319 to +328
for version_count, package_count in [(1, 4), (4, 3), (4, 3)]:
zipped = []
for package, versions in islice(packages, package_count):
zipped.append(package)
variant[package] = list(islice(versions, version_count))
variant["zip_keys"].append(zipped)
# for version_count, package_count in [(3, 1), (2, 4), (1, 327)]:
for version_count, package_count in [(3, 1), (2, 4), (1, 33)]:
for package, versions in islice(packages, package_count):
variant[package] = list(islice(versions, version_count))
Copy link
Contributor

Choose a reason for hiding this comment

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

I say we leave this for now, we can always simplify it later once we've achieved some speedup.

tests/test_api_render.py Outdated Show resolved Hide resolved
@kenodegard kenodegard merged commit 127ce33 into conda:main Mar 21, 2024
28 checks passed
@mbargull
Copy link
Member Author

Thanks for the review/merge 🙇 !

@mbargull
Copy link
Member Author

Oh, one thing I kind of forgot was that by stripping the recipe down this much, I got rid of all of the selectors 🤭 .
Meaning, for the split_lines optimizations, this would, of course, only evaluate the changes for passing over all lines, but without any eval_selector(...) calls at all...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants