Re: [GHC] #1600: Optimisation: CPR the results of IO

#1600: Optimisation: CPR the results of IO -------------------------------------+------------------------------------- Reporter: simonmar | Owner: Type: task | Status: new Priority: lowest | Milestone: 7.6.2 Component: Compiler | Version: 6.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Runtime | Difficulty: Moderate (less performance bug | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by nomeata): Looking at examples for code where nested CPR could, would and should work, I found this ticket. At first glance, this looks good. But isn’t it the case that a usage like {{{ main = do _ <- facIO 1000 }}} will not do any calculation (besides counting down from 1000, and allocating a lot of thunks)? This shows that the transformation wanted here cannot be obtained without either offering two variants of the function (would inflate code size), or requires an analysis that calculating the factorial ''even if not needed'' will still always be better than allocating the thunks. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/1600#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC