Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-29 Thread Roman Leshchinskiy
On 29/03/2010, at 02:27, Lennart Augustsson wrote: Does anything change if you swap the first two rhss? No, not as far as I can tell. On Sun, Mar 28, 2010 at 1:28 AM, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: On 28/03/2010, at 09:47, Lennart Augustsson wrote: It's important to

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-28 Thread Lennart Augustsson
Does anything change if you swap the first two rhss? On Sun, Mar 28, 2010 at 1:28 AM, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: On 28/03/2010, at 09:47, Lennart Augustsson wrote: It's important to switch from mod to rem.  This can be done by a simple abstract interpretation. Also,

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Neil Mitchell
Hi John, Any chance of seeing the benchmark? You're not the only one with an optimising compiler tucked away somewhere :-) I have one benchmark where I outperform GHC by 21 times, although saying it's artificial is a bit of an understatement... Thanks, Neil On Fri, Mar 26, 2010 at 6:27 PM,

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Jason Dagit
On Sat, Mar 27, 2010 at 3:25 AM, Neil Mitchell ndmitch...@gmail.com wrote: Hi John, Any chance of seeing the benchmark? You're not the only one with an optimising compiler tucked away somewhere :-) Neil, for some reason John's reply didn't thread with the rest of the thread. Probably

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Rafael Cunha de Almeida
John Meacham wrote: Here are jhc's timings for the same programs on my machine. gcc and ghc both used -O3 and jhc had its full standard optimizations turned on. jhc: ./hs.out 5.12s user 0.07s system 96% cpu 5.380 total gcc: ./a.out 5.58s user 0.00s system 97% cpu 5.710 total ghc:

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Lennart Augustsson
It's important to switch from mod to rem. This can be done by a simple abstract interpretation. I'm nore sure if it's jhc or gcc that does this for jhc. -- Lennart On Sat, Mar 27, 2010 at 10:30 PM, Rafael Cunha de Almeida almeida...@gmail.com wrote: John Meacham wrote: Here are jhc's

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Rafael Cunha de Almeida
Lennart Augustsson wrote: It's important to switch from mod to rem. This can be done by a simple abstract interpretation. I'm nore sure if it's jhc or gcc that does this for jhc. It's not just adding rem. Ghc still runs much slower using rem. It's only when switching to -fvia-C and using

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread John Meacham
On Sat, Mar 27, 2010 at 07:30:30PM -0300, Rafael Cunha de Almeida wrote: John Meacham wrote: Here are jhc's timings for the same programs on my machine. gcc and ghc both used -O3 and jhc had its full standard optimizations turned on. jhc: ./hs.out 5.12s user 0.07s system 96% cpu 5.380

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Roman Leshchinskiy
On 27/03/2010, at 05:27, John Meacham wrote: Here are jhc's timings for the same programs on my machine. gcc and ghc both used -O3 and jhc had its full standard optimizations turned on. jhc: ./hs.out 5.12s user 0.07s system 96% cpu 5.380 total gcc: ./a.out 5.58s user 0.00s system 97%

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Roman Leshchinskiy
On 28/03/2010, at 11:07, John Meacham wrote: I have not thoroughly checked it, but I think there are a couple things going on here: It could also be worthwhile to float out (i*i + j*j) in rangeK instead of computing it in every loop iteration. Neither ghc nor gcc can do this; if jhc can then

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-27 Thread Roman Leshchinskiy
On 28/03/2010, at 09:47, Lennart Augustsson wrote: It's important to switch from mod to rem. This can be done by a simple abstract interpretation. Also, changing the definition of rem from a `rem` b | b == 0 = divZeroError | a == minBound b == (-1) =

Re: [Haskell-cafe] GHC vs GCC vs JHC

2010-03-26 Thread John Meacham
Here are jhc's timings for the same programs on my machine. gcc and ghc both used -O3 and jhc had its full standard optimizations turned on. jhc: ./hs.out 5.12s user 0.07s system 96% cpu 5.380 total gcc: ./a.out 5.58s user 0.00s system 97% cpu 5.710 total ghc: ./try 31.11s user 0.00s system