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 18 0.000
fib_iter gen 8 887 0.009
modules gen 2 182 0.010
loops gen 3 288 0.010
fib_recursive gen 11 880 0.012
asdl_generated gen 7 368 0.020
parse gen 29 780 0.037
scoped_resource gen 43 1,028 0.042
containers gen 10 125 0.082
tuple_return_value gen 16 183 0.088
files gen 8 63 0.120
gc_stack_roots gen 2 12 0.146
length gen 37 208 0.178
escape gen 97 341 0.284
cartesian gen 112 326 0.343
cgi gen 272 512 0.532
varargs gen 8 8 0.977
control_flow gen 208 110 1.893

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
parse gen 3.8 7.6 0.50
gc_stack_roots gen 3.5 6.9 0.51
loops gen 3.8 7.2 0.53
asdl_generated gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
escape gen 3.7 6.9 0.53
scoped_resource gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
fib_recursive gen 3.8 7.1 0.54
control_flow gen 3.7 6.8 0.54
cartesian 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
modules gen 3.8 6.9 0.55
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
cartesian gen 0 8 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 12 0.000
fib_recursive gen 0 4 0.000
files gen 0 12 0.000
loops gen 0 8 0.000
parse gen 0 4 0.000
classes gen 3 13 0.243
asdl_generated gen 4 12 0.299
scoped_resource gen 4 12 0.324
tuple_return_value gen 4 8 0.505
containers gen 5 8 0.637
varargs gen 58 64 0.916
escape gen 12 12 0.978
length gen 8 4 2.061
cgi gen 0 0 NA
gc_stack_roots gen 0 0 NA
modules gen 0 0 NA

raw benchmark files