From: Florian Frank Date: 2005-06-22T08:23:52+09:00 Subject: Re: 1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Glenn Parker wrote: > Well, I think it's valid to make the comparisons every once in a > while, since it highlights a weakness that Ruby implementations will > have a hard time overcoming on their own. When you lag behind Perl by > a factor of two on *everything*, then you have a real problem. Not in everything, only in the stupid "comparisons" and "benchmarks" the trolls keep posting here. Compare the Ruby version (flori@lambda:~ 0)$ time ruby -e 'class A; def initialize(a,b) @a, @b = a, b end ; attr_accessor :a, :b; end ; 1_000_000.times { o = A.new(1, 2); o.a; o.b; o.a = 2 ; o.b = 2 }' real 0m3.838s user 0m3.822s sys 0m0.009s to the wonderful Perl version here: (flori@lambda:~ 0)$ time perl -e 'package A; sub new { my $p = $_[0]; my $c = ref $p || $p; bless { "a" => $_[1], "b" => $_[2] } => $c } sub a { @_ == 1 ? $_[0]->{a} : ($_[0]->{a} = $_[1]) } sub b { @_ == 1 ? $_[0]->{b} : ($_[0]->{b} = $_[1]) }; package main; for (1..1_000_000) { my $o = A->new(1, 2); $o->a ; $o->b; $o->a(2); $o->b(3) }' real 0m9.420s user 0m9.420s sys 0m0.002s And this doesn't include the qualitytime you can spent debugging Perl, while tracking down cyclic references in your object graph, or finding missing reference counter decreases in your extensions. -- Florian Frank