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 898 0.004
asdl_generated 4 378 0.010
modules 2 186 0.010
fib_recursive 11 879 0.013
loops 4 293 0.013
parse 27 760 0.035
scoped_resource 40 1,071 0.037
tuple_return_value 10 189 0.054
files 8 66 0.117
classes 3 25 0.132
containers 16 86 0.189
length 41 202 0.204
cartesian 67 322 0.208
escape 103 348 0.294
cgi 252 507 0.496
varargs 16 12 1.300
control_flow 209 116 1.796

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.6 10.7 0.43
cgi 3.5 7.1 0.50
parse 3.8 7.6 0.50
cartesian 3.5 6.9 0.51
tuple_return_value 3.5 6.9 0.51
length 3.7 7.1 0.52
loops 3.7 7.1 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
control_flow 3.8 6.9 0.55
fib_iter 3.8 6.9 0.55
files 3.8 6.9 0.55
modules 3.8 6.9 0.55
fib_recursive 3.8 6.8 0.56
containers 28.7 47.8 0.60
varargs 5.6 6.8 0.83

System Time (milliseconds)

Lower ratios are better.

example name C++ Python C++ : Python
classes 0 8 0.000
containers 0 53 0.000
control_flow 0 4 0.000
fib_recursive 0 12 0.000
files 0 12 0.000
loops 0 8 0.000
modules 0 8 0.000
parse 4 16 0.240
length 4 12 0.347
cgi 4 8 0.500
varargs 51 60 0.845
escape 4 4 0.985
scoped_resource 8 8 0.995
asdl_generated 7 4 1.795
cartesian 24 12 1.977
tuple_return_value 10 4 2.529
fib_iter 4 0 inf

raw benchmark files