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 4 890 0.004
modules gen 2 178 0.010
fib_recursive gen 11 888 0.012
loops gen 4 296 0.013
asdl_generated gen 7 380 0.020
parse gen 29 763 0.038
scoped_resource gen 47 1,047 0.045
tuple_return_value gen 12 211 0.058
containers gen 8 116 0.067
files gen 7 71 0.103
length gen 37 225 0.163
classes gen 3 19 0.175
cartesian gen 75 320 0.234
escape gen 106 346 0.308
cgi gen 266 512 0.519
varargs gen 20 16 1.232
control_flow gen 204 108 1.888
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.8 0.41
gc_stack_roots gen 3.5 7.1 0.50
parse gen 3.8 7.6 0.50
cartesian gen 3.7 7.1 0.52
cgi gen 3.7 7.1 0.52
escape gen 3.7 7.1 0.52
scoped_resource gen 3.7 7.1 0.52
tuple_return_value gen 3.7 7.1 0.52
asdl_generated gen 3.7 6.9 0.53
length gen 3.7 6.9 0.53
files 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_recursive gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
fib_iter gen 3.9 6.9 0.57
containers gen 28.5 47.8 0.60
varargs gen 5.5 6.9 0.79

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
classes gen 0 12 0.000
escape gen 0 4 0.000
fib_recursive gen 0 4 0.000
files gen 0 4 0.000
gc_stack_roots gen 0 12 0.000
loops gen 0 8 0.000
modules gen 0 4 0.000
parse gen 0 8 0.000
scoped_resource gen 0 4 0.000
containers gen 8 20 0.389
asdl_generated gen 4 8 0.466
fib_iter gen 4 8 0.473
tuple_return_value gen 8 12 0.682
varargs gen 47 56 0.845
cgi gen 4 4 0.992
control_flow gen 4 4 0.999
length gen 7 4 1.829
cartesian gen 16 8 1.971

raw benchmark files