Missed opportunity for let-no-esape
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..).
Trac metadata
Trac field | Value |
---|---|
Version | 6.6 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |