4 ms·
pull request? I'm no Haskell expert (which apparently you need to be to get decent performance.)
by postfuturist 14y ago
pull request? I'm no Haskell expert (which apparently you need to be to get decent performance.)
- mej10 14y agoMy point is, I am not Haskell expert, but I know that linked lists aren't an efficient data structure for what we're doing. You didn't use lists in your other implementations, so it was just weird that you did for Haskell (originally, and then sort of again for life-array.hs). For your life-array.hs implementation, you replaced the Grid with an array, but not the "surroundings" with one, even though you used Vector for both in your SML implementation. Built with -O2 option: https://gist.github.com/3189306 https://gist.github.com/3189306 Sorry if I came off a bit assholish. People have been saying that you need to be a Haskell expert to get good performance forever, and in my experience this just isn't true. I will admit that there is clearly a problem with how things are introduced, as it is common that new Haskellers think they can use lists for every thing. I am sure part of the problem is that this is one of the few data structures available from the Prelude.
- postfuturist 14y agoNo sweat, thanks for the gist, I'll add it the repo. I'm impressed, actually, if it brings the runtime under a second, because only a couple languages managed that. The act of finding the correct strictness hints seems a bit like black magic.
- mej10 14y agoThats part of the nice thing about the code I sent you - no strictness hints.