<div dir="ltr">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).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 23, 2024 at 2:50 PM amindfv--- via Haskell-Cafe <<a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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).<br>
<br>
I've optimized it in many ways, but I seem to have a time floor, observable with "Hello, world"<br>
<br>
<br>
$ cat Hello.hs<br>
main = putStrLn "Hello world"<br>
$ ghc -O2 Hello.hs<br>
$ time ./Hello<br>
Hello world<br>
<br>
real 0m0.150s<br>
user 0m0.117s<br>
sys 0m0.032s<br>
<br>
<br>
The equivalent program in C takes only 0.002s (75x faster).<br>
<br>
What is taking the extra time? Is it the RTS "booting"? Is there any way to speed this up?<br>
<br>
Thanks,<br>
Tom<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>