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 28 0.000
loops 0 297 0.000
fib_iter 8 891 0.009
modules 2 182 0.010
fib_recursive 11 880 0.012
asdl_generated 12 379 0.031
parse 24 756 0.032
containers 4 108 0.036
scoped_resource 43 1,030 0.041
tuple_return_value 19 224 0.086
files 7 72 0.102
length 45 206 0.216
cartesian 75 330 0.227
escape 101 362 0.279
cgi 249 507 0.490
varargs 12 16 0.764
control_flow 205 112 1.835

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
parse 3.8 7.6 0.50
scoped_resource 3.5 7.1 0.50
asdl_generated 3.5 6.9 0.51
cartesian 3.5 6.9 0.51
cgi 3.7 6.9 0.53
escape 3.7 6.9 0.53
fib_iter 3.7 6.9 0.53
length 3.7 6.9 0.53
modules 3.7 6.9 0.53
tuple_return_value 3.7 6.9 0.53
loops 3.8 7.1 0.54
fib_recursive 3.8 6.9 0.55
files 3.8 6.9 0.55
control_flow 3.9 6.9 0.57
containers 28.5 47.8 0.60
varargs 6.2 7.1 0.87

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
asdl_generated 0 4 0.000
fib_iter 0 8 0.000
fib_recursive 0 12 0.000
files 0 4 0.000
length 0 8 0.000
tuple_return_value 0 8 0.000
parse 4 12 0.336
containers 12 28 0.414
scoped_resource 4 8 0.484
cgi 4 8 0.494
classes 3 4 0.808
loops 4 4 0.917
varargs 53 56 0.946
control_flow 4 4 0.988
cartesian 12 0 inf
escape 4 0 inf
modules 0 0 NA

raw benchmark files