#2727: DiffArray performance unusable for advertized purpose
-----------------------------------------+----------------------------------
Reporter: claus | Owner:
Type: run-time performance bug | Status: new
Priority: normal | Component: libraries (other)
Version: 6.11 | Severity: normal
Keywords: | Testcase:
Architecture: Unknown/Multiple | Os: Unknown/Multiple
-----------------------------------------+----------------------------------
(cf. this [http://www.haskell.org/pipermail/glasgow-haskell-
users/2008-October/015851.html ghc-users thread])
`Data.Array.Diff.DiffArray` is unusably slow. Sometimes even
`Data.Array.Array` is faster in single-threaded use, defeating the
purpose. The attached code tries to demonstrate the issue, if I got the
single-threadedness via `$!` right (default compilation `ghc --make
SlowDiffArray.hs` gives `Array`, build with `-DUseDiff` to get
`DiffArray`).
As I happened to have some older ghcs around, I tried those as well, and
it seems the issue got worse around 6.8.3 (`SlowDiffArrayA-<version>`:
Array; `SlowDiffArrayDA-<version>`: DiffArray):
{{{
$ for i in *.exe ; do echo $i; time ./$i; done
SlowDiffArrayA-61120081004.exe
9990001
real 0m0.307s
user 0m0.015s
sys 0m0.015s
SlowDiffArrayA-641.exe
9990001
real 0m0.261s
user 0m0.030s
sys 0m0.000s
SlowDiffArrayA-661.exe
9990001
real 0m0.260s
user 0m0.015s
sys 0m0.000s
SlowDiffArrayA-683.exe
9990001
real 0m0.232s
user 0m0.015s
sys 0m0.000s
SlowDiffArrayDA-61120081004.exe
9990001
real 0m12.932s
user 0m0.031s
sys 0m0.000s
SlowDiffArrayDA-641.exe
9990001
real 0m7.114s
user 0m0.015s
sys 0m0.016s
SlowDiffArrayDA-661.exe
9990001
real 0m5.774s
user 0m0.015s
sys 0m0.015s
SlowDiffArrayDA-683.exe
9990001
real 0m12.814s
user 0m0.015s
sys 0m0.000s
}}}
(measured on Pentium M 760, 2GHz, Windows XP)
[the majority of the issue probably lies in the `DiffArray`
implementation, hence component `libraries`, but it seems that compiler
and runtime system also play a role]
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2727>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs