
Hello Peter, Friday, February 20, 2009, 6:34:04 PM, you wrote:
Well C# does it with a for loop in 2300ms, and when using a IEnumerable sequence it needs 19936ms. Very much like the Haskell code. But of course the Haskell code could optimize the sum I guess, I assume it is using the lazy version of sum by default.
the question is what is the natural for every language
Anyway it was more of a question. Does GHC perform register allocation (e.g. using graph colouring) and loop unrolling?
afaik, ghc can be compared with 20-years old C compilers. it uses registers for performing tight loops but has very simple register allocation procedure. also it doesn't unroll loops
On Fri, Feb 20, 2009 at 4:22 PM, Colin Paul Adams
wrote: "Peter" == Peter Verswyvelen
writes: Peter> So GHC is about 3 to 4 times slower as Visual C++ / GCC Peter> without loop unrolling, which is not too bad since GHC does Peter> not perform register optimization and loop unrolling yet Peter> no?
I would call it rather poor.
And I don't accept a since of that form as valid mitigation. -- Colin Adams Preston Lancashire
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com