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 909 0.004
modules gen 2 185 0.009
fib_recursive gen 11 871 0.012
loops gen 4 289 0.013
asdl_generated gen 11 381 0.028
parse gen 25 754 0.033
scoped_resource gen 43 1,022 0.042
tuple_return_value gen 16 183 0.088
containers gen 10 94 0.109
files gen 7 67 0.110
classes gen 4 30 0.116
length gen 38 199 0.189
cartesian gen 83 328 0.252
escape gen 98 340 0.290
cgi gen 260 518 0.502
varargs gen 16 28 0.595
control_flow gen 209 112 1.867
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.6 0.42
parse gen 3.8 7.7 0.49
cgi gen 3.5 6.9 0.51
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
cartesian gen 3.7 6.9 0.53
modules gen 3.7 6.9 0.53
scoped_resource gen 3.7 6.9 0.53
tuple_return_value gen 3.8 7.1 0.54
escape gen 3.7 6.8 0.54
control_flow gen 3.8 6.9 0.55
fib_iter gen 3.8 6.9 0.55
fib_recursive gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
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
control_flow gen 0 4 0.000
fib_recursive gen 0 8 0.000
files gen 0 8 0.000
gc_stack_roots gen 0 11 0.000
loops gen 0 8 0.000
containers gen 5 39 0.130
scoped_resource gen 4 12 0.326
fib_iter gen 4 8 0.472
tuple_return_value gen 4 8 0.506
parse gen 4 8 0.525
escape gen 8 12 0.657
length gen 8 8 0.943
cgi gen 8 8 1.004
varargs gen 49 43 1.137
cartesian gen 8 4 1.971
asdl_generated gen 0 0 NA
classes gen 0 0 NA
modules gen 0 0 NA

raw benchmark files