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
loops gen 0 293 0.000
fib_iter gen 8 896 0.008
modules gen 2 171 0.010
fib_recursive gen 11 896 0.012
asdl_generated gen 11 379 0.029
parse gen 26 776 0.034
containers gen 4 112 0.035
scoped_resource gen 47 1,053 0.045
files gen 4 77 0.049
tuple_return_value gen 16 192 0.084
classes gen 3 19 0.167
gc_stack_roots gen 2 8 0.220
length gen 44 201 0.220
cartesian gen 82 315 0.261
escape gen 103 340 0.304
cgi gen 269 508 0.529
varargs gen 20 12 1.635
control_flow gen 206 114 1.805

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.8 0.41
gc_stack_roots gen 3.4 6.8 0.50
parse gen 3.8 7.6 0.50
length gen 3.7 7.1 0.52
loops gen 3.8 7.2 0.53
cartesian gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
escape gen 3.7 6.9 0.53
modules gen 3.7 6.9 0.53
fib_recursive gen 3.8 7.1 0.54
scoped_resource gen 3.8 7.1 0.54
asdl_generated gen 3.7 6.8 0.54
tuple_return_value gen 3.8 6.9 0.55
fib_iter gen 3.8 6.8 0.56
files gen 3.8 6.8 0.56
control_flow gen 3.9 6.9 0.57
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
asdl_generated gen 0 8 0.000
cgi gen 0 4 0.000
classes gen 0 12 0.000
fib_iter gen 0 4 0.000
fib_recursive gen 0 4 0.000
gc_stack_roots gen 0 4 0.000
length gen 0 8 0.000
modules gen 0 12 0.000
escape gen 4 12 0.331
containers gen 12 24 0.489
cartesian gen 8 12 0.687
varargs gen 47 60 0.785
loops gen 4 4 0.909
parse gen 4 4 0.932
tuple_return_value gen 4 4 1.007
control_flow gen 4 0 inf
files gen 4 0 inf
scoped_resource gen 0 0 NA

raw benchmark files