[GHC] #1434: Slow conversion from Double to Int
GHC
trac at galois.com
Tue Jun 19 05:58:17 EDT 2007
#1434: Slow conversion from Double to Int
------------------------------------------+---------------------------------
Reporter: ghc at henning-thielemann.de | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.4.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Os: Linux | Testcase:
Architecture: Unknown |
------------------------------------------+---------------------------------
Comment (by ghc at henning-thielemann.de):
In a more compact example using the GHC compiler and optimizations there
are no performance differences:
{{{
{-# OPTIONS -O2 -Wall #-}
module Main where
import GHC.Float (double2Int)
main :: IO ()
main = print (sum (map double2Int [-0.32,-0.29..(100000::Double)]) ::
Int)
main' :: IO ()
main' = print (sum (map truncate [-0.32,-0.29..(100000::Double)]) ::
Int)
}}}
However in a more complicated application I have, I generated a signal
with {{{round}}} in 4 seconds and with a replacement based on
{{{double2Int}}} in only one second. This may indicate an insufficient
inlining depth, but increasing it didn't help. Seems like I have to
extract a working example to demonstrate that.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1434>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list