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 5 643 0.008
modules gen 1 126 0.010
fib_recursive gen 8 629 0.012
loops gen 3 214 0.012
asdl_generated gen 4 266 0.014
parse gen 21 547 0.038
scoped_resource gen 33 753 0.044
containers gen 4 74 0.057
files gen 3 46 0.059
tuple_return_value gen 14 140 0.101
classes gen 2 21 0.111
gc_stack_roots gen 1 8 0.152
length gen 32 146 0.217
escape gen 73 244 0.300
cartesian gen 79 231 0.341
cgi gen 186 373 0.498
control_flow gen 148 79 1.881
varargs gen 16 8 2.088

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.7 10.9 0.43
parse gen 3.9 7.7 0.50
gc_stack_roots gen 3.7 7.2 0.51
escape gen 3.7 7.2 0.52
cgi gen 3.7 7.1 0.52
asdl_generated gen 3.7 7.0 0.52
cartesian gen 3.7 7.0 0.52
scoped_resource gen 3.8 7.2 0.52
loops gen 3.8 7.2 0.52
modules gen 3.8 7.2 0.53
length gen 3.8 7.2 0.53
fib_recursive gen 3.8 7.1 0.53
fib_iter gen 3.8 7.1 0.54
files gen 3.8 7.1 0.54
tuple_return_value gen 3.8 6.9 0.55
control_flow gen 3.9 7.1 0.56
containers gen 28.5 47.8 0.60
varargs gen 5.6 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
control_flow gen 0 8 0.000
fib_recursive gen 0 4 0.000
length gen 0 4 0.000
modules gen 0 4 0.000
parse gen 0 8 0.000
scoped_resource gen 0 8 0.000
tuple_return_value gen 0 4 0.000
escape gen 4 12 0.344
files gen 3 8 0.355
containers gen 8 23 0.362
cartesian gen 5 8 0.660
varargs gen 28 42 0.665
asdl_generated gen 4 4 0.956
cgi gen 4 0 inf
classes gen 0 0 NA
fib_iter gen 0 0 NA
gc_stack_roots gen 0 0 NA
loops gen 0 0 NA

raw benchmark files