Title: Add method cache for MRO lookups by youknowone · Pull Request #7313 · RustPython/RustPython · GitHub
Open Graph Title: Add method cache for MRO lookups by youknowone · Pull Request #7313 · RustPython/RustPython
X Title: Add method cache for MRO lookups by youknowone · Pull Request #7313 · RustPython/RustPython
Description: 4096-entry direct-mapped cache keyed by (tp_version_tag, interned_name_ptr), mirroring CPython's type_cache in Objects/typeobject.c. find_name_in_mro() checks cache before MRO walk Auto-assigns version tags on cache miss (as in _PyType_Lookup) Negative caching for attribute-not-found results has_name_in_mro() avoids cloning on cache hit Invalidation via existing modified() mechanism (tp_version_tag=0) get_attr() and has_attr() now route through cached path Summary by CodeRabbit Performance Faster type attribute lookups via a new inline type-attribute cache. Cache is automatically cleared during garbage collection to avoid memory retention and improve cycle collection. New Features Added a public API to clear the type-attribute cache manually.
Open Graph Description: 4096-entry direct-mapped cache keyed by (tp_version_tag, interned_name_ptr), mirroring CPython's type_cache in Objects/typeobject.c. find_name_in_mro() checks cache before MRO walk Auto-assign...
X Description: 4096-entry direct-mapped cache keyed by (tp_version_tag, interned_name_ptr), mirroring CPython's type_cache in Objects/typeobject.c. find_name_in_mro() checks cache before MRO walk Auto-as...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7313
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e602a829-c7bf-e63d-d761-9ca3d7d1570a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A0EE:2C32F8:1523A71:1B9CB69:6A5C62E5 |
| html-safe-nonce | aa4cdd466f220f797af9e9652e929eee46933e94031888c15d42b114d38dfbf7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEVFOjJDMzJGODoxNTIzQTcxOjFCOUNCNjk6NkE1QzYyRTUiLCJ2aXNpdG9yX2lkIjoiNjc5MjI1MzgwNTU4Nzg4MjcyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a4c9ab235151fb6c02ce7d85921c8615b21f86665cd171261fec3d321dbaa191 |
| hovercard-subject-tag | pull_request:3343001570 |
| 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/RustPython/RustPython/pull/7313/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | 4096-entry direct-mapped cache keyed by (tp_version_tag, interned_name_ptr), mirroring CPython's type_cache in Objects/typeobject.c. find_name_in_mro() checks cache before MRO walk Auto-assign... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width