-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix test_resolve_gitapi_subapps benchmark #9939
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #9939 +/- ##
==========================================
+ Coverage 98.70% 98.72% +0.02%
==========================================
Files 121 121
Lines 36621 36682 +61
Branches 4376 4378 +2
==========================================
+ Hits 36146 36214 +68
+ Misses 319 315 -4
+ Partials 156 153 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #9939 will degrade performances by 97.31%Comparing Summary
Benchmarks breakdown
|
I think the speed decrease is acceptable. |
I'd probably write it like this to avoid diff --git a/tests/test_benchmarks_web_urldispatcher.py b/tests/test_benchmarks_web_urldispatcher.py
index bb6cf3aa3..ef1f2c4e8 100644
--- a/tests/test_benchmarks_web_urldispatcher.py
+++ b/tests/test_benchmarks_web_urldispatcher.py
@@ -53,11 +53,17 @@ def test_resolve_root_route(
router = app.router
request = _mock_request(method="GET", path="/")
- async def run_url_dispatcher_benchmark() -> None:
+ async def run_url_dispatcher_assertions() -> None:
for _ in range(resolve_count):
ret = await router.resolve(request)
assert ret.get_info()["path"] == "/", ret.get_info()
+ loop.run_until_complete(run_url_dispatcher_assertions())
+
+ async def run_url_dispatcher_benchmark() -> None:
+ for _ in range(resolve_count):
+ await router.resolve(request)
+
@benchmark
def _run() -> None:
loop.run_until_complete(run_url_dispatcher_benchmark()) Sorry, no inline suggestion as I'm in flight and WiFi is like a 9600 baud modem |
Hopefully bdraco's suggestion resolves the issue. Otherwise, the drop in test_resolve_gitapi_subapps[pyloop] looks too big. If 97% of the time is spent on the new asserts, we'd be unable to detect any improvements to the benchmark. |
No, for GitHub subapps I'fixed the benchmark. |
@bdraco I've got your idea. |
Now the only |
@bdraco thanks for the fast review. |
Not so much at the end of the year as its always travel heavy for me and I'm flipping time zones every few days. |
Backport to 3.10: 💚 backport PR created✅ Backport PR branch: Backported as #9948 🤖 @patchback |
Also add checks that url dispatcher benchmarks find expected routes (cherry picked from commit 509fddf)
Backport to 3.11: 💚 backport PR created✅ Backport PR branch: Backported as #9949 🤖 @patchback |
Also add checks that url dispatcher benchmarks find expected routes (cherry picked from commit 509fddf)
Backport to 3.12: 💚 backport PR created✅ Backport PR branch: Backported as #9950 🤖 @patchback |
Also add checks that url dispatcher benchmarks find expected routes (cherry picked from commit 509fddf)
…nchmark (#9949) Co-authored-by: Andrew Svetlov <[email protected]>
…nchmark (#9950) Co-authored-by: Andrew Svetlov <[email protected]>
…nchmark (#9948) **This is a backport of PR #9939 as merged into master (509fddf).** Also add checks that url dispatcher benchmarks find expected routes Co-authored-by: Andrew Svetlov <[email protected]>
Also add checks that url dispatcher benchmarks find expected routes