Re: Where do I start if I would like help improve GHC compilation times?

2017-04-18 Thread Johannes Waldmann
> it would be quite helpful if `pretty` > gained a special-case for the infinite band-width case Absolutely +1 this. Not "pretty" but similar: https://github.com/jwaldmann/wl-pprint-text/commit/7843d96db57ab01c0be336a5be0d7bca61902005 - J.W. ___

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-18 Thread Alfredo Di Napoli
Hey Ben, thanks for that. I didn’t realise I opened pretty much the Pandora’s box, hehe. I have now found (whilst reading Bartosz’s notes) the numerous tickets & discussions around the library, but what you say in this email neatly summarise the crux of the problem, as far as I could see. Rather

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-18 Thread Bartosz Nitka
Hey Alfredo, Thanks for taking a look at this. I've taken a look at this before and collected some notes here: https://github.com/niteria/notes/blob/master/PrettyPrintingGHC.md#problems Based on my investigations I concluded that there are places where pretty-printing Asm and Cmm gets

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-18 Thread Alfredo Di Napoli
Hey Simon, thanks for chiming in. I had the same suspect as well, and in fact my first temptation was to use dlists to avoid costly concatenation (I guess a Builder shares pretty much the same idea, which is avoid right-appends). I eventually bailed out as that Pretty module had some functions

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-18 Thread Simon Marlow
Pretty-printing the asm is a likely contender for optimisation, however the problem is not the pretty-printing per se. We don't actually use any of the backtracking stuff when printing asm, since there's no point nicely indenting things or wrapping lines. The overhead is probably all in the

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-17 Thread Alfredo Di Napoli
Dear all, after sprinkling (ehm, littering) GHC source code with cost centres, I was not surprised to see that roughly 20% of the compilation time (as in .prof) was spent in the core gen/simplification process (10% of the total time) and on the asm code gen (another 10%). I have almost

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-10 Thread Alfredo Di Napoli
Hey all, thanks a ton for the invaluable pointers. I’m now in the “I-dunno-what-I-am-doing” mode banging SCC annotations like there is no tomorrow, trying to spot any chance for some low-hanging-fruit algorithmic improvement (like using a sequence instead of a list, etc), and will come back to

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-09 Thread Niklas Hambüchen
I have some suggestions for low hanging fruits in this effort. 1. Make ghc print more statistics on what it spending time on When I did the linking investigation recently (https://www.reddit.com/r/haskell/comments/63y43y/liked_linking_3x_faster_with_gold_link_10x_faster/) I noticed (with strace)

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-09 Thread David Feuer
s.org> Cc: ghc-devs@haskell.org Subject: Re: Where do I start if I would like help improve GHC compilation times? Hey Ben, as promised I’m back to you with something more articulated and hopefully meaningful. I do hear you perfectly — probably trying to dive head-first into this without at l

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-09 Thread Reid Barton
Building modules from GHC itself is a little tricky and DynFlags is extra tricky since it is involved in import cycles. Here is what I do: * Copy DynFlags.hs somewhere outside the tree (for your present purposes, it is no longer part of the compiler, but just some module to be provided as input).

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-09 Thread Alfredo Di Napoli
Hey Ben, as promised I’m back to you with something more articulated and hopefully meaningful. I do hear you perfectly — probably trying to dive head-first into this without at least a rough understanding of the performance hotspots or the GHC overall architecture is going to do me more harm than

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-07 Thread Alfredo Di Napoli
Hey Ben, thanks for the quite exhaustive reply! I’m on the go right now, but I promise to get back to you with a meaningful reply later this weekend ;) Alfredo On 7 April 2017 at 18:22, Ben Gamari wrote: > Alfredo Di Napoli writes: > > > Hey

Re: Where do I start if I would like help improve GHC compilation times?

2017-04-07 Thread Ben Gamari
Alfredo Di Napoli writes: > Hey folks, > Hi Alfredo! First, thanks for writing. More eyes looking at GHC's compiler performance is badly needed. > maybe I’m setting up for something too ambitious for me, but I would like > to take an active stance to the overlasting

Where do I start if I would like help improve GHC compilation times?

2017-04-07 Thread Alfredo Di Napoli
Hey folks, maybe I’m setting up for something too ambitious for me, but I would like to take an active stance to the overlasting “GHC compilation times are terrible” matter, instead of simply stare at the screen with despair whenever GHC compiles a sufficiently large Haskell program ;) To make