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
gc_stack_roots gen 0 3 0.000
modules gen 0 180 0.000
fib_iter gen 4 923 0.004
fib_recursive gen 11 880 0.013
loops gen 4 302 0.013
parse gen 26 766 0.034
asdl_generated gen 14 369 0.037
scoped_resource gen 45 1,051 0.043
containers gen 8 102 0.082
files gen 8 73 0.111
tuple_return_value gen 23 187 0.124
classes gen 3 24 0.139
length gen 40 205 0.197
cartesian gen 87 330 0.264
escape gen 107 359 0.297
varargs gen 8 24 0.343
cgi gen 246 512 0.480
control_flow gen 212 113 1.873

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.5 7.1 0.50
parse gen 3.8 7.6 0.50
cartesian gen 3.5 6.9 0.51
cgi gen 3.5 6.9 0.51
modules gen 3.5 6.9 0.51
tuple_return_value gen 3.7 7.1 0.52
asdl_generated gen 3.7 6.9 0.53
scoped_resource gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
escape gen 3.8 6.9 0.55
fib_iter gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
fib_recursive gen 3.8 6.8 0.56
control_flow gen 3.9 6.9 0.57
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
classes gen 0 8 0.000
control_flow gen 0 4 0.000
escape gen 0 8 0.000
fib_recursive gen 0 4 0.000
files gen 0 4 0.000
tuple_return_value gen 0 8 0.000
gc_stack_roots gen 2 10 0.188
containers gen 8 39 0.214
asdl_generated gen 3 12 0.290
scoped_resource gen 4 12 0.343
parse gen 4 8 0.471
cartesian gen 4 8 0.497
modules gen 2 4 0.533
length gen 4 4 1.006
varargs gen 59 49 1.200
cgi gen 8 4 1.983
fib_iter gen 4 0 inf
loops gen 0 0 NA

raw benchmark files