Title: Reduce the overall runtime of the benchmarks without increasing variability · Issue #372 · python/pyperformance · GitHub
Open Graph Title: Reduce the overall runtime of the benchmarks without increasing variability · Issue #372 · python/pyperformance
X Title: Reduce the overall runtime of the benchmarks without increasing variability · Issue #372 · python/pyperformance
Description: I did a bit of analysis based on the Faster CPython team's current benchmarking results. From this it's clear that for many benchmarks we run more times than we need to in order to get a consistent result. Reducing the number of processe...
Open Graph Description: I did a bit of analysis based on the Faster CPython team's current benchmarking results. From this it's clear that for many benchmarks we run more times than we need to in order to get a consistent...
X Description: I did a bit of analysis based on the Faster CPython team's current benchmarking results. From this it's clear that for many benchmarks we run more times than we need to in order to get a co...
Opengraph URL: https://github.com/python/pyperformance/issues/372
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reduce the overall runtime of the benchmarks without increasing variability","articleBody":"I did a bit of analysis based on the Faster CPython team's [current benchmarking results](https://github.com/faster-cpython/bench_runner/issues/318). From this it's clear that for many benchmarks we run more times than we need to in order to get a consistent result. Reducing the number of processes that are spawned for some of them would yield back a large fraction of the overall runtime. In most cases this runtime is multiplied by 2 because you need to benchmark both a head and a base commit.\r\n\r\nThe easy part is to just add `processes=` to the `Runner` constructor to individual benchmarks based on this analysis. But we also want to continuously confirm that that analysis remains correct. Obviously if a benchmark (or its dependency) changes, that invalidates all of that analysis, but that happens fairly infrequently and we try to revalidate the benchmarks when we do that. It's more likely that a change in the Python runtime might make a benchmark more or less stable, so we need to automatically detect for that.\r\n\r\nTherefore, I propose:\r\n\r\n- Adding a new message for when it runs too many times:\r\n\r\n```\r\nBenchmark ran more times than was necessary to obtain a consistent result. Consider passing processes=N to the Runner constructor.\r\n```\r\n\r\n- Adding a message for when it runs too few times. This could probably piggy back on the existing message that [warns about a high standard deviation](https://github.com/psf/pyperf/blob/main/pyperf/_cli.py#L418), just with a slightly different calculation for when it would be displayed. We can't really determine how many additional loops are needed, so the existing advice there of \"Try to rerun the benchmark with more runs, values and/or loops\" wouldn't change.\r\n\r\nDoes this make sense to others, particularly @vstinner who worked on the dynamic loop determination stuff in the past (which is related, but not the same -- everything here is related to the outermost process-spawning loop).","author":{"url":"https://github.com/mdboom","@type":"Person","name":"mdboom"},"datePublished":"2024-12-12T15:49:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/372/pyperformance/issues/372"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:86c8413b-d628-3a3c-5616-df1625367f38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE0E:254FE5:3D62E5:55DCEA:696A0AA6 |
| html-safe-nonce | 2f1ef7ba95433fcc2e3369c468a696623381bccc773a12de964cd3d8d9c5a989 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTBFOjI1NEZFNTozRDYyRTU6NTVEQ0VBOjY5NkEwQUE2IiwidmlzaXRvcl9pZCI6IjY2NjY0NDAwMjcxOTUxODE3MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0c31a061a10b0d5c747935d139d03c964cd3bde7fd94f953c37f241beb3f48be |
| hovercard-subject-tag | issue:2736276116 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/pyperformance/372/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aeda8e28598e7dabaf8dc5a6c3e341f9dedeb72e3406659ebcadbba7769a5aff/python/pyperformance/issues/372 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aeda8e28598e7dabaf8dc5a6c3e341f9dedeb72e3406659ebcadbba7769a5aff/python/pyperformance/issues/372 |
| og:image:alt | I did a bit of analysis based on the Faster CPython team's current benchmarking results. From this it's clear that for many benchmarks we run more times than we need to in order to get a consistent... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mdboom |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/pyperformance git https://github.com/python/pyperformance.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 65949828 |
| octolytics-dimension-repository_nwo | python/pyperformance |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 65949828 |
| octolytics-dimension-repository_network_root_nwo | python/pyperformance |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width