Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > speed benchmarks comparing Ruby to Py/Perl/PHP/etc?

Reply
Thread Tools

speed benchmarks comparing Ruby to Py/Perl/PHP/etc?

 
 
Ruby Baby
Guest
Posts: n/a
 
      02-19-2004
I know Ruby wasn't created to make a fast-running language.

But I just realized I've never seen any Ruby benchmarks, comparing
it to other languages under heavy load or speed.

Anyone seen some?

I ask for a real reason becuase it's under consideration to
replace PHP with Ruby on a high-traffic website I work with.


 
Reply With Quote
 
 
 
 
Gavin Sinclair
Guest
Posts: n/a
 
      02-19-2004
> I know Ruby wasn't created to make a fast-running language.
>
> But I just realized I've never seen any Ruby benchmarks, comparing it to
> other languages under heavy load or speed.
>
> Anyone seen some?


No.

> I ask for a real reason becuase it's under consideration to
> replace PHP with Ruby on a high-traffic website I work with.


As a complete non-expert, I suggest you try out FastCGI (just ask Ara
Howard) and squid (just to cache responses to take the heat off your app).
If those technologies are amenable to your application, it wouldn't
matter if you wrote it in Commodore 64 BASIC.

Cheers,
Gavin




 
Reply With Quote
 
 
 
 
Charles Comstock
Guest
Posts: n/a
 
      02-19-2004
If you run a search on google for The Great Programming Language Shootout it
shows performance graphs between a number of languages in a number of categories
including tight loops, number crunching, etc. I don't remember if php was
included though, perl and python were though. Actually that's a good
site to research how different languages approach certain problems as well.

Charles Comstock

On Thu, 19 Feb 2004, Gavin Sinclair wrote:

> > I know Ruby wasn't created to make a fast-running language.
> >
> > But I just realized I've never seen any Ruby benchmarks, comparing it to
> > other languages under heavy load or speed.
> >
> > Anyone seen some?

>
> No.
>
> > I ask for a real reason becuase it's under consideration to
> > replace PHP with Ruby on a high-traffic website I work with.

>
> As a complete non-expert, I suggest you try out FastCGI (just ask Ara
> Howard) and squid (just to cache responses to take the heat off your app).
> If those technologies are amenable to your application, it wouldn't
> matter if you wrote it in Commodore 64 BASIC.
>
> Cheers,
> Gavin
>
>
>
>
>


 
Reply With Quote
 
gabriele renzi
Guest
Posts: n/a
 
      02-19-2004
il Thu, 19 Feb 2004 13:20:58 +0900, Ruby Baby <(E-Mail Removed)> ha
scritto::

>I know Ruby wasn't created to make a fast-running language.
>
>But I just realized I've never seen any Ruby benchmarks, comparing
>it to other languages under heavy load or speed.
>
>Anyone seen some?
>
>I ask for a real reason becuase it's under consideration to
>replace PHP with Ruby on a high-traffic website I work with.



