
30 Sep
2012
30 Sep
'12
5:11 a.m.
Hi Darren, Am 30.09.2012 09:02 schrieb "Darren Grant"
This is exactly the kind of recursive function I was trying to set up with map, but didn't get the algorithm right. I expect the immutable Array must be much lighter weight than the immutable Map.
using an array as cache is the fastes approach. I implemented a C++ version using an array (~0.03s) which is orders of magnitude faster than the map version (~2.5s). I also tried a Haskell version with an unboxed, mutable Data.Vector using explict tail recursion, but this version was only 2 times faster than a lazy Data.Vector version (~0.4s). I would like to see a Haskell version which is in the same ballpark than the fastes C++ version, but still quite high level. Greetings, Daniel