Performance regression (involving sum, map, enumFromThenTo)
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
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |