Evolving Faster Haskell Programs (now with LLVM)
donsbot.wordpress.com
donsbot.wordpress.com
"Computing fitness
The programs we want to improve have to report their fitness. To do this I’ll use criterion’s timing function, wrapping up the code we actually want to optimize in some measurement functions. This will just report total wall clock running time for the code under analysis."
They only care about speed. And if code size turns out to have an impact on speed, it won't be ignored by this metric.
Just solve
argmin running_time(prog) + alpha * code_size(prog)
instead of argmin running_time(prog)
Here, alpha is a parameter representing how much you care about code size. I.e., if alpha = 1 sec / 1mb, then you will accept code which is 0.99 seconds slower if it shaves 1mb off the code size, but not code which is 1.01 seconds slower.