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 183 0.000
fib_recursive gen 7 880 0.008
fib_iter gen 8 884 0.008
loops gen 4 297 0.013
asdl_generated gen 5 395 0.014
parse gen 29 773 0.038
scoped_resource gen 43 1,032 0.041
tuple_return_value gen 20 187 0.107
files gen 8 69 0.111
containers gen 14 107 0.127
classes gen 3 24 0.137
length gen 43 199 0.214
gc_stack_roots gen 2 8 0.219
cartesian gen 88 318 0.276
escape gen 102 361 0.281
cgi gen 261 508 0.514
varargs gen 20 15 1.285
control_flow gen 207 111 1.861

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
gc_stack_roots gen 3.4 6.9 0.49
cartesian gen 3.5 7.1 0.50
cgi gen 3.5 7.1 0.50
parse gen 3.8 7.6 0.50
asdl_generated gen 3.5 6.9 0.51
escape gen 3.5 6.9 0.51
loops gen 3.7 7.1 0.52
scoped_resource gen 3.7 7.1 0.52
fib_recursive gen 3.7 6.9 0.53
files gen 3.8 7.1 0.54
tuple_return_value gen 3.8 7.1 0.54
length gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
fib_iter gen 3.7 6.7 0.55
control_flow gen 3.9 6.9 0.57
containers gen 28.7 47.8 0.60
varargs gen 5.5 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
classes gen 0 8 0.000
fib_iter gen 0 8 0.000
files gen 0 8 0.000
gc_stack_roots gen 0 4 0.000
loops gen 0 8 0.000
parse gen 0 8 0.000
tuple_return_value gen 0 8 0.000
containers gen 3 32 0.107
modules gen 2 8 0.221
length gen 4 12 0.324
fib_recursive gen 4 8 0.451
scoped_resource gen 4 8 0.486
cartesian gen 4 8 0.503
asdl_generated gen 5 8 0.678
varargs gen 47 57 0.822
control_flow gen 4 4 1.002
cgi gen 8 4 1.978
escape gen 4 0 inf

raw benchmark files