Junior White | 4 Feb 10:15 2013
Picon

haskell build phase is very slow

Hi Cafe,
  I came from the C/C++ world, recently I play with a haskell editor named yi-editor, I find haskell build phase is very slow:
  1.Compile one .hs file is slow
  2. When change a little, it will recompile many many files

Compare to c, compile a c source file seems much quick then compile a haskell source file. And if i change a .c file, it only recompile the file i changed, and relink, it's awesome. How can i make my build phase more quick?

Thanks!




_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ben Doyle | 4 Feb 22:45 2013
Picon

Re: haskell build phase is very slow

yi is pretty heavy, as these things go. So it's not too surprising that it's taking a while.

GHC does try to recompile as little as possible...but "as little as possible" can be quite a lot. Inlining, and other optimizations GHC performs, makes the recompilation checker's job tricky; see [1]. Generally if you change a file you'll need to recompile its dependencies, and *their* dependencies, and so on.

If you're coding along and just need a typecheck, ghci is your friend. Specifically, the :reload command tends to be fast. (You'll need to :load yourFile.hs the first time, of course.)

You might also see if yi's  -fhacking flag is helpful. It looks like it might be relevant, though I don't know either yi or your use case well enough to say for sure.

General advice on speeding compilation is here: [2]. Most of it isn't all that relevant to you at the moment, since you're hacking on someone else's package. But always good to know.

Best of luck,

Ben

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Felipe Almeida Lessa | 4 Feb 22:55 2013
Picon

Re: haskell build phase is very slow

On Mon, Feb 4, 2013 at 7:45 PM, Ben Doyle
<benjamin.peter.doyle <at> gmail.com> wrote:
> General advice on speeding compilation is here: [2].

Its first advice should already be enough to give you something
usable.  Call cabal configure with the --disable-optimization flag and
see if it helps.

Cheers, =)

--
Felipe.

Gmane