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 891 0.004
modules gen 2 175 0.010
loops gen 4 298 0.012
fib_recursive gen 11 881 0.012
asdl_generated gen 11 382 0.029
parse gen 25 760 0.033
containers gen 4 110 0.035
scoped_resource gen 48 1,021 0.047
tuple_return_value gen 13 186 0.072
files gen 8 76 0.101
classes gen 3 20 0.162
length gen 45 206 0.219
cartesian gen 79 326 0.241
gc_stack_roots gen 2 8 0.256
escape gen 99 351 0.283
cgi gen 249 504 0.495
varargs gen 13 15 0.818
control_flow gen 208 107 1.950

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.3 10.6 0.41
cartesian gen 3.5 7.1 0.50
modules gen 3.5 7.1 0.50
escape gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
parse gen 3.9 7.6 0.52
length gen 3.7 7.1 0.52
asdl_generated gen 3.5 6.8 0.52
cgi gen 3.7 6.9 0.53
fib_recursive gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
tuple_return_value gen 3.7 6.8 0.54
control_flow gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
scoped_resource gen 3.8 6.9 0.55
fib_iter gen 3.8 6.8 0.56
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
asdl_generated gen 0 4 0.000
classes gen 0 12 0.000
control_flow gen 0 8 0.000
fib_recursive gen 0 4 0.000
gc_stack_roots gen 0 4 0.000
length gen 0 4 0.000
loops gen 0 4 0.000
modules gen 0 8 0.000
scoped_resource gen 0 16 0.000
containers gen 12 27 0.420
fib_iter gen 4 8 0.472
cgi gen 4 8 0.495
tuple_return_value gen 7 8 0.845
varargs gen 54 57 0.945
cartesian gen 12 12 0.990
parse gen 4 4 1.047
escape gen 8 4 1.973
files gen 0 0 NA

raw benchmark files