Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This sums up my feelings for the benchmarks:

http://shootout.alioth.debian.org/u64q/benchmark.php?test=fa...

Note that the "alternative" Lisp SBCL and Java 7 programs both outperform Fortran.

Of course I agree with you on wtf-moments. WTF makes Ruby take an hour, and SBCL take 10 seconds? That's two orders of magnitude! But no matter, I imagine a more clever Ruby programmer could reduce that, or just call out to a native library.



>>Note that the "alternative" ...<<

A program that simply switched according the command line arg and then printed:

    3968050
    Pfannkuchen(12) = 65
:would also out perform :-)

>>I imagine a more clever Ruby programmer could reduce that...<<

Is "a more clever Ruby programmer" some kind of equivalent to "a sufficiently smart compiler"? :-)

>>or just call out to a native library<<

When is a Ruby program fast? When it's written in C ;-)


> A program that simply switched according the command line arg and then printed…

Of course making programs do less can improve speed, and a great way of doing that is compile-time computation via macros! You can finish the program before it's even run.

> Is "a more clever Ruby programmer" some kind of equivalent to "a sufficiently smart compiler"?

No, since we assume human intelligence here. :P As the Graphics Programming Black Book puts it in the Chapter 1 title, "The Best Optimizer is between Your Ears".

> When is a Ruby program fast? When it's written in C ;-)

I'm going to use this one.


I've spent enough time asking for programs for the benchmarks game in Ruby forums, to start to doubt whether the "more clever Ruby programmer" will ever come forward ;-)

Maybe "a more clever Ruby programmer" always drops-down to C?

Maybe there's only a more clever Rails programmer :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: