Re: [GHC] #7206: Implement cheap build

#7206: Implement cheap build -------------------------------------+------------------------------------- Reporter: simonpj | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: ⊥ Component: Compiler | Version: 7.4.2 Resolution: | Keywords: FloatOut Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #8763, #13422 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by osa1): I confirmed that this fixes #8763. I had not encountered this in practice myself, but I was surprised to see this function used in another bug report: {{{ ireplicateA_ :: Applicative m => Int -> (Int -> m a) -> m () ireplicateA_ cnt0 f = loop cnt0 0 where loop !cnt !n | cnt <= 0 = pure () | otherwise = f n *> (loop (cnt - 1) (n + 1)) }}} when I tried using `forM_ [1 .. n] ...` instead of this function I realized that the program gets much slower. However with `cheapBuild` the generated code is identical. I'll submit a patch with cheap build later today with a perf test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/7206#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC