
#15646: ghci takes super long time to find the type of large fractional number -------------------------------------+------------------------------------- Reporter: Johannkokos | Owner: | JulianLeviston Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.4.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by JulianLeviston): Okay... I think I've put all the pieces into place now. I'm a little confused as to why, but `dsLit` seems to still be taking a while to desugar with the `fromRational (readRational txt)` pattern in place. I'm not 100% sure I've done what was intended... {{{ HsRat _ fl ty -> do let txt = case fl of THFL { thfl_text = SourceText t } -> t FL { fl_text = SourceText t } -> t val = fromRational (readRational txt) num <- mkIntegerExpr (numerator val) denom <- mkIntegerExpr (denominator val) return (mkCoreConApps ratio_data_con [Type integer_ty, num, denom]) }}} However if I do `./inplace/bin/ghc-stage2 --interactive` then `:t 1e10000000` and it takes over 3 seconds still. (One less digit takes under 1 second) so the bug is still there — it's now taking *less* time to typecheck, but the desugarer seems to still be catching me out. I'll attach a patch file so you can see what I've done to now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15646#comment:41 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler