#2271: floor, ceiling, round :: Double -> Int are awesomely slow
------------------------------------------+---------------------------------
    Reporter:  dons                       |        Owner:  daniel.is.fischer
        Type:  bug                        |       Status:  new              
    Priority:  low                        |    Milestone:  7.0.1            
   Component:  libraries/base             |      Version:  7.1              
    Keywords:  performance, math, double  |     Testcase:                   
   Blockedby:                             |   Difficulty:  Unknown          
          Os:  Unknown/Multiple           |     Blocking:                   
Architecture:  Unknown/Multiple           |      Failure:  None/Unknown     
------------------------------------------+---------------------------------
Changes (by daniel.is.fischer):

  * version:  6.8.2 => 7.1


Comment:

 I'm almost on the verge of giving up. I have the code, the code works and
 is faster than the old code, but I cannot get the rewrite rules to fire.
 When I compile some code, for example
 {{{
 main :: IO ()
 main = print (properFraction (encodeFloat (2^23) 16 :: Float) :: (Int,
 Float))
 }}}
 -ddump-rule-firings says
 {{{
 Rule fired: SPEC GHC.Real.^
 Rule fired: Class op encodeFloat
 Rule fired: Class op properFraction
 Rule fired: SPEC $cproperFraction [GHC.Types.Int]
 Rule fired: Class op show
 Rule fired: <#
 Rule fired: Class op showsPrec
 Rule fired: Class op showsPrec
 }}}
 instead of the desired
 {{{
 Rule fired: properFraction/Float->Int
 }}}
 Note that there's no SPECIALISE nor INLINE pragma anywhere concerning the
 !RealFrac instance.

 What's going on?
 I'm currently building with explicit NOINLINE pragmas, if that doesn't
 help, I'm lost.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2271#comment:15>
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

Reply via email to