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
classes gen 0 33 0.000
fib_iter gen 8 891 0.009
modules gen 2 174 0.010
fib_recursive gen 11 884 0.012
loops gen 4 292 0.013
asdl_generated gen 11 377 0.029
parse gen 29 767 0.038
scoped_resource gen 47 1,038 0.045
files gen 4 73 0.051
tuple_return_value gen 20 193 0.104
containers gen 10 98 0.105
gc_stack_roots gen 2 12 0.146
length gen 44 212 0.209
cartesian gen 85 324 0.262
escape gen 98 350 0.278
cgi gen 262 510 0.514
varargs gen 31 28 1.110
control_flow gen 207 105 1.973

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
fib_recursive gen 3.4 7.1 0.48
asdl_generated gen 3.5 6.9 0.51
cgi gen 3.5 6.9 0.51
gc_stack_roots gen 3.5 6.9 0.51
parse gen 3.9 7.6 0.52
escape gen 3.7 7.1 0.52
modules gen 3.7 7.1 0.52
cartesian gen 3.7 6.9 0.53
control_flow gen 3.7 6.9 0.53
loops gen 3.8 7.1 0.54
fib_iter gen 3.8 6.9 0.55
files gen 3.8 6.9 0.55
length gen 3.8 6.9 0.55
scoped_resource gen 3.8 6.9 0.55
tuple_return_value gen 3.8 6.8 0.56
containers gen 28.5 47.8 0.60
varargs gen 5.5 6.9 0.79

System Time (milliseconds)

Lower ratios are better.

example name gen C++ Python C++ : Python
asdl_generated gen 0 4 0.000
fib_iter gen 0 4 0.000
fib_recursive gen 0 4 0.000
loops gen 0 4 0.000
modules gen 0 8 0.000
parse gen 0 16 0.000
scoped_resource gen 0 4 0.000
tuple_return_value gen 0 4 0.000
containers gen 5 39 0.131
control_flow gen 4 8 0.493
varargs gen 35 44 0.795
files gen 4 4 0.923
cgi gen 8 8 0.989
cartesian gen 8 4 2.022
escape gen 8 4 2.042
classes gen 3 0 inf
gc_stack_roots gen 0 0 NA
length gen 0 0 NA

raw benchmark files