[GHC] #10711: Defining mapM_ in terms of traverse_ causes substantial blow-up in ByteCodeAsm
GHC
ghc-devs at haskell.org
Thu Jul 30 17:00:23 UTC 2015
#10711: Defining mapM_ in terms of traverse_ causes substantial blow-up in
ByteCodeAsm
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: bgamari
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version:
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
performance bug | Test Case: ghcirun004
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by rwbarton):
I have to say that I still don't understand exactly why
{{{
a1 *> a2
== (a1 >>= (\_ -> return id)) >>= (\x2 -> a2 >>= (\x3 -> return (x2 x3)))
}}}
is more than a constant (say 10 times) slower than `a1 >> a2` for this
`Assembler` monad.
Experimentally bgamari's test program does ~n^2^ allocations and takes
~n^3^ total time in the Applicative version, while the Monad version runs
in linear allocations and time.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10711#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list