From: "Larry J. Elmore" Date: 2001-01-11T13:10:02+09:00 Subject: [ruby-talk:9101] Re: Interesting Language performance comparisons - Ruby, OCAML etc In article <3A578D5F.9080809@earthlink.net>, "Charles Hixson" wrote: > Phil Tomson wrote: >> >> Seems that Ruby is already doing pretty well in this particular suite >> of tests. And there probably is room for some improvement in some of >> these tests. > > In fact, every language that is faster than C causes me to wonder > about the C code/compiler. Only assembler should be able to be > faster than C. And even that should take a lot of hand optimization. That's a common misconception. The more information about a program that an optimizing compiler has available, the easier it is to produce highly-optimized code. Because of this, it is actually a good deal more difficult to write a highly-optimizing compiler for C than for some other languages. I suspect that's one reason OCaML does so well. That's why for numeric code, Fortran is still king. CMUCL, the CMU Common Lisp compiler, is extremely efficient and can easily come within 50% of the speed of C, and with care, can come roughly to par on some tasks. I haven't looked at the source code, but just from its reported relative performance in these benchmarks, I'm almost certain that most of the code must be quite naive. When I have more time, I'll see how much that code can be improved and submit better versions to the site. Most implementations of Common Lisp are native-compiled and quite fast. Is there any reason Ruby couldn't be? Except that porting it would be much, much harder, I don't see any insurmountable obstacles. The gain might not be worth the effort, though. Larry