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 883 0.009
modules gen 2 183 0.010
fib_recursive gen 11 912 0.012
loops gen 4 305 0.012
asdl_generated gen 7 380 0.019
containers gen 4 112 0.034
parse gen 30 759 0.039
scoped_resource gen 48 1,085 0.044
tuple_return_value gen 13 186 0.072
files gen 7 72 0.103
classes gen 3 22 0.147
length gen 36 202 0.179
cartesian gen 87 322 0.269
escape gen 101 349 0.290
cgi gen 266 511 0.521
control_flow gen 211 112 1.884
varargs gen 25 12 2.069
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.7 0.41
gc_stack_roots gen 3.4 6.9 0.49
cartesian gen 3.5 7.1 0.50
asdl_generated gen 3.5 6.9 0.51
escape gen 3.5 6.9 0.51
cgi gen 3.7 7.1 0.52
loops gen 3.7 7.1 0.52
modules gen 3.7 7.1 0.52
parse gen 3.9 7.5 0.53
length gen 3.7 6.9 0.53
fib_iter gen 3.8 7.1 0.54
fib_recursive gen 3.8 7.1 0.54
files gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
scoped_resource gen 3.8 6.9 0.55
tuple_return_value gen 3.8 6.9 0.55
containers gen 28.6 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 9 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 8 0.000
files gen 0 4 0.000
gc_stack_roots gen 0 12 0.000
loops gen 0 4 0.000
modules gen 0 4 0.000
parse gen 0 12 0.000
scoped_resource gen 0 8 0.000
cartesian gen 4 12 0.345
containers gen 12 24 0.483
tuple_return_value gen 7 12 0.566
varargs gen 41 60 0.689
asdl_generated gen 4 4 0.898
length gen 8 8 0.992
cgi gen 4 4 1.010
escape gen 8 4 1.938
fib_recursive gen 0 0 NA

raw benchmark files