Re: [Haskell-cafe] Re: newbie optimization question

2007-10-29 Thread Rodrigo Queiro
rem is faster because it has slightly different behaviour to mod, and there happens to be an intel instruction that maps more directly to rem than to mod, thus making it much faster on intel processors. Why do you expose perfect and divisors? Maybe if you just expose main, perfect and divisors

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-29 Thread Dusan Kolar
Hello all, just to compare the stuff, I get quite other results being on other OS. Thus, the result of C++ compiler may not be that interesting as I do not have the one presented below. My machine: Linux 2.6.23-ARCH #1 SMP PREEMPT Mon Oct 22 12:50:26 CEST 2007 x86_64 Intel(R) Core(TM)2 CPU

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-29 Thread Daniel Fischer
Am Montag, 29. Oktober 2007 13:49 schrieb Dusan Kolar: Hello all, just to compare the stuff, I get quite other results being on other OS. Thus, the result of C++ compiler may not be that interesting as I do not have the one presented below. Just to chime in, my results with the code below:

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-28 Thread Don Stewart
peter: Daniel Fischer wrote: What perpetually puzzles me is that in C long long int has very good performance, *much* faster than gmp, in Haskell, on my computer, Int64 is hardly faster than Integer. I tried the example with Int64 and Integer. The integer version was actually quicker

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-28 Thread Don Stewart
peter: Peter Hercek wrote: C++ version times: 1.125; 1.109; 1.125 Int32 cpu times: 3.203; 3.172; 3.172 Int64 cpu times: 11.734; 11.797; 11.844 Integer cpu times: 9.609; 9.609; 9.500 Ooops, my results ware wrong (nonoptimizing ms cl compiler used and I used -O instead of -O2 in ghc).

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-28 Thread Derek Elkins
On Sun, 2007-10-28 at 23:34 +0100, Peter Hercek wrote: Don Stewart wrote: C++ version times: 1.109; 1.125; 1.125 Int32 cpu times: 1.359; 1.359; 1.375 Int64 cpu times: 11.688; 11.719; 11.766 Integer cpu times: 9.719; 9.703; 9.703 Great result from ghc. What Haskell program were

Re: [Haskell-cafe] Re: newbie optimization question

2007-10-28 Thread Don Stewart
peter: Don Stewart wrote: C++ version times: 1.109; 1.125; 1.125 Int32 cpu times: 1.359; 1.359; 1.375 Int64 cpu times: 11.688; 11.719; 11.766 Integer cpu times: 9.719; 9.703; 9.703 Great result from ghc. What Haskell program were you using for this test? The original naive/high level