#6166: Performance regression in mwc-random since 7.0.x
-------------------------------------+--------------------------------------
Reporter: bos | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.4.2 | Keywords:
Os: Unknown/Multiple | Architecture: x86_64 (amd64)
Failure: Runtime performance bug | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------------------+--------------------------------------
I've had a report that the performance of the mwc-random package has
regressed seriously after upgrading from GHC 7.0 to 7.4. It turns out that
7.2 also has the regression.
Here's a sample program.
{{{
import qualified Data.Vector.Unboxed as U
import qualified System.Random.MWC as R
import System.Random.MWC.Distributions (standard)
count = 1000 * 1000
fast gen = standard gen
slow gen = standard gen >>= return
-- Edit this to choose fast or slow.
which gen = slow gen
main = do
gen <- R.create
v <- U.replicateM count (which gen)
print (U.last v)
}}}
With GHC 7.0.3 -O2, this runs in 0.294 sec, regardless of whether `fast`
or `slow` is used.
Under 7.4, `fast` runs in 0.062 sec (a nice speedup!), but `slow` now
takes 9.2 sec (yikes!).
Roman suggested compiling the `slow` version with `-fno-state-hack`, which
brings performance back up to 0.062 sec.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6166>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs