Re: Speeding up trivial programs
Brandon Allbery <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cafe |
|---|---|
| Message-ID | <CAKFCL4V9GSxiOqdvK3Qf+HivVxK=wPJPheQQMzAo_HtCASxqzg@mail.gmail.com> |
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 < [email protected]> 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 [email protected] _______________________________________________ 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.