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 893 0.008
modules gen 2 174 0.010
fib_recursive gen 11 878 0.013
loops gen 4 287 0.013
asdl_generated gen 7 380 0.019
parse gen 26 783 0.033
scoped_resource gen 47 1,073 0.044
tuple_return_value gen 12 193 0.063
containers gen 10 114 0.089
files gen 7 61 0.121
classes gen 3 27 0.121
length gen 41 204 0.200
escape gen 89 347 0.257
cartesian gen 86 334 0.258
cgi gen 268 522 0.514
varargs gen 20 24 0.819
control_flow gen 208 103 2.026
gc_stack_roots gen 2 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 7.1 0.48
parse gen 3.9 7.7 0.51
modules gen 3.5 6.9 0.51
files gen 3.7 7.1 0.52
scoped_resource gen 3.7 7.1 0.52
tuple_return_value gen 3.7 7.1 0.52
asdl_generated gen 3.7 6.9 0.53
cartesian gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
length gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
escape gen 3.8 6.9 0.55
fib_iter gen 3.8 6.8 0.56
fib_recursive gen 3.8 6.7 0.57
containers gen 28.5 47.8 0.60
varargs gen 5.4 6.9 0.77

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
classes gen 0 4 0.000
control_flow gen 0 12 0.000
fib_iter gen 0 4 0.000
fib_recursive gen 0 8 0.000
files gen 0 15 0.000
gc_stack_roots gen 0 12 0.000
loops gen 0 8 0.000
modules gen 0 8 0.000
scoped_resource gen 0 12 0.000
containers gen 5 20 0.250
parse gen 4 12 0.304
asdl_generated gen 4 4 0.906
varargs gen 48 49 0.983
cartesian gen 4 4 0.986
length gen 4 4 1.021
escape gen 16 8 2.036
tuple_return_value gen 8 0 inf
cgi gen 0 0 NA

raw benchmark files