perf regression with TypeFamilies

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

perf regression with TypeFamilies

Richard Eisenberg-5
Hi Harendra,

I saw your comment on a ghc proposal (https://github.com/ghc-proposals/ghc-proposals/pull/343#issuecomment-650797297) that said you experienced perf regressions with -XTypeFamilies enabled (but no other changes). Are these reproducible in a way that can be shared publicly? And are the regressions in compile times or run times?

-XTypeFamilies enables -XMonoLocalBinds, which disables let-generalization on some nested lets. It is thus just barely conceivable that different Core is produced depending on this extension, and that there may be a possibility of performance changes. But this would be unexpected, and something worth investigating.

In other words: if you can, do please post a bug -- simply enabling -XTypeFamilies should not slow anything down!

Thanks,
Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: perf regression with TypeFamilies

Harendra Kumar
Hi Richard,

I am glad that you are interested in it. It is the runtime performance that degrades, and yes it is fully reproducible and publicly shareable, the library is open source so anyone can run these benchmarks. I had postponed the problem raising an issue to investigate it further here https://github.com/composewell/streamly/issues/567 . Since you are interested I will investigate it sooner. I have added some perf numbers in that issue.

I was also surprised by it, thinking what can type families possibly do to degrade run time performance like that. I can try compiling one worst affected benchmark code and look at the core-2-core passes to see where it makes the difference.

-harendra

On Mon, 29 Jun 2020 at 19:45, Richard Eisenberg <[hidden email]> wrote:
Hi Harendra,

I saw your comment on a ghc proposal (https://github.com/ghc-proposals/ghc-proposals/pull/343#issuecomment-650797297) that said you experienced perf regressions with -XTypeFamilies enabled (but no other changes). Are these reproducible in a way that can be shared publicly? And are the regressions in compile times or run times?

-XTypeFamilies enables -XMonoLocalBinds, which disables let-generalization on some nested lets. It is thus just barely conceivable that different Core is produced depending on this extension, and that there may be a possibility of performance changes. But this would be unexpected, and something worth investigating.

In other words: if you can, do please post a bug -- simply enabling -XTypeFamilies should not slow anything down!

Thanks,
Richard

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: perf regression with TypeFamilies

Harendra Kumar
I opened a GHC ticket (https://gitlab.haskell.org/ghc/ghc/-/issues/18414) with full details.

-harendra

On Tue, 30 Jun 2020 at 18:25, Harendra Kumar <[hidden email]> wrote:
Hi Richard,

I am glad that you are interested in it. It is the runtime performance that degrades, and yes it is fully reproducible and publicly shareable, the library is open source so anyone can run these benchmarks. I had postponed the problem raising an issue to investigate it further here https://github.com/composewell/streamly/issues/567 . Since you are interested I will investigate it sooner. I have added some perf numbers in that issue.

I was also surprised by it, thinking what can type families possibly do to degrade run time performance like that. I can try compiling one worst affected benchmark code and look at the core-2-core passes to see where it makes the difference.

-harendra

On Mon, 29 Jun 2020 at 19:45, Richard Eisenberg <[hidden email]> wrote:
Hi Harendra,

I saw your comment on a ghc proposal (https://github.com/ghc-proposals/ghc-proposals/pull/343#issuecomment-650797297) that said you experienced perf regressions with -XTypeFamilies enabled (but no other changes). Are these reproducible in a way that can be shared publicly? And are the regressions in compile times or run times?

-XTypeFamilies enables -XMonoLocalBinds, which disables let-generalization on some nested lets. It is thus just barely conceivable that different Core is produced depending on this extension, and that there may be a possibility of performance changes. But this would be unexpected, and something worth investigating.

In other words: if you can, do please post a bug -- simply enabling -XTypeFamilies should not slow anything down!

Thanks,
Richard

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs