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
fib_recursive 7 887 0.008
fib_iter 8 891 0.009
modules 2 178 0.010
loops 4 296 0.012
asdl_generated 7 380 0.019
parse 26 763 0.034
scoped_resource 43 1,061 0.040
tuple_return_value 20 204 0.099
containers 12 118 0.103
files 8 69 0.112
classes 3 19 0.167
length 36 209 0.173
cartesian 82 334 0.246
escape 104 351 0.295
cgi 265 514 0.516
varargs 27 17 1.639
control_flow 200 118 1.698

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.41
cartesian 3.5 7.1 0.50
fib_iter 3.5 7.1 0.50
parse 3.8 7.6 0.50
length 3.7 7.1 0.52
cgi 3.5 6.8 0.52
asdl_generated 3.7 6.9 0.53
escape 3.7 6.9 0.53
scoped_resource 3.7 6.9 0.53
tuple_return_value 3.7 6.9 0.53
files 3.8 7.1 0.54
loops 3.8 7.1 0.54
fib_recursive 3.8 6.9 0.55
modules 3.8 6.9 0.55
control_flow 3.8 6.8 0.56
containers 28.7 47.7 0.60
varargs 5.6 7.1 0.80

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
classes 0 12 0.000
fib_iter 0 8 0.000
files 0 8 0.000
loops 0 4 0.000
modules 0 4 0.000
tuple_return_value 0 4 0.000
containers 4 16 0.248
escape 4 8 0.493
parse 4 8 0.538
varargs 39 54 0.721
fib_recursive 4 4 0.892
asdl_generated 4 4 0.899
cgi 4 4 0.987
scoped_resource 4 4 1.066
cartesian 8 4 1.970
length 8 4 2.004
control_flow 8 0 inf

raw benchmark files