Front page | perl.fwp |
Postings from November 2001
Re: Feel good benchmarks
Thread Previous
|
Thread Next
From:
Vladi Belperchinov-Shabanski
Date:
November 20, 2001 03:55
Subject:
Re: Feel good benchmarks
Message ID:
3BFA4444.FE77E7B8@biscom.net
hi,
the C demo at the end is out of topic, isn't it?
it was really interesting for me how performance changed
between perl versions and other languages (interpreters/
scripts/etc.) but C points just nothing (actually result
is quite obvious:))...
P! Vladi.
Michael G Schwern wrote:
>
> Some of you may get depressed thinking about all this bloat we've put
> into the language to drag it down.
>
> Well, I've developed a truely rigorous benchmark designed to show how
> far Perl has come:
>
> sub f {
> my($num) = shift;
> return $num if $num <= 1;
> return f($num-1) + f($num-2);
> }
>
> print f(25);
>
> bleadperl
> real 0m2.282s
> user 0m2.210s
> sys 0m0.010s
>
> Debian's 5.6.1
> real 0m2.643s
> user 0m2.510s
> sys 0m0.020s
>
> My own compiled 5.6.1
> real 0m2.141s
> user 0m2.080s
> sys 0m0.020s
>
> 5.005_03
> real 0m2.180s
> user 0m2.140s
> sys 0m0.010s
>
> 5.004_05
> real 0m2.342s
> user 0m2.140s
> sys 0m0.160s
>
> 5.004_04
> real 0m5.515s
> user 0m5.380s
> sys 0m0.110s
>
> 5.004
> real 0m5.542s
> user 0m5.340s
> sys 0m0.150s
>
> 5.003_07
> real 0m5.581s
> user 0m5.340s
> sys 0m0.200s
>
> So we're doing something right. And this lame benchmark might
> actually be useful in convincing some luddite 5.004_04 user to upgrade
> Perl.
>
> And for comparative purposes
>
> def f(num)
> return num if num <= 1
> return f(num-1) + f(num-2)
> end
>
> print f(25)
>
> Ruby 1.6.5
> real 0m2.225s
> user 0m2.190s
> sys 0m0.000s
>
> Oh dear. And it took one less line, too.
>
> And just to end this feel good email on a real downer:
>
> #include <stdio.h>
>
> int f (int num) {
> if( num <= 1 )
> return num;
> return f(num-1) + f(num-2);
> }
>
> int main (void) {
> printf("%d", f(25));
> }
>
> gcc 2.95.4
> real 0m0.077s
> user 0m0.030s
> sys 0m0.000s
>
> --
>
> Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
> Perl Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
> OH GOD!! It's LINUX! All you Linux fanboys go wild! It never crashes!
> It'll wash your underpants! It'll eat your dog for you, if you want your
> dog to be eaten! It'll make you attractive and smell good and... it'll...
> uh... uh. Man, I'm so sick of this shit.
> http://www.goats.com/archive/000602.html
--
Vladi Belperchinov-Shabanski <cade@biscom.net> <cade@datamax.bg>
Personal home page at http://www.biscom.net/~cade
DataMax Ltd. http://www.datamax.bg
Too many hopes and dreams won't see the light...
Thread Previous
|
Thread Next