Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Comparison Ruby, Python, Php, Groovy ecc.

Reply
Thread Tools

Comparison Ruby, Python, Php, Groovy ecc.

 
 
Marco Mastrodonato
Guest
Posts: n/a
 
      08-24-2009
Comparison script languages for the fractal geometry, these are the
languages i tested:

Java
Lua 5.1.4
Php 5.3.0
Python 2.6.2
Python 3.1.1
Jython 2.5.0
Groovy 1.6.3
Jruby 1.3.1
Ruby 1.9.1 p129
Ruby 1.8.6 p368
Ruby 1.8.6 p111
IronRuby 0.9.0
IronPython 2.0.2
Perl 5.10.0

Let me know yours comment

http://mastrodonato.info/index.php/2...metry/?lang=en
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Urabe Shyouhei
Guest
Posts: n/a
 
      08-24-2009
Are those executables compiled with identical compilers + compile flags?

Marco Mastrodonato wrote:
> Comparison script languages for the fractal geometry, these are the
> languages i tested:
>
> Java
> Lua 5.1.4
> Php 5.3.0
> Python 2.6.2
> Python 3.1.1
> Jython 2.5.0
> Groovy 1.6.3
> Jruby 1.3.1
> Ruby 1.9.1 p129
> Ruby 1.8.6 p368
> Ruby 1.8.6 p111
> IronRuby 0.9.0
> IronPython 2.0.2
> Perl 5.10.0
>
> Let me know yours comment
>
> http://mastrodonato.info/index.php/2...metry/?lang=en



 
Reply With Quote
 
 
 
 
Marc Heiler
Guest
Posts: n/a
 
      08-24-2009
Two things I notice.

It seems ruby 1.9 indeed managed to keep up with the python versions
more than the older ruby versions. And it seems to be (almost) as fast
as perl for that test.

The other thing, which is very strange, is that the ironruby
implementation is significantly slower than ironpython, whereas the
other versions arent by as much. What is wrong here?

IronRuby 0.9.0 6,038 39x
IronPyhon 2.0.2 0,978 6x

vs

Ruby 1.9.1 p129 2,688 18x
Python 3.1.1 1,566 10x
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Pascal J. Bourguignon
Guest
Posts: n/a
 
      08-24-2009
Urabe Shyouhei <(E-Mail Removed)> writes:

> Are those executables compiled with identical compilers + compile flags?


The question is understandable, but these implementation might very
well be written in different languages, so it doesn't really matter.
We can assume that they are as much as possible, if they come from a
common distribution.

> Marco Mastrodonato wrote:
>> Comparison script languages for the fractal geometry, these are the
>> languages i tested:
>>
>> Java
>> Lua 5.1.4
>> Php 5.3.0
>> Python 2.6.2
>> Python 3.1.1
>> Jython 2.5.0
>> Groovy 1.6.3
>> Jruby 1.3.1
>> Ruby 1.9.1 p129
>> Ruby 1.8.6 p368
>> Ruby 1.8.6 p111
>> IronRuby 0.9.0
>> IronPython 2.0.2
>> Perl 5.10.0
>>
>> Let me know yours comment
>>
>> http://mastrodonato.info/index.php/2...metry/?lang=en



I added a comment to the web site, but I'm not sure it was taken into
account (I didn't got the same feed back as for a second shorter
comment). So here it is again:


For completeness, could you please try Common Lisp too?

You could use sbcl 1.0.29 (MS-Windows port in progress) at:
http://prdownloads.sourceforge.net/s...ows-binary.msi


-------(bench1.lisp)----------------------------------------------------
(declaim (optimize (speed 3) (space 2) (debug 0) (safety 0)))
(declaim (ftype (function (single-float single-float) fixnum) iterate))

(defparameter *bailout* 16.0)
(defparameter *max-iterations* 1000)


(defun bench1 ()
(format t "Rendering...~%") (force-output)
(loop :for y fixnum :from -39 to 39 :do
(terpri)
(loop :for x fixnum :from -39 to 39 :do
(princ (if (zerop (iterate (the single-float (/ x 40.0))
(the single-float (/ y 40.0))))
"*"
" "))))
(finish-output))

