We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3291ed1 commit 77903adCopy full SHA for 77903ad
pandas/_libs/hashtable_class_helper.pxi.in
@@ -344,9 +344,11 @@ cdef class {{name}}HashTable(HashTable):
344
345
def sizeof(self, deep=False):
346
""" return the size of my table in bytes """
347
- return self.table.n_buckets * (sizeof({{dtype}}_t) + # keys
348
- sizeof(Py_ssize_t) + # vals
349
- sizeof(uint32_t)) # flags
+ overhead = 4 * sizeof(uint32_t) + 3 * sizeof(uint32_t*)
+ for_flags = max(1, self.table.n_buckets >> 5) * sizeof(uint32_t)
+ for_pairs = self.table.n_buckets * (sizeof({{dtype}}_t) + # keys
350
+ sizeof(Py_ssize_t)) # vals
351
+ return overhead + for_flags + for_pairs
352
353
cpdef get_item(self, {{dtype}}_t val):
354
cdef:
0 commit comments