#3897: reading a large String as Double takes too long
------------------------+---------------------------------------------------
Reporter: maeder | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.0.1
Component: Prelude | Version: 6.12.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Linux | Blocking:
Architecture: x86 | Failure: Runtime performance bug
------------------------+---------------------------------------------------
Changes (by daniel.is.fischer):
* cc: daniel.is.fisc...@… (added)
Comment:
`read "1eN" :: Double` requires calculating 10^`N`^ `:: Rational`. For `N`
of large absolute value, that is slow and memory intensive.
It could be solved by changing the `Lexeme` type, replacing the `Rat
Rational` constructor with e.g. `RatExp Rational (Maybe Integer)` and
letting the read instance decide whether to do it at all. That would
however make the Read instances more complicated and slower for more
reasonable input strings (how much?). Is it worth doing it?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3897#comment:2>
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