[GHC] #11146: Manual eta expansion leads to orders of magnitude less allocations

GHC ghc-devs at haskell.org
Mon Nov 30 10:50:44 UTC 2015


#11146: Manual eta expansion leads to orders of magnitude less allocations
-------------------------------------+-------------------------------------
           Reporter:  niteria        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 While working on deterministic free variable computation I run into some
 performance issues. I narrowed it down to code that when eta expanded
 performed less allocations.

 I ended up writing a benchmark and for large examples the eta expanded
 versions performs orders of magnitude less allocations.

 The results of my test:
 {{{
 EtaExpanded test3
       50,450,112 bytes allocated in the heap
 real 0.89

 EtaReduced test3
    3,661,740,240 bytes allocated in the heap
 real 3.66
 }}}

 The whole source is here: https://github.com/niteria/deterministic-fvs,
 I'm also attaching the two interesting implementations.

 I experimented with it a little and GHC eta-expanded when I didn't have
 mutually recursive bindings.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11146>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list