13 Nov 18:55
Re: Inliner behaviour - tiny changes lead to huge performance differences
David Menendez <dave <at> zednenem.com>
2009-11-13 17:55:27 GMT
2009-11-13 17:55:27 GMT
On Fri, Nov 13, 2009 at 2:04 AM, Bryan O'Sullivan <bos <at> serpentine.com> wrote:
>
> And the lengthI function is defined more generally, in the hope that I could
> use it for both Int and Int64 lengths:
>
> lengthI :: Integral a => Stream Char -> a
> lengthI (Stream next s0 _len) = loop_length 0 s0
> where
> loop_length !z s = case next s of
> Done -> z
> Skip s' -> loop_length z s'
> Yield _ s' -> loop_length (z + 1) s'
> {-# INLINE[0] lengthI #-}
Would it help to SPECIALIZE lengthI for Int and Int64?
--
--
Dave Menendez <dave <at> zednenem.com>
<http://www.eyrie.org/~zednenem/>
RSS Feed