Calculates an object deep size
Project description
objsize
Calculates an object deep size.
This module uses python internal GC implementation
to traverse all decedent objects.
It ignores type objects (isinstance(o, type)
)
such as classes and modules as they are common among all objects.
It is implemented without recursive calls
for best performance.
Usage
import numpy as np
from objsize import get_deep_obj_size
x = np.random.rand(1024).astype(np.float64)
y = np.random.rand(1024).astype(np.float64)
d = {'x': x, 'y': y}
class MyClass:
def __init__(self, xx, yy, dd):
self.x = xx
self.y = yy
self.d = dd
my_obj = MyClass(x, y, d)
get_deep_obj_size(my_obj)
# 16984
Install (beta)
python setup.py develop --user
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objsize-0.1.0.tar.gz
(15.9 kB
view hashes)
Built Distribution
Close
Hashes for objsize-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e262715c2a886c8c69e4648207893163c474c7d78d63079b7a0065393093ce5a |
|
MD5 | f7426b783da03cc676cbdcbacdc2151e |
|
BLAKE2b-256 | 3ff790d8a6364d72141eec35c807e88610529fffd15af8183427d4eb641b35b5 |