-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF: correctly report memory used by Index's #15237
Conversation
@@ -237,6 +238,12 @@ cdef class {{name}}HashTable(HashTable): | |||
k = kh_get_{{dtype}}(self.table, key) | |||
return k != self.table.n_buckets | |||
|
|||
def sizeof(self, deep=False): | |||
""" return the size of my table in bytes """ | |||
return self.table.n_buckets * (sizeof(self.table.keys) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wesm I believe this is correctly, any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sizeof
will return a pointer size here - I think you instead need to do something like this? (not sure the kh aliases are exposed)
self.table.n_buckets * (sizeof(khkey_t) + #keys
sizeof({{dtype}}_t) + #vals
sizeof(khint32_t)) #flags
pandas/pandas/src/klib/khash.h
Line 189 in be32852
khint32_t *flags; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense
Current coverage is 86.31% (diff: 100%)@@ master #15237 diff @@
==========================================
Files 139 139
Lines 51096 51103 +7
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 44103 44110 +7
Misses 6993 6993
Partials 0 0
|
What do you think about using |
@MaximilianR I added
|
Author: Jeff Reback <jeff@reback.net> Closes pandas-dev#15237 from jreback/memory and squashes the following commits: d77c002 [Jeff Reback] PERF: correctly report memory used by Index's
No description provided.