RE: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-13 Thread Simon Peyton-Jones
| The head has -dsuppress-coercions which omits coercion terms when pretty | printing Core. It would be easy to backport that to 6.12. The HEAD also has a coercion optimiser that dramatically shrinks some large coercion terms. | > I might revert both mwc-random and statistics back to using plain

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-12 Thread Roman Leshchinskiy
On 11/07/2010, at 22:49, Bryan O'Sullivan wrote: > On Sun, Jul 11, 2010 at 12:59 AM, Dan Doel wrote: > >> You're using GHC 6.12.x presumably? > > That's right. > >> There are known performance problems with >> using abstract PrimMonads in that version (and, actually, just using IO as >> well

RE: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-12 Thread Simon Peyton-Jones
l.org Subject: Re: Massive slowdown in mwc-random after switching to use of primitive package On Mon, Jul 12, 2010 at 10:40 AM, Bryan O'Sullivan mailto:b...@serpentine.com>> wrote: I can probably cook up a smaller repro than Dan, since I depend on neither package for a standalone test

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-12 Thread Bryan O'Sullivan
On Mon, Jul 12, 2010 at 10:40 AM, Bryan O'Sullivan wrote: > > I can probably cook up a smaller repro than Dan, since I depend on neither > package for a standalone test case. Let me get cracking on it promptly, and > I'll file a ticket later. > I filed http://hackage.haskell.org/trac/ghc/ticket/4

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-12 Thread Bryan O'Sullivan
On Mon, Jul 12, 2010 at 9:12 AM, Simon Peyton-Jones wrote: > Well, fewer dependencies make it much easier to test and reproduce. But > something concrete is certainly better than nothing. Please submit a Trac > ticket. (Worth checking with Roman -- perhaps he already has?) > I can probably coo

RE: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-12 Thread Simon Peyton-Jones
] | Sent: 12 July 2010 01:56 | To: Simon Peyton-Jones | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Massive slowdown in mwc-random after switching to use of | primitive package | | On Sunday 11 July 2010 1:31:23 pm Simon Peyton-Jones wrote: | > This is the first I've heard of this.

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-11 Thread Dan Doel
On Sunday 11 July 2010 1:31:23 pm Simon Peyton-Jones wrote: > This is the first I've heard of this. Do you have a test case that shows > up the problem? Then we can put it in the regression tests so it won't go > wrong again. That depends on what dependencies you're willing to accept. I think al

RE: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-11 Thread Simon Peyton-Jones
| > caused a huge performance regression. | | You're using GHC 6.12.x presumably? There are known performance problems with | using abstract PrimMonads in that version (and, actually, just using IO as | well). ... | The good news is that, last I checked, this isn't a problem in HEAD. The |

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-11 Thread Bryan O'Sullivan
On Sun, Jul 11, 2010 at 12:59 AM, Dan Doel wrote: > > You're using GHC 6.12.x presumably? That's right. > There are known performance problems with > using abstract PrimMonads in that version (and, actually, just using IO as > well). Ah, that's a shame. I'm surprised it would be affecting I

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-10 Thread Dan Doel
On Saturday 10 July 2010 2:09:48 pm Bryan O'Sullivan wrote: > Recently, I switched the mwc-random package ( > http://hackage.haskell.org/package/mwc-random) over from running in the ST > monad to using your primitive package. I didn't notice initially, but this > caused a huge performance regressio

Re: Massive slowdown in mwc-random after switching to use of primitive package

2010-07-10 Thread Bryan O'Sullivan
On Sat, Jul 10, 2010 at 7:09 PM, Bryan O'Sullivan wrote: > If you could shed any light, I'd be most grateful, as this has me a bit > confounded. > As a further data point, the attached patch replaces uses of PrimMonad with ST, and speeds performance back to 0.015 seconds, so it's clearly the use

Massive slowdown in mwc-random after switching to use of primitive package

2010-07-10 Thread Bryan O'Sullivan
Hi, Roman — Recently, I switched the mwc-random package ( http://hackage.haskell.org/package/mwc-random) over from running in the ST monad to using your primitive package. I didn't notice initially, but this caused a huge performance regression. mwc-random 0.4.1.1 uses ST internally, and runs the