Live data from Hacker News

Ruby Fibonacci Shootout

christopherroach.com

1–10 of 15 posts

Re: Ruby Fibonacci Shootout

#3
I don't think this "CPU Intensive" task is the kind of CPU-intensive task you actually care about. I haven't done any formal experimentation, but I'm guessing this is a better test of how many instructions are generated for a call/ret sequence, and not how well normal CPU-intensive operations would work. I would think some code that did a fair amount of number crunching/lookups in a tight loop would be a much better test.

But, then again, it doesn't really matter. Is Ruby fast enough to work for most uses? Yes. If you really, really, really care about execution speed, would you use Ruby? I don't know. If you care that much about execution speed, you will probably do more benchmarks than I care to think of.

Re: Ruby Fibonacci Shootout

#5

Huh? Where's the results? Or are readers supposed to run the code and send their results or something? But there's no timing check in the code he posted anyway.

They don't render in IE (tested in 8); it cuts the article in half.

Re: Ruby Fibonacci Shootout

#6
Ported this to scala (I know, I didn't do this functionally, this is a pretty straight port of the C example), ran in 4 seconds (of course, I've got about a bajillion other apps open right now, so take this with a grain of salt):

     object Main {
        def fib(n : int) : int = {
            if(n  "+fib(i).toString)
            }
        }
     }

Re: Ruby Fibonacci Shootout

#8
post #5

Huh? Where's the results? Or are readers supposed to run the code and send their results or something? But there's no timing check in the code he posted anyway.

They don't render in IE (tested in 8); it cuts the article in half.

Or firefox mac. OK, now I looked at it through safari and I can see it.
Post reply on HN