Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
ng >> >> problem, the one I am sure about. >> >> >> >> -harendra >> >> >> >> On 8 September 2017 at 18:35, Simon Peyton Jones < >> simo...@microsoft.com> >> >> wrote: >> >>> >> >>> I k

Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
t; >> On 8 September 2017 at 18:35, Simon Peyton Jones < >> simo...@microsoft.com> >> >> wrote: >> >>> >> >>> I know that this is not an easy request, but can either of you >> produce a >> >>> small example that demonst

Re: Performance degradation when factoring out common code

2017-09-09 Thread Harendra Kumar
n’t like hearing about people having to use trial and error with > >>> INLINE or SPECIALISE pragmas. But I can’t even begin to solve the > problem > >>> unless I can reproduce it. > >>> > >>> > >>> > >>> Simon > >>

Re: Performance degradation when factoring out common code

2017-09-09 Thread Matthew Pickering
>>> >>> >>> I don’t like hearing about people having to use trial and error with >>> INLINE or SPECIALISE pragmas. But I can’t even begin to solve the problem >>> unless I can reproduce it. >>> >>> >>> >>> Simon &g

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
t;> Simon >> >> >> >> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of >> *Harendra >> Kumar >> *Sent:* 08 September 2017 13:50 >> *To:* Mikolaj Konarski >> *Cc:* ghc-devs@haskell.org >> *Subject:* Re: Performance degr

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
rom:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Harendra > Kumar > *Sent:* 08 September 2017 13:50 > *To:* Mikolaj Konarski > *Cc:* ghc-devs@haskell.org > *Subject:* Re: Performance degradation when factoring out common code > > > > I should also

RE: Performance degradation when factoring out common code

2017-09-08 Thread Simon Peyton Jones via ghc-devs
unless I can reproduce it. Simon From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Harendra Kumar Sent: 08 September 2017 13:50 To: Mikolaj Konarski Cc: ghc-devs@haskell.org Subject: Re: Performance degradation when factoring out common code I should also point out that I saw

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
I tested my code on GHC 8.2.1, there is a good news and a bad news. The good news is that with 8.2.1 performance of my code has improved by a huge margin of around 20%, I had reported a similar perf improvement earlier in another one of my package with 8.2. The bad news is that the problem that I

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
I should also point out that I saw performance improvements by manually factoring out and propagating some common expressions to outer loops in performance sensitive paths. Now I have made this a habit to do this manually. Not sure if something like this has also been fixed with that ticket or some

Re: Performance degradation when factoring out common code

2017-09-08 Thread Harendra Kumar
Thanks Mikolaj! I have seen some surprising behavior quite a few times recently and I was wondering whether GHC should do better. In one case I had to use SPECIALIZE very aggressively, in another version of the same code it worked well without that. I have been doing a lot of trial and error with t

Re: Performance degradation when factoring out common code

2017-09-08 Thread Mikolaj Konarski
Hello, I've had a similar problem that's been fixed in 8.2.1: https://ghc.haskell.org/trac/ghc/ticket/12603 You can also use some extreme global flags, such as ghc-options: -fexpose-all-unfoldings -fspecialise-aggressively to get most the GHC subtlety and shyness out of the way when experiment