Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython · GitHub
Open Graph Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython
X Title: GH-93533: Shrink the `LOAD_ATTR` caches by brandtbucher · Pull Request #103014 · python/cpython
Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A size of 8 is 1% slower and has a 81.0% LOAD_ATTR hit rate on pyperformance, with 32.5% of specialization failures due to a too-small cache. A size of 16 is 0% faster and has a 82.2% LOAD_ATTR hit rate on pyperformance, with 8.7% of specialization failures due to a too-small cache. A size of 32 is 0% faster and has a 82.6% LOAD_ATTR hit rate on pyperformance, with 3.3% of specialization failures due to a too-small cache. A flexible buffer was also considered, but that was 1% slower, likely due to the additional indirection and management of the buffer. Issue: gh-93533
Open Graph Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...
X Description: This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz...
Opengraph URL: https://github.com/python/cpython/pull/103014
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0df1a955-70d8-21aa-c3ce-6710d0915b9d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC66:3E4147:1EA7E:2850E:696B5725 |
| html-safe-nonce | d4cc0cc83f7c974ff318e056c701b44ff1f31bb6cd61d8bc6fae29a48b2df9ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzY2OjNFNDE0NzoxRUE3RToyODUwRTo2OTZCNTcyNSIsInZpc2l0b3JfaWQiOiIxMjk4ODg1NTk2MjY3ODk0NTY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d1223084d1c5db9674659702342ebb6f0ff449680a22e02ad8fdb422a4178607 |
| hovercard-subject-tag | pull_request:1289571205 |
| 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/103014/files |
| twitter:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| og:image:alt | This adds a fixed array of cached methods to the PyTypeObject struct. This approach saves memory if there are ~23x more LOAD_ATTR sites than there are types. A size of 16 was chosen because: A siz... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width