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 935 0.008
fib_iter 8 895 0.009
modules 2 184 0.010
loops 4 299 0.013
asdl_generated 5 385 0.014
parse 26 858 0.030
scoped_resource 39 1,028 0.038
containers 8 118 0.068
tuple_return_value 16 186 0.087
files 8 66 0.116
classes 4 19 0.189
length 41 194 0.213
cartesian 80 352 0.227
escape 98 349 0.282
cgi 267 503 0.531
varargs 24 24 1.005
control_flow 208 107 1.939

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.3 10.7 0.40
escape 3.5 7.1 0.50
fib_iter 3.5 6.9 0.51
modules 3.5 6.9 0.51
parse 3.9 7.6 0.52
loops 3.7 7.1 0.52
asdl_generated 3.7 6.9 0.53
cartesian 3.7 6.9 0.53
cgi 3.7 6.9 0.53
scoped_resource 3.7 6.9 0.53
fib_recursive 3.8 6.9 0.55
files 3.8 6.9 0.55
length 3.8 6.9 0.55
tuple_return_value 3.8 6.9 0.55
control_flow 3.9 6.9 0.57
containers 28.5 47.6 0.60
varargs 5.5 6.9 0.79

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
classes 0 12 0.000
control_flow 0 8 0.000
fib_iter 0 4 0.000
files 0 12 0.000
loops 0 4 0.000
modules 0 8 0.000
length 4 12 0.316
containers 8 24 0.328
cgi 4 8 0.499
tuple_return_value 4 8 0.512
varargs 43 51 0.851
fib_recursive 4 4 0.908
parse 4 4 0.933
scoped_resource 8 8 0.975
escape 8 4 1.960
cartesian 12 4 2.996
asdl_generated 5 0 inf

raw benchmark files