I got similar, but slightly different results (Fedora 14, 64-bit, core i7):
(time per run in wall seconds) c: 0.001086 bash: 0.002742 py: 0.000336 scm: 0.005199 pl: 0.000344 so bash slightly beat out perl, and chicken came in last of the 5. Didn't bother with mono or java. Source available: https://github.com/bobbyp/helloworlds so on a *nix box: $ git clone git://github.com/bobbyp/helloworlds.git $ cd helloworlds $ make and it should give you a report shortly. BUT, I think these tests lie. I do the following: $ strace -C -ttt ./hello.scm 2> chicken_report $ strace -C -ttt ./hello.py 2> python_report And strace nicely shows me for the chicken binary: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000064 3 19 mmap 0.00 0.000000 0 6 read 0.00 0.000000 0 1 write 0.00 0.000000 0 12 6 open 0.00 0.000000 0 6 close 0.00 0.000000 0 3 3 stat 0.00 0.000000 0 8 fstat 0.00 0.000000 0 1 lseek 0.00 0.000000 0 8 mprotect 0.00 0.000000 0 2 munmap 0.00 0.000000 0 6 brk 0.00 0.000000 0 1 1 access 0.00 0.000000 0 1 execve 0.00 0.000000 0 2 getrusage 0.00 0.000000 0 1 arch_prctl ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000064 77 10 total So, only 0.000064 seconds spent in the kernel (Python had 0.000626, an order of magnitide more). I think the reporting of execution time may be skewed by scheduling or something funky like that. That, or python (and perl)'s runtime is a _lot_ faster to initialize than chicken. Is that possible? yours, Bobby On Sun, Mar 13, 2011 at 8:26 PM, Daniel Aquino <[email protected]>wrote: > Here's one of the links: > http://www.haskell.org/haskellwiki/Simple_unix_tools > > > > On 3/13/11, Daniel Aquino <[email protected]> wrote: > > Haskell should be just as fast as c especially for something that > > basic. There is a whole set of common unix utilities implemented in > > very short one liners. > > > > On 3/13/11, John J Foerch <[email protected]> wrote: > >> Tobia Conforto <[email protected]> writes: > >>> "Hello, > >>> > >>> World execution time"—may not be the most meaningful of benchmarks, but > >>> it's > >>> pretty important when you are writing shell scripts / cron jobs / > random > >>> commandline utilities. It also serves to compare the startup overhead > of > >>> different execution environments. So I ran this benchmark for my own > >>> curiosity > >>> and I thought you might like the results. > >>> > >>> Rules: > >>> > >>> * the program should print "Hello, World!\n" and exit cleanly; > >>> * no "benchmark modes" that would hinder real-world use of the > >>> language > >>> are > >>> allowed; > >>> * no -e allowed: each program should run from its own file (source, > >>> bytecode > >>> or machine language as it may be.) > >>> > >>> > >>> I ran these on a fast, otherwise idle machine, doing 10 runs to warm it > >>> up, and > >>> then taking the median real time of 101 runs. (So yes, I like the > median > >>> more > >>> than the mean, when measuring things.) > >>> > >>> [cid] > >>> > >>> The choice of languages is arbitrary. C is compiled, Mono and Java are > >>> poor-man's-compiled, the rest is interpreted. As for Chicken, don't > >>> bother > >>> asking: there is but a 2ms difference between csi and csc -O4 -block. I > >>> would > >>> have included Clojure, as I find the language itself not without its > >>> merits, > >>> but the current implementation is 4 times slower than plain Java and > >>> skewed the > >>> graph badly ;-) > >>> > >>> So that pretty much settles the question for me! > >>> > >>> cheers, > >>> Tobia > >> > >> > >> This is very interesting. I would be interested to see haskell among > >> the set. > >> > >> -- > >> John Foerch > >> > >> > >> _______________________________________________ > >> Chicken-users mailing list > >> [email protected] > >> http://lists.nongnu.org/mailman/listinfo/chicken-users > >> > > > > -- > > Sent from my mobile device > > > > -- > Sent from my mobile device > > _______________________________________________ > Chicken-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/chicken-users >
_______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
