[Haskell-cafe] Library function for map+append

Sean Leather leather at cs.uu.nl
Tue Aug 18 12:38:26 EDT 2009


On Tue, Aug 18, 2009 at 18:23, Bulat Ziganshin wrote:

> Hello Sean,
>
> Tuesday, August 18, 2009, 7:49:21 PM, you wrote:
>
> >   writeFile "/dev/null" $ show $ [1 .. 10001000]
>
> it may be dominated by show+writeFile. i suggest you to compute, say,
> sum of all elements instead
>

Thank you, Bulat. The results now show some variation.

Sean

--

writeFile "/dev/null" $ show $ sum $ [1 .. 10001000]

0m1.652s
0m1.634s
0m1.658s

writeFile "/dev/null" $ show $ sum $ mapapp0 (+3) [1 .. 10000000] [1 ..
1000]

0m1.601s
0m1.613s
0m1.615s

writeFile "/dev/null" $ show $ sum $ mapapp1 (+3) [1 .. 10000000] [1 ..
1000]

0m1.647s
0m1.656s
0m1.654s

writeFile "/dev/null" $ show $ sum $ mapapp2 (+3) [1 .. 10000000] [1 ..
1000]

0m1.640s
0m1.645s
0m1.664s

writeFile "/dev/null" $ show $ sum $ mapapp3 (+3) [1 .. 10000000] [1 ..
1000]

0m1.541s
0m1.531s
0m1.561s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090818/e5e7deaa/attachment.html


More information about the Haskell-Cafe mailing list