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
classes gen 0 20 0.000
containers gen 0 122 0.000
modules gen 0 182 0.000
fib_iter gen 4 890 0.004
fib_recursive gen 11 880 0.012
loops gen 4 284 0.013
asdl_generated gen 11 374 0.029
parse gen 25 770 0.033
scoped_resource gen 44 1,015 0.043
tuple_return_value gen 20 177 0.115
files gen 8 65 0.121
gc_stack_roots gen 2 12 0.144
length gen 41 205 0.198
cartesian gen 79 335 0.235
escape gen 98 351 0.279
varargs gen 8 20 0.386
cgi gen 269 501 0.536
control_flow gen 204 102 1.998

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.6 0.42
cartesian gen 3.3 6.9 0.47
gc_stack_roots gen 3.4 6.9 0.49
parse gen 3.8 7.6 0.50
asdl_generated gen 3.7 6.9 0.53
escape gen 3.7 6.9 0.53
fib_recursive gen 3.7 6.9 0.53
modules gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
cgi gen 3.8 7.1 0.54
loops gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
fib_iter gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
scoped_resource gen 3.8 6.9 0.55
containers gen 28.5 47.7 0.60
varargs gen 5.5 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
asdl_generated gen 0 8 0.000
cgi gen 0 8 0.000
fib_recursive gen 0 8 0.000
files gen 0 12 0.000
loops gen 0 12 0.000
tuple_return_value gen 0 16 0.000
scoped_resource gen 4 16 0.249
parse gen 4 16 0.262
classes gen 3 12 0.270
control_flow gen 4 12 0.339
fib_iter gen 4 8 0.501
length gen 4 8 0.505
escape gen 8 8 0.981
containers gen 16 16 0.989
varargs gen 59 53 1.113
cartesian gen 12 8 1.484
modules gen 2 0 inf
gc_stack_roots gen 0 0 NA

raw benchmark files