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 885 0.009
modules gen 2 172 0.010
fib_recursive gen 11 877 0.012
loops gen 4 299 0.013
asdl_generated gen 7 377 0.019
scoped_resource gen 38 1,021 0.037
parse gen 29 759 0.039
tuple_return_value gen 16 198 0.081
containers gen 8 84 0.092
files gen 7 72 0.102
classes gen 3 22 0.150
length gen 44 203 0.217
gc_stack_roots gen 2 8 0.222
cartesian gen 86 327 0.264
escape gen 99 353 0.281
cgi gen 279 516 0.540
varargs gen 29 20 1.459
control_flow gen 209 110 1.903

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.6 10.7 0.43
scoped_resource gen 3.5 7.1 0.50
cartesian gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
parse gen 3.9 7.5 0.53
loops gen 3.8 7.2 0.53
asdl_generated gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
escape gen 3.7 6.9 0.53
fib_iter gen 3.7 6.9 0.53
fib_recursive gen 3.7 6.9 0.53
modules gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
files gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
containers gen 28.5 47.7 0.60
varargs gen 5.6 6.9 0.81

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
cgi gen 0 8 0.000
classes gen 0 9 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 12 0.000
fib_recursive gen 0 4 0.000
files 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
parse gen 0 8 0.000
containers gen 8 52 0.148
tuple_return_value gen 4 8 0.506
varargs gen 37 52 0.722
asdl_generated gen 4 4 0.897
cartesian gen 4 4 0.985
scoped_resource gen 8 8 1.065
escape gen 8 0 inf
loops gen 0 0 NA

raw benchmark files