#3586: Slow array code
-----------------------------------------+----------------------------------
Reporter: simonpj | Owner:
Type: run-time performance bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.10.4
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
-----------------------------------------+----------------------------------
Comment (by dons):
Rewriting to use uvector:
{{{
import Data.Array.Vector
main = print . sumU . mapU (+3) $ replicateU 2000000 (137.0 :: Double)
}}}
Compiling:
{{{
$ ghc -O2 --make Z.hs -fvia-C -optc-O3 -fforce-recomp -optc-msse4
$ time ./Z
2.8e8
./Z 0.01s user 0.00s system 108% cpu 0.012 tota
}}}
Which I believe is both purely functional, and twice as fast as the Clean
code.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3586#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs