GHCi always optimizes?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

GHCi always optimizes?

Kolář Dušan
Hello all,

  My question is rather strange, maybe, even if simple:
Does ghci always translates with "-O" option set on?

  I've done some measurements on an application
using ghc and ghci.

ghc compiled with no opmitization => program running
real    988m59.260s
user    989m1.325s
sys     0m0.704s

ghc compiled with optimization set on => program running
real    15m54.343s
user    15m54.168s
sys     0m0.172s


ghci alaways:
951.97 secs, 7445117252 bytes (which is 15m51.97sec)

  To be honest, I don't mind ghci optimizes always
but saying it uses the same options as ghc is not
entirely true and, for optimization, it's quite painful
because one searches error where it is not. (/Understand,
I was wondering why program compiled by ghc crashes
and/or evaluates so long while running correctly
and fast in ghci./)


  Dusan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: GHCi always optimizes?

Tomasz Zielonka
On Tue, Nov 22, 2005 at 11:07:07AM +0100, Dusan Kolar wrote:
> To be honest, I don't mind ghci optimizes always
> but saying it uses the same options as ghc is not
> entirely true and, for optimization, it's quite painful
> because one searches error where it is not.

I think the real source of your problem is that GHCi will load a
compiled .o file if it's up to date wrt.  the source files. When you
load modules, watch the messages printed by GHCi. "Skipping" means
loading the .o file, "Compiling" means that the module will be compiled
and interpreted by GHCi.

Anyway, it's strange that you are experiencing crashes.  IIRC, there
were problems if you mixed modules compiled with different levels of
optimisation in the same program, but I am not sure it still happens.

Best regards
Tomasz
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: GHCi always optimizes?

Simon Peyton Jones
In reply to this post by Kolář Dušan

| Anyway, it's strange that you are experiencing crashes.  IIRC, there
| were problems if you mixed modules compiled with different levels of
| optimisation in the same program, but I am not sure it still happens.

If you can make a reproducible crash, please tar it up and send it to
us.  It shouldn't happen. Ever.

Simon
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: GHCi always optimizes?

Tomasz Zielonka
On Wed, Nov 23, 2005 at 08:48:04AM -0000, Simon Peyton-Jones wrote:
> | Anyway, it's strange that you are experiencing crashes.  IIRC, there
> | were problems if you mixed modules compiled with different levels of
> | optimisation in the same program, but I am not sure it still happens.
>
> If you can make a reproducible crash, please tar it up and send it to
> us.  It shouldn't happen. Ever.

I am not sure who you are replying to - me or Dusan. If you can't
remember such a problem, then it is only my memory playing tricks ;-)

Best regards
Tomasz
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: GHCi always optimizes?

Simon Marlow
In reply to this post by Kolář Dušan
On 22 November 2005 10:07, Dusan Kolar wrote:

>   My question is rather strange, maybe, even if simple:
> Does ghci always translates with "-O" option set on?

I didn't see anyone answer this specific question: the answer is "no",
GHCi does not optimise.  Optimisation cannot be used when interpreting,
except that you're allowed to load in compiled optimised modules.

Cheers,
        Simon
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe