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 181 0.010
fib_recursive gen 11 890 0.012
loops gen 4 285 0.013
parse gen 21 766 0.027
asdl_generated gen 11 371 0.030
scoped_resource gen 40 1,038 0.038
files gen 4 70 0.055
containers gen 8 96 0.081
tuple_return_value gen 20 190 0.106
classes gen 3 19 0.168
length gen 41 211 0.194
gc_stack_roots gen 2 8 0.225
cartesian gen 82 331 0.249
escape gen 107 360 0.296
cgi gen 269 507 0.529
varargs gen 31 16 1.970
control_flow gen 213 107 1.990

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
asdl_generated gen 3.5 7.1 0.50
parse gen 3.8 7.6 0.50
cartesian gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
cgi gen 3.7 7.1 0.52
fib_iter gen 3.7 7.1 0.52
files gen 3.7 7.1 0.52
scoped_resource gen 3.7 7.1 0.52
control_flow gen 3.7 6.9 0.53
fib_recursive gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
escape gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
tuple_return_value gen 3.8 6.9 0.55
length gen 3.8 6.8 0.56
containers gen 28.7 47.7 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 8 0.000
cgi gen 0 4 0.000
classes gen 0 11 0.000
control_flow gen 0 8 0.000
gc_stack_roots gen 0 4 0.000
loops gen 0 16 0.000
modules gen 0 4 0.000
tuple_return_value gen 0 4 0.000
containers gen 8 40 0.193
files gen 4 8 0.465
varargs gen 35 56 0.633
scoped_resource gen 8 12 0.664
parse gen 8 12 0.695
cartesian gen 8 8 1.032
length gen 4 0 inf
escape gen 0 0 NA
fib_iter gen 0 0 NA
fib_recursive gen 0 0 NA

raw benchmark files