Skip to content

Instantly share code, notes, and snippets.

@pablogsal
Created April 6, 2022 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablogsal/75cbd24131ecedf36314cad368dc6d3f to your computer and use it in GitHub Desktop.
Save pablogsal/75cbd24131ecedf36314cad368dc6d3f to your computer and use it in GitHub Desktop.
mem comparison
##### Python 3.10
## BB code
types | # objects | total size
============================ | =========== | ============
str | 37328 | 4.51 MB
dict | 6340 | 2.84 MB
code | 10490 | 1.95 MB
type | 1605 | 1.46 MB
bytes | 24553 | 1.31 MB
list | 642 | 1.15 MB
tuple | 7426 | 555.34 KB
weakref | 2016 | 173.25 KB
int | 3345 | 152.84 KB
builtin_function_or_method | 1585 | 136.21 KB
method_descriptor | 1495 | 128.48 KB
wrapper_descriptor | 1473 | 126.59 KB
set | 203 | 120.99 KB
abc.ABCMeta | 119 | 120.86 KB
getset_descriptor | 1371 | 107.11 KB
User time (seconds): 1.76
System time (seconds): 0.05
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.81
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 124000
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 34949
Voluntary context switches: 47
Involuntary context switches: 54
Swaps: 0
File system inputs: 0
File system outputs: 2288
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
## test suite (test_ast test_compile test_syntax test_list test_dict)
types | # objects | total size
============================ | =========== | ============
str | 14815 | 1.84 MB
dict | 2935 | 1.35 MB
code | 5162 | 981.67 KB
type | 900 | 797.66 KB
tuple | 3387 | 256.23 KB
wrapper_descriptor | 1200 | 103.12 KB
builtin_function_or_method | 1165 | 100.12 KB
weakref | 1119 | 96.16 KB
set | 99 | 91.93 KB
list | 790 | 85.50 KB
abc.ABCMeta | 74 | 73.87 KB
method_descriptor | 854 | 73.39 KB
int | 1567 | 71.91 KB
getset_descriptor | 645 | 50.39 KB
frozenset | 122 | 48.64 KB
User time (seconds): 3.55
System time (seconds): 0.36
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:03.93
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 601340
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 380321
Voluntary context switches: 14
Involuntary context switches: 39
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
## mypy over itself
types | # objects | total size
============================ | =========== | ============
str | 61522 | 6.19 MB
dict | 12140 | 3.39 MB
list | 36013 | 3.05 MB
mypy.types.Instance | 17118 | 2.22 MB
code | 7125 | 1.71 MB
tuple | 21905 | 1.58 MB
FileNotFoundError | 10472 | 1.36 MB
type | 1072 | 960.00 KB
mypy.nodes.Var | 3547 | 886.75 KB
mypy.types.CallableType | 3930 | 859.69 KB
mypy.nodes.FuncDef | 2319 | 615.98 KB
mypy.types.TypeVarType | 3220 | 427.66 KB
mypy.nodes.SymbolTableNode | 3658 | 400.09 KB
mypy.types.UnboundType | 2209 | 293.38 KB
int | 6603 | 289.02 KB
User time (seconds): 17.51
System time (seconds): 0.13
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:17.66
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 182272
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 57354
Voluntary context switches: 1
Involuntary context switches: 81
Swaps: 0
File system inputs: 0
File system outputs: 96
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
##### Python 3.11
## BB code
types | # objects | total size
============================ | =========== | ============
str | 37943 | 4.58 MB
code | 10612 | 4.33 MB
dict | 5390 | 2.20 MB
type | 1614 | 1.81 MB
bytes | 24552 | 1.31 MB
list | 1134 | 1.18 MB
tuple | 7573 | 567.77 KB
weakref | 2008 | 188.25 KB
int | 3450 | 157.45 KB
abc.ABCMeta | 112 | 150.38 KB
builtin_function_or_method | 1589 | 136.55 KB
method_descriptor | 1507 | 129.51 KB
wrapper_descriptor | 1479 | 127.10 KB
set | 194 | 126.45 KB
getset_descriptor | 1384 | 108.12 KB
User time (seconds): 1.55
System time (seconds): 0.08
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.64
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 131324
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 47924
Voluntary context switches: 49
Involuntary context switches: 23
Swaps: 0
File system inputs: 0
File system outputs: 4688
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
## test suite (test_ast test_compile test_syntax test_list test_dict)
types | # objects | total size
============================ | =========== | ============
code | 5282 | 2.17 MB
str | 15277 | 1.90 MB
dict | 2607 | 1.05 MB
type | 916 | 977.75 KB
tuple | 3589 | 275.38 KB
list | 1097 | 110.77 KB
weakref | 1136 | 106.50 KB
wrapper_descriptor | 1204 | 103.47 KB
builtin_function_or_method | 1200 | 103.12 KB
set | 97 | 97.98 KB
abc.ABCMeta | 75 | 96.30 KB
int | 1702 | 77.82 KB
method_descriptor | 863 | 74.16 KB
getset_descriptor | 676 | 52.81 KB
frozenset | 120 | 47.19 KB
User time (seconds): 4.88
System time (seconds): 0.47
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.36
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 706764
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 422293
Voluntary context switches: 14
Involuntary context switches: 28
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
## mypy over itself
types | # objects | total size
============================ | =========== | ============
str | 62004 | 6.24 MB
list | 36517 | 3.09 MB
code | 7185 | 2.96 MB
dict | 8418 | 2.33 MB
mypy.types.Instance | 17221 | 2.23 MB
tuple | 21840 | 1.58 MB
FileNotFoundError | 10438 | 1.43 MB
type | 1082 | 1.12 MB
mypy.nodes.Var | 3559 | 889.75 KB
mypy.types.CallableType | 3946 | 863.19 KB
mypy.nodes.FuncDef | 2333 | 619.70 KB
mypy.types.TypeVarType | 3234 | 429.52 KB
mypy.nodes.SymbolTableNode | 3683 | 402.83 KB
mypy.types.UnboundType | 2209 | 293.38 KB
int | 6629 | 290.22 KB
User time (seconds): 13.65
System time (seconds): 0.21
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:13.91
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 182772
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 116931
Voluntary context switches: 1
Involuntary context switches: 45
Swaps: 0
File system inputs: 0
File system outputs: 16
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment