Ticket #2727 (closed bug: invalid)
DiffArray performance unusable for advertized purpose
| Reported by: | claus | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.12.1 |
| Component: | libraries (other) | Version: | 6.11 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Runtime performance bug | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
(cf. this 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]

