
#14737: Improve performance of Simplify.simplCast -------------------------------------+------------------------------------- Reporter: tdammers | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #11735 #14683 | Differential Rev(s): Phab:D4385 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Yes, delete the `eqType` branches in both `pushCoTyArg` and `pushValArg`. Leave a Note to say "don't do `eqType` here! (see Trac #14737)". On to `mkInstCo`. I see that it does an inefficient single-variable substitution. So if we have {{{ mkInstCo (mkInstCo (mkInstCo co (Refl t1)) (Refl t2)) (Refl t3) }}} we will traverse `co` three times (and `t1` twice etc). Bad bad. Idea: leave that to the coercion optimiser. Try simply removing the first equation for `mkInstCo` leaving {{{ mkInstCo = InstCo }}} '''Richard''': I think that the coercion optimiser will do a good job here, right? But I do see this in the `InstCo` case of `opt_co4`: {{{ -- See if it is a forall after optimization -- If so, do an inefficient one-variable substitution, then re- optimize }}} Are you sure that's a good idea? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14737#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler