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 23 0.000
gc_stack_roots gen 0 3 0.000
modules gen 0 209 0.000
fib_iter gen 8 994 0.008
loops gen 3 321 0.008
asdl_generated gen 4 423 0.009
fib_recursive gen 11 1,004 0.011
parse gen 29 857 0.034
scoped_resource gen 50 1,163 0.043
containers gen 9 123 0.072
files gen 7 86 0.085
tuple_return_value gen 20 216 0.093
length gen 44 228 0.192
escape gen 97 382 0.253
cartesian gen 101 363 0.279
cgi gen 268 580 0.462
control_flow gen 232 112 2.071
varargs gen 21 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.8 0.41
gc_stack_roots gen 3.4 6.9 0.49
parse gen 3.8 7.6 0.50
asdl_generated gen 3.5 6.9 0.51
cartesian gen 3.5 6.9 0.51
escape gen 3.7 7.1 0.52
cgi gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
fib_recursive gen 3.8 7.1 0.54
loops gen 3.8 7.1 0.54
scoped_resource gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
fib_iter 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
containers gen 28.5 48.0 0.60
varargs gen 5.6 7.1 0.80

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
cgi gen 0 4 0.000
fib_iter gen 0 12 0.000
fib_recursive gen 0 12 0.000
parse gen 0 12 0.000
tuple_return_value gen 0 4 0.000
loops gen 3 16 0.170
gc_stack_roots gen 2 10 0.198
control_flow gen 4 15 0.259
containers gen 9 32 0.278
classes gen 4 12 0.359
cartesian gen 4 8 0.508
varargs gen 46 82 0.555
asdl_generated gen 7 8 0.902
scoped_resource gen 4 4 0.963
length gen 8 8 0.993
escape gen 12 12 1.014
modules gen 2 0 inf
files gen 0 0 NA

raw benchmark files