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
loops gen 0 288 0.000
fib_iter gen 8 901 0.008
modules gen 2 179 0.010
fib_recursive gen 11 935 0.011
asdl_generated gen 11 369 0.029
containers gen 4 122 0.032
parse gen 30 770 0.039
scoped_resource gen 47 1,042 0.046
tuple_return_value gen 20 192 0.105
files gen 7 67 0.110
classes gen 3 23 0.137
length gen 45 200 0.223
cartesian gen 79 329 0.241
escape gen 102 347 0.295
gc_stack_roots gen 2 4 0.443
cgi gen 260 503 0.517
varargs gen 12 16 0.735
control_flow gen 200 109 1.832

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.6 0.42
gc_stack_roots gen 3.4 7.1 0.48
parse gen 3.8 7.6 0.50
loops gen 3.7 7.2 0.51
cartesian gen 3.5 6.9 0.51
modules 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
cgi gen 3.7 6.9 0.53
escape gen 3.7 6.9 0.53
fib_recursive gen 3.7 6.9 0.53
files gen 3.7 6.9 0.53
length gen 3.8 7.1 0.54
scoped_resource gen 3.8 7.1 0.54
control_flow gen 3.7 6.8 0.54
fib_iter gen 3.8 6.9 0.55
containers gen 28.6 47.7 0.60
varargs gen 5.5 6.9 0.79

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
asdl_generated gen 0 12 0.000
classes gen 0 8 0.000
fib_iter gen 0 4 0.000
fib_recursive gen 0 8 0.000
files gen 0 8 0.000
gc_stack_roots gen 0 8 0.000
length gen 0 4 0.000
modules gen 0 4 0.000
parse gen 0 4 0.000
scoped_resource gen 0 4 0.000
loops gen 4 8 0.452
cgi gen 8 12 0.658
containers gen 12 12 0.952
escape gen 4 4 0.976
varargs gen 54 55 0.980
cartesian gen 12 8 1.484
control_flow gen 8 4 1.940
tuple_return_value gen 0 0 NA

raw benchmark files