all the benchmarks out there (i.e. doug's shootout) are really
outdated. ruby seem to be slower than python or perl, but faster than
php. Anyway, an apache benchmark against each plain mod_* or fastcgi
solution would be really interesting
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      02-19-2004

"Ruby Baby" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> I know Ruby wasn't created to make a fast-running language.
>
> But I just realized I've never seen any Ruby benchmarks, comparing
> it to other languages under heavy load or speed.
>
> Anyone seen some?
>
> I ask for a real reason becuase it's under consideration to
> replace PHP with Ruby on a high-traffic website I work with.


There was an interesting post on this earlier, which seems to indicate
that Ruby *can* be an order of magnitude faster than PHP:
http://blade.nagaokaut.ac.jp/cgi-bin...uby-talk/86925

Regards

robert

 
Reply With Quote
 
Ruby Baby
Guest
Posts: n/a
 
      02-19-2004
> If you run a search on google for The Great Programming Language Shootout it
> shows performance graphs between a number of languages in a number of categories
> including tight loops, number crunching, etc.



How funny :

Perl, Python, Ruby all next to eachother - same results:

http://www.bagley.org/~doug/shootout/craps.shtml


(though this was 3 years ago)


 
Reply With Quote
 
gabriele renzi
Guest
Posts: n/a
 
      02-19-2004
il Thu, 19 Feb 2004 01:13:14 -0600, Charles Comstock
<(E-Mail Removed)> ha scritto::

>If you run a search on google for The Great Programming Language Shootout it
>shows performance graphs between a number of languages in a number of categories
>including tight loops, number crunching, etc. I don't remember if php was
>included though, perl and python were though. Actually that's a good
>site to research how different languages approach certain problems as well.
>
> Charles Comstock
>

it included php, but sadly to say, that shootout is abandoned.
it may be interesting, somehow, but ruby, as an exmaple changed a lot
from 1.6.6 to 1.8.1, even adding idiomatic faster ways to do things
(i.e. block parameters to build hashes or arrays.)

There is an effort (in early stage) to build a newer
benchmark/comparison framework at scutigena.sf.net if you're
interested in this kind of stuff
 
Reply With Quote
 
Ara.T.Howard
Guest
Posts: n/a
 
      02-19-2004
On Thu, 19 Feb 2004, Ruby Baby wrote:

> Date: Thu, 19 Feb 2004 13:20:58 +0900
> From: Ruby Baby <(E-Mail Removed)>
> Newsgroups: comp.lang.ruby
> Subject: speed benchmarks comparing Ruby to Py/Perl/PHP/etc?
>
> I know Ruby wasn't created to make a fast-running language.
>
> But I just realized I've never seen any Ruby benchmarks, comparing
> it to other languages under heavy load or speed.
>
> Anyone seen some?
>
> I ask for a real reason becuase it's under consideration to
> replace PHP with Ruby on a high-traffic website I work with.


we have done that. however, we also use fastcgi. using fastcgi should give
you around one to two orders of magnitude speedup (according to seige). when
this is done the speed of the actual lang is completely insignificant.

-a
--
================================================== =============================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL :: http://www.ngdc.noaa.gov/stp/
| TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done
================================================== =============================

 
Reply With Quote
 
Ara.T.Howard
Guest
Posts: n/a
 
      02-19-2004
On Thu, 19 Feb 2004, gabriele renzi wrote:

> Date: Thu, 19 Feb 2004 07:32:04 GMT
> From: gabriele renzi <(E-Mail Removed)>
> Newsgroups: comp.lang.ruby
> Subject: Re: speed benchmarks comparing Ruby to Py/Perl/PHP/etc?
>
> il Thu, 19 Feb 2004 13:20:58 +0900, Ruby Baby <(E-Mail Removed)> ha
> scritto::
>
> >I know Ruby wasn't created to make a fast-running language.
> >
> >But I just realized I've never seen any Ruby benchmarks, comparing
> >it to other languages under heavy load or speed.
> >
> >Anyone seen some?
> >
> >I ask for a real reason becuase it's under consideration to
> >replace PHP with Ruby on a high-traffic website I work with.

>
>
> all the benchmarks out there (i.e. doug's shootout) are really
> outdated. ruby seem to be slower than python or perl, but faster than
> php. Anyway, an apache benchmark against each plain mod_* or fastcgi
> solution would be really interesting


something like this was posted - about a year ago - but i cannot seem to find
it...

this thread is interesting though

http://groups.google.com/groups?hl=e...rg%26rnum%3D60

in particular

http://groups.google.com/groups?hl=e...rg%26rnum%3D60

i have fastcgi and the lastest php installed on my machine. i could run some
bencharks if i intalled mod_ruby and have good enough test suite. imho a good
test would hit a database and generate some dynamic html from some sort of
templating library.


i can tell you now though that:

[ahoward@www ahoward]$ ab -n 1024 http://127.0.0.1/env.fcgi | egrep Requests
Requests per second: 221.74 [#/sec] (mean)

[ahoward@www ahoward]$ ab -n 1024 http://127.0.0.1/env.cgi | egrep Requests
Requests per second: 9.98 [#/sec] (mean)

and

[ahoward@www ahoward]$ cat /usr/local/httpd/htdocs/env.fcgi
#!/usr/local/ruby-1.8.0/bin/ruby
require 'cgi'
require 'fcgi'

FCGI.each_cgi do |cgi|
content = ''
env = []
cgi.env_table.each{|k,v| env << [k,v]}
env.sort!
env.each{|k,v| content << %Q(#{k} => #{v}<br>\n)}
cgi.out{content}
end

[ahoward@www ahoward]$ cat /usr/local/httpd/htdocs/env.cgi
#!/usr/local/ruby-1.8.0/bin/ruby
require 'cgi'
require 'fcgi'

FCGI.each_cgi do |cgi|
content = ''
env = []
cgi.env_table.each{|k,v| env << [k,v]}
env.sort!
env.each{|k,v| content << %Q(#{k} => #{v}<br>\n)}
cgi.out{content}
end

eg. they are the same exact program, which is nice too. for me this shows
that fastcgi is 'fast enough', though i can appreciate the desire for more
extensive testing.

-a

--
================================================== =============================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL :: http://www.ngdc.noaa.gov/stp/
| TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done
================================================== =============================

 
Reply With Quote
 
Gavin Kistner
Guest
Posts: n/a
 
      02-19-2004
Ruby Baby wrote:
> But I just realized I've never seen any Ruby benchmarks, comparing
> it to other languages under heavy load or speed.
>
> Anyone seen some?


Vaguely related -- could someone confirm that the following suggestions
are still valid for Ruby 1.8+ (the test circa Ruby 1.6.6)

http://www.bagley.org/~doug/shootout/lang/ruby/
(See the bottom of the url for the few performance tips.)

Anyone have additional tips to add?

--
(-, /\ \/ / /\/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby Virtual Machine Benchmarks? M. Edward (Ed) Borasky Ruby 0 09-11-2006 02:10 AM
java vs c++ speed benchmarks Dimitri Ognibene Java 7 04-28-2006 11:12 PM
Comparing Linux C and C++ Compilers: Benchmarks and Analysis Scott Robert Ladd C Programming 8 09-20-2004 02:03 PM
Comparing Linux C and C++ Compilers: Benchmarks and Analysis Scott Robert Ladd C++ 6 09-18-2004 09:12 PM
speed speed speed a.metselaar Computer Support 14 12-30-2003 03:34 AM



Advertisments