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 895 0.008
modules gen 2 178 0.011
fib_recursive gen 11 878 0.012
loops gen 4 297 0.013
asdl_generated gen 7 372 0.019
parse gen 26 775 0.033
scoped_resource gen 44 1,031 0.042
files gen 4 66 0.058
tuple_return_value gen 12 189 0.064
containers gen 8 117 0.066
gc_stack_roots gen 2 12 0.145
classes gen 3 19 0.167
length gen 41 202 0.201
cartesian gen 83 320 0.258
escape gen 90 341 0.264
cgi gen 255 509 0.500
control_flow gen 207 109 1.907
varargs gen 28 12 2.302

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
parse gen 3.8 7.6 0.50
cartesian gen 3.5 6.9 0.51
cgi gen 3.5 6.9 0.51
fib_iter gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
loops gen 3.7 7.1 0.52
asdl_generated gen 3.5 6.8 0.52
fib_recursive gen 3.7 6.9 0.53
scoped_resource gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
escape 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
tuple_return_value gen 3.8 6.9 0.55
containers gen 28.5 47.7 0.60
varargs gen 5.4 6.9 0.77

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
cgi gen 0 4 0.000
classes gen 0 11 0.000
fib_iter gen 0 8 0.000
fib_recursive gen 0 12 0.000
modules gen 0 4 0.000
files gen 4 12 0.326
containers gen 8 20 0.395
asdl_generated gen 4 8 0.453
parse gen 4 8 0.457
length gen 4 8 0.514
varargs gen 39 60 0.658
cartesian gen 8 8 0.982
control_flow gen 4 4 0.990
scoped_resource gen 4 4 0.991
escape gen 16 12 1.314
tuple_return_value gen 8 4 2.005
gc_stack_roots gen 0 0 NA
loops gen 0 0 NA

raw benchmark files