
9 Apr
2014
9 Apr
'14
1:11 a.m.
On Tue, Apr 8, 2014 at 12:55 PM, Michael Karcher < mkarcher@mkarcher.dialup.fu-berlin.de> wrote:
let bigset = fromAscList testdata
finally query the membership of the number 5 several times. This happens to be reasonably fast if compiled without optimization, but goes down to dog slow if compiled with optimization, as the set building process is hoisted into the loop and thus performed 10 times.
replicateM_ 10 . print . member 5 $ bigset
Isn't this 'hoisting into the loop' a case of over-aggressive inlining, a known pitfall of -O2 ? What happens with plain -O, which is the recommended general-purpose setting?