Repository navigation
perf: budgets for import, first-call and solver work (#347) - #351
Merged
Merged
Conversation
…nts fail and timings are reported (#347)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #351 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 150 151 +1
Lines 17596 17754 +158
Branches 3561 3581 +20
==========================================
+ Hits 17596 17754 +158
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
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.
Closes #347
The 0.7.1 speedups (#335, #337, #339, #342) had no guard against regressing.
benchmarks/performance.py(asv) already measures, but only on demand and with no thresholds.Added
python -m tools.performance_budgets check|measure|write-budgets(standard library only).benchmarks/budgets.jsonwith the agreed budgets and the machine it was recorded on.tests/test_performance_budgets.pyin the normal suite: modules loaded byimport flahax(exactly 0), by the firstrecommend(17), equilibrium solves and Newton iterations for the four reference fixtures (iterations: measured +10 percent, at least 2), and the pH-grid warm start must need at most 0.6 of the cold-start iterations (measured 0.47).--strict-timing, since machine noise is large (first-call relative median ranged 1.8 to 9.7 over 12 runs).PYTHONDONTWRITEBYTECODEis removed in the children, so imports are not recompiled.checkand uploads the JSON. CHANGELOG entry; roadmap H6 marked done.Measured (Windows, Python 3.13, compiled): import 0.6 ms, first
recommend46 to 54 ms, second 3.8 ms. Counts were identical on Python 3.11, 3.12, 3.13 and 3.14.Verified locally
__init__fails the module budget.tools/performance_budgets.pyhas 100 percent line and branch coverage (the coverage gate requires it for tools).Not run: the full pre-push suite (hours); CI runs the full gate. Linux and macOS counts are not measured yet; if a platform shifts an iteration count by more than the headroom, CI will show it.