Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
36ffc5c
implement per type method cache
kumaraditya303 May 15, 2026
a4b07af
add micro benchmark
kumaraditya303 May 20, 2026
6b55b9d
fix issie with zero length arrays
kumaraditya303 May 20, 2026
c9bdf4b
fix for default build
kumaraditya303 May 20, 2026
bd59f2d
add comments
kumaraditya303 May 21, 2026
7416272
consistent function naming
kumaraditya303 May 21, 2026
258c0aa
Merge branch 'main' into mrocache
kumaraditya303 May 21, 2026
16ab4f9
formatting
kumaraditya303 May 21, 2026
7696234
add tests
kumaraditya303 May 24, 2026
a9d6917
fix _PyTypeCache_Invalidate wrapper
kumaraditya303 May 24, 2026
8d24e30
add comments
kumaraditya303 May 24, 2026
f62d1e9
fix tests for refleak check mode
kumaraditya303 May 24, 2026
728021c
Merge branch 'main' into mrocache
kumaraditya303 May 27, 2026
72dab63
address code review
kumaraditya303 Jun 4, 2026
27749ed
Merge branch 'main' of https://github.com/python/cpython into mrocache
kumaraditya303 Jun 4, 2026
cdf5643
fix MSVC compilation
kumaraditya303 Jun 4, 2026
b096009
fix bug causing assertion failure because find_name_in_mro can releas…
kumaraditya303 Jun 4, 2026
39f819b
fix bad merge of pystate.c
kumaraditya303 Jun 4, 2026
6da2741
use minsize as default length
kumaraditya303 Jun 5, 2026
ba4765f
📜🤖 Added by blurb_it.
blurb-it[bot] Jun 5, 2026
5b3c0a0
fix ignored.tsv
kumaraditya303 Jun 5, 2026
28bdf4c
Merge branch 'main' of https://github.com/python/cpython into mrocache
kumaraditya303 Jun 16, 2026
1d96329
use unsigned int for version_tag
kumaraditya303 Jun 16, 2026
ae4b856
remove _PyTypes_AfterFork
kumaraditya303 Jun 16, 2026
4fbec93
fix docs
kumaraditya303 Jun 16, 2026
ff4525c
Merge branch 'main' of https://github.com/python/cpython into mrocache
kumaraditya303 Jun 26, 2026
66ed070
add type_cache_too_big to stats
kumaraditya303 Jun 26, 2026
c4a4fb3
fix missing header
kumaraditya303 Jun 26, 2026
9d6f460
add type_cache_resizes and type_cache_invalidations stats
kumaraditya303 Jun 26, 2026
2f6ccde
Merge branch 'main' of https://github.com/python/cpython into mrocache
kumaraditya303 Jul 15, 2026
80b3c33
Merge branch 'main' of https://github.com/python/cpython into mrocache
kumaraditya303 Jul 21, 2026
42a6ae8
remove lock free from title
kumaraditya303 Jul 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use unsigned int for version_tag
  • Loading branch information
kumaraditya303 committed Jun 16, 2026
commit 1d96329ebc7b80c9009aa2a9def7633c94c9e5b1
4 changes: 2 additions & 2 deletions Include/internal/pycore_typecache.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ struct type_cache_entry {
// see _PyTypeCache_Lookup().
struct type_cache {
uint32_t mask; // mask for indexing into hashtable, i.e. size of hashtable is mask + 1
uint32_t version_tag; // initialized from type->tp_version_tag
uint32_t available; // number of available entries in hashtable
uint32_t used; // number of used entries in hashtable
unsigned int version_tag; // initialized from type->tp_version_tag
struct type_cache_entry hashtable[_Py_TYPECACHE_MINSIZE]; // hashtable entries
};

struct _PyTypeCacheLookupResult {
_PyStackRef value; // value is a stack reference to the cached attribute or method, or NULL if not found
int cache_hit; // 1 if the cache entry is valid and matches the type's version tag, 0 otherwise
uint32_t version_tag; // version tag of the type when the value was cached
unsigned int version_tag; // version tag of the type when the value was cached
};


Expand Down