-
Notifications
You must be signed in to change notification settings - Fork 12
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
Codspeed - performance benchmarks #471
Open
tony
wants to merge
17
commits into
master
Choose a base branch
from
pytest-codspeed
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #471 +/- ##
==========================================
+ Coverage 63.85% 64.09% +0.24%
==========================================
Files 40 40
Lines 3591 3724 +133
Branches 774 790 +16
==========================================
+ Hits 2293 2387 +94
- Misses 772 800 +28
- Partials 526 537 +11 ☔ View full report in Codecov by Sentry. |
tony
force-pushed
the
pytest-codspeed
branch
3 times, most recently
from
September 22, 2024 11:24
61f4aa8
to
5ec5337
Compare
tony
force-pushed
the
pytest-codspeed
branch
5 times, most recently
from
October 11, 2024 19:00
9265999
to
99fa170
Compare
tony
force-pushed
the
pytest-codspeed
branch
2 times, most recently
from
October 12, 2024 14:53
f649e7f
to
d0e1548
Compare
tony
force-pushed
the
master
branch
2 times, most recently
from
October 12, 2024 15:51
9b797e7
to
bc6e897
Compare
`workflow_dispatch` allows CodSpeed to trigger backtest performance analysis in order to generate initial data. See also: https://docs.codspeed.io/ci/github-actions#2-create-the-benchmarks-workflow
tests/sync/test_git.py:11: error: Skipping analyzing "pytest_codspeed.plugin": module is installed, but missing library stubs or py.typed marker [import-untyped] tests/sync/test_git.py:11: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
tony
added a commit
that referenced
this pull request
Oct 12, 2024
# Problem Git, Mercurial, and Subversion repositories are unnecessarily reinitialized for each test. - We're not utilizing session-based scoping. - A single initial repo could be created, then copied to [`tmp_path`](https://docs.pytest.org/en/8.3.x/how-to/tmp_path.html#the-tmp-path-fixture) using [`shutil.copytree`](https://docs.python.org/3/library/shutil.html#shutil.copytree) ([source](https://github.com/python/cpython/blob/v3.13.0/Lib/shutil.py#L550-L605)). Issue #471 highlighted this inefficiency, where benchmarks showed tens of thousands of redundant functional calls. # Improvement ``` ❯ hyperfine -L branch master,pytest-plugin-fixture-caching 'git checkout {branch} && py.test' Benchmark 1: git checkout master && py.test Time (mean ± σ): 32.062 s ± 0.869 s [User: 41.391 s, System: 9.931 s] Range (min … max): 30.878 s … 33.583 s 10 runs Benchmark 2: git checkout pytest-plugin-fixture-caching && py.test Time (mean ± σ): 14.659 s ± 0.495 s [User: 16.351 s, System: 4.433 s] Range (min … max): 13.990 s … 15.423 s 10 runs Summary git checkout pytest-plugin-fixture-caching && py.test ran 2.19 ± 0.09 times faster than git checkout master && py.test ``` # Changes ## Pytest fixtures overhaul 1. Create a base VCS repo. 2. For subsequent tests, copy and modify from this template.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
benchmark
(BenchmarkFixture
)Problem
It's difficult to catch performance degradation or improvements over time, in a PR, etc.
Changes
Add performance benchmarks
TBD
Setup codpseed
Configure on website, set secret, etc.
py(deps[test]) Add
pytest-codspeed
See also: