I don't know how you're running it, but I suspect the complete list is:
- Your program with no changes and compiling with no optimizations. Initial time: 7m29.755s
It appears you didn't use optimization. Be sure to use
-O2
and try-fllvm
when compiling. New time: 1m2.412sUse explicit type signatures and use
Int
(vs the default ofInteger
) when you can. New time: 0m15.486s
So we received almost 8x speed-up by using optimizations (why does every other benchmark question not use optimization flags?!?!?) and an additional ~4x by using Int
instead of Integer
.