[GHC] #1216: indexing 2d arrays is slow and leaky. why?

GHC trac at galois.com
Thu Nov 8 10:20:54 EST 2007


#1216: indexing 2d arrays is slow and leaky. why?
----------------------+-----------------------------------------------------
 Reporter:  claus     |          Owner:  simonpj   
     Type:  bug       |         Status:  new       
 Priority:  normal    |      Milestone:  6.8 branch
Component:  Compiler  |        Version:  6.6       
 Severity:  normal    |     Resolution:            
 Keywords:            |     Difficulty:  Unknown   
 Testcase:            |   Architecture:  Unknown   
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Changes (by simonmar):

  * owner:  => simonpj
  * milestone:  6.6.2 => 6.8 branch

Comment:

 I've investigated 6.8.1's performance on this example.  In summary:

  * the performance difference between calling `index` and using the inline
 copy still exists
  * there is virtually no different in allocation between the two, i.e. the
 "leaky"
    aspect of the original report doesn't exist
  * Specialisation is working properly: we're calling the specialised
 version of
    `index` for `(Int,Int)`.
  * The difference appears to be inlining + case-of-case.  Although we're
 calling
    the specialised `index`, it isn't inlined.  We can force it to be
 inlined with
    `-finline-use-threshold=30`, but that doesn't help.  It looks like
 `case-of-case`
    isn't being applied after inlining.
  * something else is strange: there's a specialised function named
 `$sa`_something in the output, but it isn't referenced from anywhere.

 Simon: could you take a look?  The code is in `~simonmar/scratch/1216.hs`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1216#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list