Speeding up trivial programs

amindfv--- via Haskell-Cafe <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <ZsjZtjhHzPlKj00x@painter>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.