haskell-cafe@haskell.org
[Top] [All Lists]

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

Subject: Re: [Haskell-cafe] GHC vs GCC vs JHC
From: Lennart Augustsson
Date: Sun, 28 Mar 2010 15:27:24 +0000
Does anything change if you swap the first two rhss?

On Sun, Mar 28, 2010 at 1:28 AM, Roman Leshchinskiy <rl@xxxxxxxxxxxxxxx> 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, changing the definition of rem from
>
>    a `rem` b
>     | b == 0                     = divZeroError
>     | a == minBound && b == (-1) = overflowError
>     | otherwise                  =  a `remInt` b
>
> to
>
>    a `rem` b
>     | b == 0                     = divZeroError
>     | b == (-1) && a == minBound = overflowError
>     | otherwise                  =  a `remInt` b
>
> speeds up the GHC version by about 20%. Figuring out why is left as an 
> exercise to the reader :-)
>
> Roman
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@xxxxxxxxxxx
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>