Title: [3.14] gh-139103: fix free-threading `dataclass.__init__` perf issue (gh-141596) by colesbury · Pull Request #141750 · python/cpython · GitHub
Open Graph Title: [3.14] gh-139103: fix free-threading `dataclass.__init__` perf issue (gh-141596) by colesbury · Pull Request #141750 · python/cpython
X Title: [3.14] gh-139103: fix free-threading `dataclass.__init__` perf issue (gh-141596) by colesbury · Pull Request #141750 · python/cpython
Description: The dataclasses __init__ function is generated dynamically by a call to exec() and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances. (cherry picked from commit ce79154) Co-authored-by: Edward Xu xuxiangad@gmail.com Issue: gh-139103
Open Graph Description: The dataclasses __init__ function is generated dynamically by a call to exec() and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assi...
X Description: The dataclasses __init__ function is generated dynamically by a call to exec() and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when ...
Opengraph URL: https://github.com/python/cpython/pull/141750
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9a9fd3ab-b14f-8f6d-5f73-abf21327b791 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E274:2BA6B2:362CC39:4D28CD6:6A56ADAE |
| html-safe-nonce | bc80fe0541b6e0c7d8ae2fb42ea8dc84ea09a8a3dc9a5b9065f10ec1848d6c10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjc0OjJCQTZCMjozNjJDQzM5OjREMjhDRDY6NkE1NkFEQUUiLCJ2aXNpdG9yX2lkIjoiODg3ODk1MjM3NDg4MDA4NzQ3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e350b4de76706534123e62cc50cdd1fc6acb5254131f51ac291c0759f2dcf57b |
| hovercard-subject-tag | pull_request:3026070353 |
| 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/python/cpython/pull/141750/files |
| twitter:image | https://avatars.githubusercontent.com/u/655866?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/655866?s=400&v=4 |
| og:image:alt | The dataclasses __init__ function is generated dynamically by a call to exec() and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | df99b7164e1d961b639cf5d3cbd6b5ba673edc67bd7e47cdc4746b96099e11ae |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 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 | c29ba03b1896083dbe1084f6cd1c5367d8a0d67c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width