mycpp Code Generation

Measure the speedup from mycpp, and the resource usage.

Source code: oil/mycpp/examples

User Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
fib_iter gen 8 900 0.008
modules gen 2 179 0.010
fib_recursive gen 11 888 0.012
loops gen 4 294 0.012
asdl_generated gen 11 390 0.028
parse gen 25 778 0.032
scoped_resource gen 39 1,027 0.038
containers gen 10 108 0.094
tuple_return_value gen 20 192 0.106
files gen 7 68 0.109
classes gen 3 19 0.170
length gen 37 214 0.175
cartesian gen 79 334 0.238
escape gen 95 344 0.275
cgi gen 269 516 0.522
control_flow gen 209 112 1.865
varargs gen 24 12 1.986
gc_stack_roots gen 2 0 inf

Max Resident Set Size (MB)

Lower ratios are better. We use MB (powers of 10), not MiB (powers of 2).

example name gen C++ Python C++ : Python
classes gen 4.5 10.7 0.41
gc_stack_roots gen 3.4 7.1 0.48
scoped_resource gen 3.5 7.1 0.50
cgi gen 3.5 6.9 0.51
escape gen 3.5 6.9 0.51
parse gen 3.9 7.6 0.52
asdl_generated gen 3.7 7.1 0.52
fib_recursive gen 3.7 7.1 0.52
loops gen 3.8 7.2 0.53
fib_iter gen 3.7 6.9 0.53
tuple_return_value gen 3.8 7.1 0.54
modules gen 3.7 6.8 0.54
cartesian gen 3.8 6.9 0.55
length gen 3.8 6.8 0.56
control_flow gen 3.9 6.9 0.57
files gen 3.9 6.9 0.57
containers gen 28.5 47.8 0.60
varargs gen 5.6 6.9 0.81

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
asdl_generated gen 0 4 0.000
cgi gen 0 4 0.000
classes gen 0 11 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 8 0.000
fib_recursive gen 0 4 0.000
files gen 0 8 0.000
gc_stack_roots gen 0 12 0.000
loops gen 0 8 0.000
modules gen 0 4 0.000
containers gen 5 28 0.182
varargs gen 43 60 0.728
scoped_resource gen 8 8 0.977
parse gen 4 4 1.046
escape gen 12 8 1.543
length gen 7 4 1.885
cartesian gen 12 4 2.961
tuple_return_value gen 0 0 NA

raw benchmark files