[GHC] #10260: last uses too much space with optimizations disabled

GHC ghc-devs at haskell.org
Tue Apr 7 20:02:38 UTC 2015


#10260: last uses too much space with optimizations disabled
-------------------------------------+-------------------------------------
              Reporter:  rwbarton    |             Owner:  ekmett
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Core        |           Version:  7.10.1
  Libraries                          |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  Runtime
          Architecture:              |  performance bug
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 I know we don't worry too much about performance when optimizations are
 disabled, but `last [1..n]` using O(n) space when the naive definition
 would run in O(1) space is a bit too much I think.

 Can we split out the new definition to a separate function and use a rule
 to rewrite `last` to that function when optimizations are enabled? I'm not
 expert enough on the use of rules and inlining phases etc. to write the
 patch myself, but I think it should be simple.

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


More information about the ghc-tickets mailing list