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 gen C++ Python C++ : Python
gc_stack_roots gen 0 4 0.000
fib_iter gen 4 886 0.004
modules gen 2 178 0.011
fib_recursive gen 11 871 0.012
loops gen 4 300 0.012
asdl_generated gen 7 380 0.019
parse gen 25 776 0.033
containers gen 4 114 0.034
scoped_resource gen 48 1,102 0.043
tuple_return_value gen 17 185 0.093
files gen 8 61 0.123
classes gen 3 24 0.131
length gen 37 204 0.180
cartesian gen 83 338 0.245
escape gen 103 348 0.296
cgi gen 269 526 0.511
varargs gen 21 16 1.285
control_flow gen 200 108 1.852

Max Resident Set Size (MB)

Lower ratios are better. We use MB (powers of 10), not MiB (powers of 2).

example name gen C++ Python C++ : Python
classes gen 4.5 10.7 0.41
parse gen 3.8 7.7 0.49
fib_recursive gen 3.5 7.1 0.50
cartesian gen 3.5 6.9 0.51
escape gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
fib_iter gen 3.7 7.1 0.52
asdl_generated gen 3.7 6.9 0.53
cgi gen 3.7 6.9 0.53
scoped_resource gen 3.7 6.9 0.53
tuple_return_value gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
control_flow gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
modules gen 3.8 6.9 0.55
containers gen 28.6 48.0 0.60
varargs gen 5.5 7.1 0.78

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
cgi gen 0 4 0.000
classes gen 0 8 0.000
fib_recursive gen 0 12 0.000
files gen 0 15 0.000
loops gen 0 12 0.000
modules gen 0 8 0.000
scoped_resource gen 0 4 0.000
gc_stack_roots gen 2 8 0.216
fib_iter gen 4 12 0.320
tuple_return_value gen 3 8 0.427
asdl_generated gen 4 8 0.455
containers gen 12 24 0.498
parse gen 4 8 0.527
varargs gen 46 57 0.808
control_flow gen 8 8 0.980
escape gen 4 4 0.991
cartesian gen 8 4 1.958
length gen 8 4 2.041

raw benchmark files