Title: Combine dataclass exec calls · Issue #109870 · python/cpython · GitHub
Open Graph Title: Combine dataclass exec calls · Issue #109870 · python/cpython
X Title: Combine dataclass exec calls · Issue #109870 · python/cpython
Description: Feature or enhancement Proposal: As mentioned here, dataclass definition can possibly be sped up by combining the multiple exec calls into one. I have two versions, and I found that this results in either a 1.1-1.22 1.26, or 1.37 speedup...
Open Graph Description: Feature or enhancement Proposal: As mentioned here, dataclass definition can possibly be sped up by combining the multiple exec calls into one. I have two versions, and I found that this results in...
X Description: Feature or enhancement Proposal: As mentioned here, dataclass definition can possibly be sped up by combining the multiple exec calls into one. I have two versions, and I found that this results in...
Opengraph URL: https://github.com/python/cpython/issues/109870
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Combine dataclass exec calls","articleBody":"# Feature or enhancement\r\n\r\n### Proposal:\r\n\r\n[As mentioned here](https://discuss.python.org/t/improving-dataclasses-startup-performance/15442/18), dataclass definition can possibly be sped up by combining the multiple `exec` calls into one.\r\n\r\nI have two versions, and I found that this results in either a 1.1-1.22 ~~1.26, or 1.37 speedup versus main~~ (old time / new time)\r\n\r\n~~[version 1](https://github.com/python/cpython/commit/e7c42bd21cf0f12ebfd88744dfde70b78877b1ac) combines the exec calls by passing a list of name/txt/locals from each function definition.\r\n[version 2](https://github.com/python/cpython/commit/10a72b7621b4a6580db1b29d15f259109a701c08) simplifies the final exec call to avoid `__create_fn__`, but I'm not experienced to know if that is safe.~~ (see below for open pr)\r\n\r\n@ericvsmith Let me know if this is a suitable change, and if so, which version we should open a pr based on.\r\n\r\nThank you!\r\n\r\n### Has this already been discussed elsewhere?\r\n\r\nNo response given\r\n\r\n### Links to previous discussion of this feature:\r\n\r\nhttps://discuss.python.org/t/improving-dataclasses-startup-performance/15442/18\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-110186\r\n* gh-110851\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/ssweber","@type":"Person","name":"ssweber"},"datePublished":"2023-09-25T21:04:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/109870/cpython/issues/109870"}
| 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:86051e42-376c-b7a1-f39e-8cecc1efbcc6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84A2:23348E:1F52E45:2975427:696B06CA |
| html-safe-nonce | 8584e9f40738212caf53518af08aa7e4af78eab3d1f4ee52484c4c0e905ce6ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEEyOjIzMzQ4RToxRjUyRTQ1OjI5NzU0Mjc6Njk2QjA2Q0EiLCJ2aXNpdG9yX2lkIjoiMTEwNjI4NjQ4MzkyNTI1NTE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ea734b2f28d3202d9d544ade8b7d9d841bdc4fa7e8b96226d7841aee63c93d54 |
| hovercard-subject-tag | issue:1912280786 |
| 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/cpython/109870/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2781ba77f8d714400e13b37d1b4bcbcc1c7edf01cf9520e9863973824dd823fb/python/cpython/issues/109870 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2781ba77f8d714400e13b37d1b4bcbcc1c7edf01cf9520e9863973824dd823fb/python/cpython/issues/109870 |
| og:image:alt | Feature or enhancement Proposal: As mentioned here, dataclass definition can possibly be sped up by combining the multiple exec calls into one. I have two versions, and I found that this results in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ssweber |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width