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
classes gen 0 22 0.000
fib_iter gen 8 891 0.009
modules gen 2 173 0.010
fib_recursive gen 11 885 0.012
loops gen 4 291 0.013
asdl_generated gen 11 373 0.029
parse gen 25 763 0.032
scoped_resource gen 44 1,033 0.042
containers gen 8 119 0.066
tuple_return_value gen 20 189 0.108
files gen 8 68 0.110
length gen 24 203 0.120
gc_stack_roots gen 2 8 0.224
cartesian gen 85 323 0.264
escape gen 98 347 0.284
varargs gen 8 16 0.488
cgi gen 254 507 0.500
control_flow gen 209 114 1.829

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
parse gen 3.7 7.6 0.48
scoped_resource gen 3.5 7.1 0.50
cartesian gen 3.5 6.9 0.51
escape gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
asdl_generated gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
fib_iter gen 3.7 6.9 0.53
files gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
length gen 3.8 7.1 0.54
loops gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
control_flow gen 3.9 6.9 0.57
fib_recursive gen 3.9 6.9 0.57
containers gen 28.5 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
asdl_generated gen 0 4 0.000
cgi gen 0 8 0.000
control_flow gen 0 4 0.000
fib_iter gen 0 4 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
tuple_return_value gen 0 4 0.000
parse gen 4 16 0.258
classes gen 3 9 0.384
containers gen 8 16 0.482
cartesian gen 4 8 0.510
escape gen 8 8 0.988
scoped_resource gen 4 4 0.989
varargs gen 58 56 1.045
length gen 20 8 2.549

raw benchmark files