Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P835
(An Untitled Masterwork)
Active
Public
Actions
Authored by
haltode
on Oct 26 2020, 1:59 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
class
Bar
:
def
__init__
(
self
):
self
.
x
=
randint
(
1
,
1000
)
self
.
y
=
[
randint
(
1
,
1000
)
for
_
in
range
(
100
)]
class
Foo
:
def
__init__
(
self
):
self
.
big_list
=
[
Bar
()
for
_
in
range
(
10
**
4
)]
def
print_size
(
self
):
t
=
time
.
time
()
print
(
"pympler asizeof"
,
asizeof
.
asizeof
(
self
),
(
time
.
time
()
-
t
))
t
=
time
.
time
()
print
(
"original total_size"
,
total_size2
(
self
),
(
time
.
time
()
-
t
))
t
=
time
.
time
()
print
(
"vlorentz total_size"
,
total_size
(
self
),
(
time
.
time
()
-
t
))
pympler
asizeof
34706824
1.6227340698242188
original
total_size
48
2.09808349609375e-05
vlorentz
total_size
30659341
12.164994716644287
Event Timeline
haltode
created this paste.
Oct 26 2020, 1:59 PM
2020-10-26 13:59:52 (UTC+1)
haltode
created this object in space
S1 Public
.
Log In to Comment