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
modules gen 0 170 0.000
fib_iter gen 8 895 0.008
fib_recursive gen 11 877 0.013
loops gen 4 306 0.013
asdl_generated gen 11 375 0.029
parse gen 25 771 0.032
scoped_resource gen 40 1,020 0.039
tuple_return_value gen 14 183 0.075
files gen 7 73 0.102
containers gen 12 109 0.108
classes gen 3 26 0.125
gc_stack_roots gen 2 12 0.152
length gen 41 202 0.203
escape gen 91 349 0.261
cartesian gen 90 342 0.262
cgi gen 270 524 0.516
varargs gen 19 16 1.217
control_flow gen 212 108 1.961

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.7 0.49
fib_iter gen 3.5 7.1 0.50
scoped_resource gen 3.7 7.2 0.51
cartesian gen 3.5 6.9 0.51
cgi gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
length gen 3.7 7.1 0.52
asdl_generated gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
escape gen 3.7 6.8 0.54
control_flow gen 3.8 6.9 0.55
fib_recursive gen 3.8 6.9 0.55
files 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.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
cartesian gen 0 8 0.000
classes gen 0 4 0.000
control_flow gen 0 8 0.000
fib_iter gen 0 4 0.000
fib_recursive gen 0 4 0.000
files gen 0 4 0.000
loops gen 0 12 0.000
containers gen 4 27 0.143
modules gen 2 12 0.156
length gen 4 8 0.508
tuple_return_value gen 7 12 0.572
scoped_resource gen 8 12 0.665
varargs gen 47 56 0.835
parse gen 4 4 1.037
escape gen 16 4 3.954
cgi gen 0 0 NA
gc_stack_roots gen 0 0 NA

raw benchmark files