#7429: Unexplained performance boost with +RTS -h
--------------------------------------+-------------------------------------
Reporter: simonmar | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Resolution: wontfix | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Runtime performance bug | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
--------------------------------------+-------------------------------------
Comment(by tomberek):
Ok, then I'd like to know what I can do to create the data structure
strictly. I've got the bang patterns on the CircList,
{{{
data CircList s = ConsM {value :: {-# UNPACK #-} !Int
,cons :: {-# UNPACK #-} !(STRef s (CircList s ))
}
}}}
Is there something in the following that should be "strictified"?
{{{
twoItemList :: forall s. ST s (CircList s)
twoItemList = do
rec item1 <- liftM (ConsM 0) $ newSTRef item2
item2 <- liftM (ConsM 1) $ newSTRef item1
return item1
}}}
or in
{{{
-- | Defines a circular list of length n
nlist :: forall s. Int -> ST s (CircList s)
nlist ns = do
rec allItems <-
let next i = nextCons i $ (V.!) allItems ((i+1) `mod` ns)
in V.generateM ns next
return $ (V.!) allItems 0
where nextCons v n = do
n' <- newSTRef n
return $ ConsM v n'
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7429#comment:10>
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