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

GHC trac at galois.com
Mon Mar 12 12:57:06 EDT 2007


#1216: indexing 2d arrays is slow and leaky. why?
-------------------------+--------------------------------------------------
    Reporter:  claus     |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.6    
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
readArray/writeArray call GHC.Arr.index, which seems inexplicably slow
 for 2d arrays. inexplicably, because simply copying the default
 implementation
 of index from GHC.Arr into the local module can speed things up
 considerably.

 originally raised in this thread:
 http://www.haskell.org/pipermail/haskell-cafe/2007-March/023394.html

 shortened example or matrix/vector-multiplication attached. comment out
 the first line of myindex to use the local copy. this results in a speedup
 from 20s to 13s (time ./Index 100000) on my system, not to mention the
 difference in space usage (a factor of 1000 in allocation, according to
 +RTS -sstderr..).

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


More information about the Glasgow-haskell-bugs mailing list