#7429: Unexplained performance boost with +RTS -h ---------------------------------+------------------------------------------ Reporter: simonmar | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.1 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Runtime performance bug Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by tomberek):
* cc: tomberek@… (added) Comment: I'm not sure how to insert an IO () into the ST/STO monad, either that sounds "unsafe" or I lift everything to IO? I tried using: {{{ lift $ unsafeIOToST performGC }}} in Main2.hs This fixes the problem when the circular list is of size 2 (using function twoItemList). The problem creeps back in when using threeItemList or when the list is produced by nlist. Perhaps my generation of the circular list is suspect. Perhaps too lazy? The inner loop in Core is unchanged from previous versions. Regarding "small data structure": This effect is actually more pronounced the larger the circular list is. I've tested this up to n = 2 million and it seems that the GC overhead of profiling catches up around 1 million, but the non-GC time difference becomes very pronounced. So the "GC fix" works for an explicitly constructed circular list of length 2, but nothing else. And still, working in only ST is always slower than in a superfluous StateT over ST. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7429#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs