Skip to content

Conversation

@MichaelYochpaz
Copy link

@MichaelYochpaz MichaelYochpaz commented Jan 7, 2026

Add performance benchmarking infrastructure for Fromager.
See the newly created README for detailed information.

A continuation of #901
Closes #734

@mergify mergify bot added the ci label Jan 7, 2026
@mergify mergify bot mentioned this pull request Jan 7, 2026
@MichaelYochpaz MichaelYochpaz force-pushed the add-benchmarks-framework branch 7 times, most recently from 9376524 to 2d7bb32 Compare January 14, 2026 18:05
@MichaelYochpaz MichaelYochpaz force-pushed the add-benchmarks-framework branch 8 times, most recently from 5481b9e to 2bfd5fb Compare January 26, 2026 09:33
@MichaelYochpaz
Copy link
Author

Hey @python-wheel-build/fromager-maintainers, PR is (finally) ready for review :)
A brief overview:

Stack

  • pytest-benchmark for writing and running benchmarks locally
  • CodSpeed for performance tracking and visualization over time

Workflows (GitHub Actions)

Initial Benchmarks

  1. test_constraint_add_and_check - Constraint parsing and version satisfaction (a hot path in resolution)
  2. test_resolve_version_from_local_pypi - Full resolution workflow against a local PyPI server

Integration benchmarks use a local PyPI fixture: packages are pre-downloaded during setup, then served locally to measure resolution performance without network variability.

Note: This PR focuses on the framework, not comprehensive coverage. We'll add more benchmarks in the future, in separate PRs where it's easy to test and review each new benchmark individually.

For a more detailed overview, see benchmarks/README.md. It should cover everything, if it does not - let me know and I'll update it.

I've tested CodSpeed on my fork to some degree, but walltime (which has a limited amount of free quota for open-source projects) is only available for GitHub projects hosted on orgs, so I couldn't test it.

CodSpeed also released a new feature to benchmark and track memory usage last week, which isn't included in this PR, but we can add in the future with benchmarks that are more focused on testing memory usage.

@MichaelYochpaz MichaelYochpaz marked this pull request as ready for review January 26, 2026 13:02
@MichaelYochpaz MichaelYochpaz requested a review from a team as a code owner January 26, 2026 13:02
Copy link
Collaborator

@tiran tiran left a comment

Choose a reason for hiding this comment

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

A few comments.

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use 3.12 instead of 3.11.

3.12 is the primary version for deployments. 3.11 is on legacy support.

Downloads the package to a temp directory, then uses the server's
add_package() method to place it in the correct PEP 503 structure.
"""
from packaging.requirements import Requirement
Copy link
Collaborator

Choose a reason for hiding this comment

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

No local imports, please

Comment on lines 64 to 72
# Create required directories
patches_dir = tmp_path / "patches"
patches_dir.mkdir(exist_ok=True)
sdists_repo = tmp_path / "sdists-repo"
sdists_repo.mkdir(exist_ok=True)
wheels_repo = tmp_path / "wheels-repo"
wheels_repo.mkdir(exist_ok=True)
work_dir = tmp_path / "work-dir"
work_dir.mkdir(exist_ok=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

WorkContext.setup creates the directories for you. You don't have to create them manually.

@MichaelYochpaz MichaelYochpaz changed the title feat(build): Add benchmarks framework (WIP) feat(build): Add benchmarks framework Jan 26, 2026
Add performance benchmarking infrastructure for fromager including GitHub Actions workflows for nightly and on-demand runs.

Signed-off-by: Michael Yochpaz <myochpaz@redhat.com>
@MichaelYochpaz MichaelYochpaz force-pushed the add-benchmarks-framework branch from 2bfd5fb to c3266c2 Compare January 26, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add benchmark scripts to easily track and test performence following changes

2 participants