[GHC] #11226: Performance regression (involving sum, map, enumFromThenTo)

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This program's performance suffers when compiled with 7.10, compared to 7.8: {{{ main = print $ sum $ map bitcount [0, 4 .. 2^24-1 ] bitcount :: Int -> Int bitcount x = if x > 0 then let (d,m) = divMod x 2 in bitcount d + m else 0 }}} See discussion in this thread: https://mail.haskell.org/pipermail/haskell- cafe/2015-December/122485.html -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * cc: nomeata (added) Comment: No time to look deeply, but: Does the problem go away if the list is not statically known and thus prevented from floated out, e.g.: {{{#!hs main = print $ foo (2^24-1) foo n = sum $ map bitcount [0, 4 .. n] {-# NOINLINE foo #-} bitcount :: Int -> Int bitcount x = if x > 0 then let (d,m) = divMod x 2 in bitcount d + m else 0 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by j.waldmann): * cc: nomeata (removed) Comment: @nomeata: no, does not go away -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by j.waldmann): I found that this works fine with 7.10: {{{ main = print $ sum $ map bitcount $ takeWhile (< 2^24) [0, 4 .. ] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by nomeata): * cc: nomeata (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by j.waldmann): possibly related: https://ghc.haskell.org/trac/ghc/ticket/10992 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11226: Performance regression (involving sum, map, enumFromThenTo) -------------------------------------+------------------------------------- Reporter: j.waldmann | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * failure: None/Unknown => Runtime performance bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11226#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC