[Haskell-cafe] Speeding up trivial programs
Brandon Allbery
allbery.b at gmail.com
Fri Aug 23 19:04:13 UTC 2024
I think there's already a ticket for slow RTS startup, although I didn't
find it on a quick search, and that time looks similar to the examples I
saw (around a tenth of a second).
On Fri, Aug 23, 2024 at 2:50 PM amindfv--- via Haskell-Cafe <
haskell-cafe at haskell.org> wrote:
> I'm working on a small program that has to run many, many times, as
> quickly as possible (yes, it needs to be a standalone program).
>
> I've optimized it in many ways, but I seem to have a time floor,
> observable with "Hello, world"
>
>
> $ cat Hello.hs
> main = putStrLn "Hello world"
> $ ghc -O2 Hello.hs
> $ time ./Hello
> Hello world
>
> real 0m0.150s
> user 0m0.117s
> sys 0m0.032s
>
>
> The equivalent program in C takes only 0.002s (75x faster).
>
> What is taking the extra time? Is it the RTS "booting"? Is there any way
> to speed this up?
>
> Thanks,
> Tom
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20240823/a109c5b3/attachment.html>
More information about the Haskell-Cafe
mailing list