Title: Performance regression in PySet_Add() with 3.14t · Issue #140476 · python/cpython · GitHub
Open Graph Title: Performance regression in PySet_Add() with 3.14t · Issue #140476 · python/cpython
X Title: Performance regression in PySet_Add() with 3.14t · Issue #140476 · python/cpython
Description: In the fbthrift-python benchmarks, we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we populated sets with 1000 elements. The re...
Open Graph Description: In the fbthrift-python benchmarks, we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we p...
X Description: In the fbthrift-python benchmarks, we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we p...
Opengraph URL: https://github.com/python/cpython/issues/140476
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance regression in PySet_Add() with 3.14t","articleBody":"In the [fbthrift-python](https://github.com/facebook/fbthrift/tree/main/thrift/lib/python) [benchmarks](https://github.com/facebook/fbthrift/tree/main/thrift/lib/python/benchmark), we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we populated sets with 1000 elements. The regression was linked to the use of the `PySet_Add()` API for building `set` and `frozenset` objects, where a critical section is always applied—even when the set is uniquely referenced during initialization.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-140440\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/yoney","@type":"Person","name":"yoney"},"datePublished":"2025-10-22T19:39:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/140476/cpython/issues/140476"}
| 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:c1fcc723-fd0b-736c-cd8c-f25b979d6f66 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B442:33775C:36E34C:480260:69700B7A |
| html-safe-nonce | a5f59f7dd3f2fb8966626f7aa2f6d7ef8465abe4eb7392666f53b5e569296fbd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDQyOjMzNzc1QzozNkUzNEM6NDgwMjYwOjY5NzAwQjdBIiwidmlzaXRvcl9pZCI6IjcwNjAyMzQyNDg0NDIwODgzMTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6bbd038fcd9277f2b1eb0522854553f4c6fbbdeab8c7100ea24035ca41fb8fe4 |
| hovercard-subject-tag | issue:3542153137 |
| 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/140476/issue_layout |
| twitter:image | https://opengraph.githubassets.com/738e4116e84631808cceb14174e1c4a75bbfd364071710e4b91c9e716567adeb/python/cpython/issues/140476 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/738e4116e84631808cceb14174e1c4a75bbfd364071710e4b91c9e716567adeb/python/cpython/issues/140476 |
| og:image:alt | In the fbthrift-python benchmarks, we observed a performance regression when comparing Python 3.14t to 3.14, particularly during Thrift struct initialization and deserialization. In our tests, we p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yoney |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6e3493a220046ce21668e7217b5ac322bdc4edd2736ee04362e5462968204bd5 |
| 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 | 9f627dfc82200bff3d2b49e4fb4b0a99594a9a9a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width