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 26 0.000
gc_stack_roots gen 0 8 0.000
fib_iter gen 8 890 0.008
modules gen 2 178 0.010
fib_recursive gen 11 884 0.012
loops gen 4 291 0.012
asdl_generated gen 5 381 0.014
parse gen 22 776 0.028
files gen 4 99 0.038
scoped_resource gen 43 1,051 0.041
containers gen 8 117 0.065
tuple_return_value gen 16 191 0.084
length gen 41 201 0.204
cartesian gen 90 323 0.279
escape gen 98 347 0.284
cgi gen 254 512 0.497
varargs gen 12 12 0.979
control_flow gen 209 120 1.738

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 7.1 0.48
scoped_resource gen 3.5 7.1 0.50
escape gen 3.5 6.9 0.51
fib_recursive gen 3.5 6.9 0.51
parse gen 3.9 7.6 0.52
asdl_generated gen 3.7 7.1 0.52
tuple_return_value gen 3.7 6.9 0.53
length gen 3.8 7.1 0.54
loops gen 3.8 7.1 0.54
cartesian gen 3.8 6.9 0.55
cgi gen 3.8 6.9 0.55
fib_iter gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
control_flow gen 3.9 6.9 0.57
containers gen 28.7 47.8 0.60
varargs gen 5.5 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
cartesian gen 0 4 0.000
cgi gen 0 4 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 8 0.000
fib_recursive gen 0 4 0.000
loops gen 0 8 0.000
modules gen 0 4 0.000
gc_stack_roots gen 2 4 0.449
containers gen 8 16 0.474
parse gen 7 12 0.607
classes gen 3 4 0.740
varargs gen 54 60 0.914
files gen 4 4 0.941
scoped_resource gen 4 4 0.984
escape gen 8 8 0.988
length gen 4 4 1.019
asdl_generated gen 5 0 inf
tuple_return_value gen 4 0 inf

raw benchmark files