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 896 0.009
modules gen 2 179 0.010
fib_recursive gen 11 892 0.012
loops gen 4 308 0.013
asdl_generated gen 11 370 0.029
parse gen 29 778 0.038
scoped_resource gen 43 1,041 0.041
containers gen 8 108 0.074
tuple_return_value gen 16 187 0.088
files gen 8 69 0.115
classes gen 3 22 0.146
length gen 40 203 0.199
gc_stack_roots gen 2 8 0.214
cartesian gen 75 319 0.234
escape gen 106 355 0.300
varargs gen 8 24 0.342
cgi gen 253 508 0.498
control_flow gen 208 105 1.983

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
scoped_resource gen 3.5 7.2 0.49
cgi gen 3.4 6.8 0.50
escape gen 3.5 7.1 0.50
gc_stack_roots gen 3.5 7.1 0.50
parse gen 3.8 7.6 0.50
asdl_generated gen 3.5 6.9 0.51
cartesian gen 3.5 6.9 0.51
control_flow gen 3.8 7.1 0.54
fib_iter gen 3.8 7.1 0.54
loops gen 3.8 7.1 0.54
files gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
tuple_return_value gen 3.8 6.9 0.55
fib_recursive gen 3.8 6.8 0.56
length gen 3.9 6.9 0.57
containers gen 28.5 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 8 0.000
cgi gen 0 4 0.000
classes gen 0 9 0.000
control_flow gen 0 8 0.000
fib_iter gen 0 8 0.000
fib_recursive gen 0 4 0.000
files gen 0 8 0.000
gc_stack_roots gen 0 4 0.000
loops gen 0 8 0.000
modules gen 0 8 0.000
parse gen 0 12 0.000
containers gen 8 28 0.284
tuple_return_value gen 4 8 0.504
length gen 4 8 0.508
scoped_resource gen 4 8 0.541
varargs gen 58 48 1.198
cartesian gen 16 8 1.969
escape gen 0 0 NA

raw benchmark files