[GHC] #427: Random.StdGen slowness

GHC cvs-ghc at haskell.org
Wed Apr 3 19:19:06 CEST 2013


#427: Random.StdGen slowness
--------------------------------------+-------------------------------------
  Reporter:  remit                    |          Owner:  rrnewton        
      Type:  bug                      |         Status:  new             
  Priority:  normal                   |      Milestone:  _|_             
 Component:  libraries/random         |        Version:                  
Resolution:  None                     |       Keywords:                  
        Os:  Unknown/Multiple         |   Architecture:  Unknown/Multiple
   Failure:  Runtime performance bug  |     Difficulty:  Unknown         
  Testcase:                           |      Blockedby:                  
  Blocking:                           |        Related:                  
--------------------------------------+-------------------------------------

Comment(by joell):

 This ticket seems to be almost describing two separate issues: the
 performance of the random package and the "thunk-bomb" problem in
 `getStdRandom`.  While I admit I haven't looked into the performance
 aspect, I am now well acquainted with the "thunk-bomb" aspect.

 Turns out a metrics library we were using at my company made a `randomRIO`
 call that in some cases (all of them in our configuration) wouldn't
 actually use the generated random value.  This led to me spending a few
 days trying to figure out why our services were consuming and retaining
 gigabytes of memory.  (For those interested in case studies, the
 discussion with the metrics library folks is here:
 https://github.com/brendanhay/network-metrics/issues/4 .)

 So I would like to petition that the change Remi suggested in comment:17
 to make `getStdRandom` strict (or something along those lines) be made.
 To my mind (heavily biased by the experience of the last few days), I
 wouldn't really consider the "thunk-bomb" aspect a performance problem so
 much as a stability one.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/427#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list