Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core · GitHub
Open Graph Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core
X Title: chore: move retry async check to wrap time by daniel-sanche · Pull Request #649 · googleapis/python-api-core
Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a useful check, but the implementation adds significant overhead, almost doubling the processing time in a quick benchmark I ran (0.94s -> 1.84s) This PR moves the check to happen once at wrap time, instead of on each retry attempt. This should give us most of the benefits, without the ongoing performance hit Note that this implementaiton isn't quite as thouogh as the previous one: iscouroutinefunction won't catch standard functions that happen to return an awaitable, like the previous implementation would. But I think this trade-off is worth it for the performance gain Fixes #542
Open Graph Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us...
X Description: We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us...
Opengraph URL: https://github.com/googleapis/python-api-core/pull/649
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a36f051a-7abb-df9a-f1e9-dbcde7a051ce |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BA78:20C9D0:86782C:B990EE:6A4DD841 |
| html-safe-nonce | 223949af71f69bfef26386cde3f4176ea9d017e3aade13b91e787e8db72b68d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTc4OjIwQzlEMDo4Njc4MkM6Qjk5MEVFOjZBNEREODQxIiwidmlzaXRvcl9pZCI6IjEzNjAzMTM3NjA0NDMzOTAwMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e66110b515fe7ffa304a5fc1028d35a5679c106d412257c91dac18acb7422d4a |
| hovercard-subject-tag | pull_request:1854014432 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/googleapis/python-api-core/pull/649/files |
| twitter:image | https://avatars.githubusercontent.com/u/3914119?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3914119?s=400&v=4 |
| og:image:alt | We recently made a change to the synchronous version of the Retry class to inspect each output, and raise a warning if the sync Retry class was accidentally used with an async function This is a us... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992456 |
| octolytics-dimension-repository_nwo | googleapis/python-api-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992456 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-api-core |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width