Hello Dinko,
Wednesday, November 29, 2006, 11:56:49 AM, you wrote:
>> How exactly can CSE cause space leaks, and what does this have to do
>> with strictness?
standard example is
x = [1..9] ++ [1..9]
comparing to
x = a++a where a=[1..9]
first version runs (without CSE transformation) in fixed
On Nov 28, 2006, at 10:34 AM, Dinko Tenev wrote:
How exactly can CSE cause space leaks, and what does this have to
do with strictness?
See this message for a nice example:
http://www.haskell.org/pipermail/haskell-cafe/2003-June/004484.html
/ Ulf
On 11/28/06, Mark T.B. Carroll <[EMAIL PROTECTED]> wrote:
"Dinko Tenev" <[EMAIL PROTECTED]> writes:
(snip)
> How exactly can CSE cause space leaks, and what does this have to do
> with strictness?
I puzzled over Lennart's comment too, and the theory I formed was that
you might have the same exp
The relation to strictness is that you have much tighter control over
when things are evaluated (typically) for something strict, so it is
less likely to leak.
Take the expression 'e + e' at some base type. It's harmless to CSE
this to 'let x = e in x+x' because + is strict in x. Whereas '(
On 11/28/06, Bertram Felgenhauer <[EMAIL PROTECTED]> wrote:
Dinko Tenev wrote:
> On 11/27/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote:
> >
> >GHC doesn't normally do CSE. CSE can cause space leaks, so you can't
> >do it willy-nilly.
> >I'm sure there are some strict contexts where it could
Dinko Tenev wrote:
> On 11/27/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote:
> >
> >GHC doesn't normally do CSE. CSE can cause space leaks, so you can't
> >do it willy-nilly.
> >I'm sure there are some strict contexts where it could be done
> >safely, but I don't think ghc uses that information
On 11/27/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote:
GHC doesn't normally do CSE. CSE can cause space leaks, so you can't
do it willy-nilly.
I'm sure there are some strict contexts where it could be done
safely, but I don't think ghc uses that information (yet).
-- Lennart
My
mber 2006 13:40
| To: Christian Maeder
| Cc: GHC Users Mailing List
| Subject: Re: Common subexpression elemination (CSE)
|
| GHC doesn't normally do CSE. CSE can cause space leaks, so you can't
| do it willy-nilly.
| I'm sure there are some strict contexts where it could be done
| safe
Lennart Augustsson schrieb:
> GHC doesn't normally do CSE. CSE can cause space leaks, so you can't do
> it willy-nilly.
> I'm sure there are some strict contexts where it could be done safely,
> but I don't think ghc uses that information (yet).
Interestingly, it can only be switched off by -fno-
GHC doesn't normally do CSE. CSE can cause space leaks, so you can't
do it willy-nilly.
I'm sure there are some strict contexts where it could be done
safely, but I don't think ghc uses that information (yet).
-- Lennart
On Nov 27, 2006, at 08:34 , Christian Maeder wrote:
the foll
the following code does not run as fast as expected:
modexp a e n = if e <= 0 then 1 else
if even e
then mod (modexp a (div e 2) n * modexp a (div e 2) n) n
else mod (a * modexp a (e - 1) n) n
it gets only fast if written as:
modexp2 a e n = if e <= 0 then 1 else
if even e
then le
11 matches
Mail list logo