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_iter 4 892 0.004
fib_recursive 7 891 0.008
modules 2 178 0.010
loops 4 342 0.011
asdl_generated 11 376 0.029
scoped_resource 35 1,026 0.034
parse 30 763 0.039
containers 8 126 0.061
tuple_return_value 16 189 0.086
files 7 64 0.117
classes 3 24 0.132
length 41 207 0.198
cartesian 91 326 0.279
escape 102 353 0.289
cgi 256 506 0.505
varargs 12 16 0.739
control_flow 208 112 1.856

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.6 0.42
fib_recursive 3.4 6.9 0.49
fib_iter 3.5 7.1 0.50
parse 3.8 7.5 0.51
loops 3.7 7.1 0.52
scoped_resource 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
escape 3.7 6.9 0.53
length 3.7 6.9 0.53
modules 3.8 7.1 0.54
control_flow 3.8 6.9 0.55
files 3.8 6.9 0.55
tuple_return_value 3.8 6.9 0.55
containers 28.7 47.8 0.60
varargs 5.5 6.9 0.79

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
asdl_generated 0 4 0.000
cartesian 0 8 0.000
cgi 0 4 0.000
classes 0 8 0.000
files 0 12 0.000
modules 0 4 0.000
parse 0 8 0.000
fib_recursive 4 8 0.450
containers 8 8 0.977
escape 4 4 0.980
varargs 55 56 0.985
control_flow 4 4 0.999
tuple_return_value 4 4 1.006
scoped_resource 12 8 1.457
fib_iter 4 0 inf
length 4 0 inf
loops 0 0 NA

raw benchmark files