Lothar Scholz ha scritto:
> Hello gabriele,
> 
> gr> "</script> ha scritto:
> 
>>>I took a look at
>>>http://shootout.alioth.debian.org/benchmark.php?test=all&lang=ruby&lang2=python&sort=fullcpu
>>>and found the tests on ruby disapointing :(.
>>>So what I'm asking for is a link to some ruby-specific optimisation tips.
> 
> 
> gr> a simple thing: do the most normal thing instead of writing code in ruby
> gr> that is innatural, i.e. instead of rewritine an heapsort by hand, use
> gr> the builtin sort/sort!/sort_by routines. Instead of writing a random
> gr> function by hand, use the builtin rand().
> 
> Sorry you don't understand this benchmark. It is there to do this
> algorithms to compare the basic data operations.

I understand the benchmark.
I'm just saying that it shows "you should not implement X in ruby" not 
that "X takes a lot of time in ruby" since you may not need to implement 
X (i.e. because it is already there or because you would not actually 
ever need a recursive floating point function).

> The benchmark is not useable to compare compiled languages with
> interpretered, but comparing python with ruby is a valid comparision.
 >
> And that ruby is so worse then python is a real problem. If you still
> try to deny this, then you have a real mental problem.

I don't think I did

> If ruby is 9 times slower then python in for example function calling intensive
> code that means that ruby will slow down your development time a lot
> as it forces you to use optimized code or even C code much more often
> then python.

I agree, It would be nice if ruby was faster. Luckily,
people are working on this.