(defun iterate (x y)
(declare (single-float x y))
(loop
:with cr single-float = (- y 0.5)
:with ci single-float = x
:with zi single-float = 0.0
:with zr single-float = 0.0
:for i fixnum :from 0 :below *max-iterations*
:do (let ((temp (* zr zi))
(zr2 (* zr zr))
(zi2 (* zi zi)))
(declare (single-float temp zr2 zi2))
(setf zr (+ (- zr2 zi2) cr)
zi (+ temp temp ci))
(when (< (the single-float *bailout*) (the single-float (+ zi2 zr2)))
(return-from iterate i)))
:finally (return-from iterate 0)))


(time (bench1))
------------------------------------------------------------------------

Run the test with:

sbcl --no-userinit --eval '(load (compile-file "bench1.lisp"))' --eval '(quit)'

--
__Pascal Bourguignon__
 
Reply With Quote
 
Urabe Shyouhei
Guest
Posts: n/a
 
      08-24-2009
Pascal J. Bourguignon wrote:
> Urabe Shyouhei <(E-Mail Removed)> writes:
>
>> Are those executables compiled with identical compilers + compile flags?

>
> The question is understandable, but these implementation might very
> well be written in different languages, so it doesn't really matter.
> We can assume that they are as much as possible, if they come from a
> common distribution.


It does matter very much. At least identical ones should be used for each
underlying languages to write them. The report says that test was held on
Windows XP, so I suspect there is no such thing as "a common distribution" on it.

 
Reply With Quote
 
Marco Mastrodonato
Guest
Posts: n/a
 
      08-24-2009
Urabe Shyouhei wrote:
> Are those executables compiled with identical compilers + compile flags?


Ruby p111 is mswin32 (onclick installer) the others are mingw32
downloaded from http://rubyinstaller.org/downloads/
Iron and java version, Python, groovy, php ...was been downloaded from
main site. The perl's exe is strawberry's installation. Java was been
compiled by netbeans.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Marco Mastrodonato
Guest
Posts: n/a
 
      08-24-2009
Marc Heiler wrote:
> Two things I notice.
>
> It seems ruby 1.9 indeed managed to keep up with the python versions
> more than the older ruby versions. And it seems to be (almost) as fast
> as perl for that test.
>
> The other thing, which is very strange, is that the ironruby
> implementation is significantly slower than ironpython, whereas the
> other versions arent by as much. What is wrong here?
>


1. Python is still faster, but version 1.9.1 goes very well catching up
good results, goes better than perl, its script was been very optimized
to get that result, 2.7s against 4s of the normal version.

2. I think there aren't correlation between these versions: Ironruby,
ironpython, ruby and python are different projects and with different
development.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Urabe Shyouhei
Guest
Posts: n/a
 
      08-24-2009
Marco Mastrodonato wrote:
> Urabe Shyouhei wrote:
>> Are those executables compiled with identical compilers + compile flags?

>
> Ruby p111 is mswin32 (onclick installer) the others are mingw32
> downloaded from http://rubyinstaller.org/downloads/
> Iron and java version, Python, groovy, php ...was been downloaded from
> main site. The perl's exe is strawberry's installation. Java was been
> compiled by netbeans.


So the next thing you should do is to recompile by yourself to uniform
compilation environment among them. Fairness is the most essential part when
you want to do an emotional Yo-Yo on a benchmark like that.

And luckily, all implementations nominated are open sourced.

 
Reply With Quote
 
Marco Mastrodonato
Guest
Posts: n/a
 
      08-24-2009
Pascal J. Bourguignon wrote:
> I added a comment to the web site, but I'm not sure it was taken into
> account (I didn't got the same feed back as for a second shorter
> comment). So here it is again:
>
>
> For completeness, could you please try Common Lisp too?


I got only the second comment, anyway, i'll add lisp asap and thanks for
your work
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
lith
Guest
Posts: n/a
 
      08-24-2009
> Lua 5.1.4

Does this make use of the lua jit[1]?

BTW I'm not so sure that the type statements in groovy make the code
run faster. IIRC with older versions they simply introduced type
checks that had the adverse effect.

[1] http://luajit.org

 
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
What are your views on the Groovy Programming Language? Danno Java 4 01-25-2007 02:51 PM
Groovy for desktop apps sunshine Java 1 01-24-2007 02:00 AM
Groovy 1.0 raffaele.castagno@gmail.com Java 1 01-08-2007 07:48 AM
Groovy experience ? =?ISO-8859-2?Q?Dra=BEen_Gemi=E6?= Java 6 07-17-2006 07:18 PM
Groovy time waster Whiskers Computer Support 38 05-28-2006 08:10 PM



Advertisments