
#9120: Cache intermediate powers -------------------------------------+------------------------------------- Reporter: basvandijk | Owner: ekmett Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.2 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: Runtime | performance bug | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by ekmett): This seems pretty straight forward and the code looks correct to me. The main cost being borne right now is that rather than being `O(n)` to compute the array it is `O(n log n)`. With `n` bounded above by `1100`, and it only hitting you while you force these constants the first time it'll be hard to find a benchmark materially affected, as they 'warm up' more or less instantly. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9120#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler