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 C++ Python C++ : Python
classes 0 24 0.000
loops 0 287 0.000
fib_iter 8 905 0.008
modules 2 183 0.010
fib_recursive 11 874 0.013
asdl_generated 11 381 0.029
parse 29 772 0.038
scoped_resource 47 1,022 0.046
containers 8 119 0.067
tuple_return_value 20 190 0.106
files 8 69 0.110
length 38 207 0.183
cartesian 86 339 0.254
escape 95 344 0.275
cgi 266 511 0.521
varargs 27 24 1.124
control_flow 208 102 2.037

Max Resident Set Size (MB)

Lower ratios are better. We use MB (powers of 10), not MiB (powers of 2).

example name C++ Python C++ : Python
classes 4.5 10.7 0.42
parse 3.8 7.6 0.50
fib_recursive 3.5 6.9 0.51
scoped_resource 3.7 7.1 0.52
cartesian 3.7 6.9 0.53
cgi 3.7 6.9 0.53
escape 3.7 6.9 0.53
loops 3.8 7.1 0.54
tuple_return_value 3.8 7.1 0.54
asdl_generated 3.7 6.8 0.54
files 3.8 6.9 0.55
length 3.8 6.9 0.55
modules 3.8 6.9 0.55
fib_iter 3.8 6.8 0.56
control_flow 3.9 6.9 0.57
containers 28.6 47.7 0.60
varargs 5.5 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
asdl_generated 0 4 0.000
cgi 0 12 0.000
control_flow 0 12 0.000
fib_iter 0 8 0.000
fib_recursive 0 8 0.000
files 0 8 0.000
modules 0 8 0.000
parse 0 4 0.000
scoped_resource 0 8 0.000
tuple_return_value 0 8 0.000
loops 4 12 0.312
containers 8 20 0.404
classes 3 8 0.413
varargs 39 49 0.803
cartesian 4 4 1.028
escape 12 12 1.030
length 8 4 1.868

raw benchmark files