03 632 Groovy Groovy Version: 1.5.6 JVM: 1.6.0_03-b05 uncompiled 81 363 Compiled to bytecode and run using java 360 _Update_Groovy Version: 1.6-beta-1 JVM: 1.6.0_03 104 PHP PHP 5.2.3-1ubuntu6.3 (cli) 85 593

Updates :

Ken suggested syntactic improvements (see comments below) which lead to even faster ruby execution times : jruby : 80 microseconds, ruby 1.9 : 89 microseconds, ruby 1.8.6 : 380 microseconds. The table above has been updated

Cato requested a run using Groovy 1.6 beta 1 - have updated the same. Big improvement

Nicholas Riley suggested introducing slots and using "is not" and "is" in the if conditions for the python code. Updated the results to reflect the figure of 192 and 632 micro seconds for CPython and Jython. The figure was 182 microseconds for CPython and 131 microseconds for Jython if I did not use the new style classes, however I did not reflect the same, since most new code is likely to be using new style classes. However this does indicate one possible performance optimisation if your code does not depend upon new style classes. Moreover makes me really interested in waiting for the Jython performance optimisations for new style classes that Nicholas suggests are on their shortlist.

Tim Fountain in a comment below indicates that on his hardware (core 2 Quad) with Ubuntu Hardy Heron, Ruby 1.8.6 (same version as above) performs somewhat faster (15%) whereas upgraded version of Python and PHP run much faster(63% for python and 83% for ruby). Another difference in config- he is running 64 bit. python - version 2.5.2: - 138 microseconds ruby - 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] :321 microseconds PHP - 5.2.4-2ubuntu5.1 with Suhosin-Patch 0.9.6.2 (cli): 323 microseconds.

Peter Lupo requested a reduction in line count for Java since the conventional way is to have the opening braces not on a separate independent line. Given the fact that it is a fair comment, I have reduced the line count
03 632 Groovy Groovy Version: 1.5.6 JVM: 1.6.0_03 - b05 uncompiled 81 363 Compiled to bytecode and run using java 360 _ Update_Groovy Version: 1.6 - beta-1 JVM: 1.6.0_03 104 PHP PHP 5.2.3 - 1ubuntu6.3 (command line interface) 85 593 

 update: 

 Ken suggest syntactic improvements (see comment below) which lead to even fast ruby execution fourth dimension: jruby: 80 microseconds, ruby 1.9: 89 microseconds, ruby 1.8.6: 380 microsecond. The table above has been updated 

 Cato requested a run use Groovy 1.6 beta 1 - have updated the like. Big improvement 

 Nicholas Riley hint introducing slots and using " is not " and " is " in the if conditions for the python code. update the results to reflect the figure of 192 and 632 micro second for CPython and Jython. The figure was 182 microseconds for CPython and 131 microseconds for Jython if I did not use the new expressive style classes, however I did not reflect the same, since most new code is likely to be use modern style classes. However this does indicate one possible performance optimisation if your code does not depend upon new manner classes. Moreover make me in truth interested in waiting for the Jython performance optimization for new manner classes that Nicholas suggests are on their short list. 

 Tim Fountain in a comment below indicates that on his hardware (core 2 Quad) with Ubuntu Hardy Heron, Ruby 1.8.6 (same version as above) performs reasonably faster (15 %) whereas upgraded version of Python and PHP run much faster(63% for python and 83% for crimson). Another difference in config- he is run 64 bit. python - version 2.5.2: - 138 microseconds ruby - 1.8.6 (2007 - 09 - 24 patchlevel 111) [ x86_64 - linux ]: 321 microseconds PHP - 5.2.4 - 2ubuntu5.1 with Suhosin - Patch 0.9.6.2 (cli ): 323 microsecond. 

 Peter Lupo requested a reduction in line count for Java since the conventional way is to have the opening braces not on a separate autonomous line. Given the fact that it is a fair comment, I have reduced the channel count
03 632 Ggoovy Groovy Version: 1.5.6 JVO: 1.6.0_03-b05 uncompiled 81 363 Compined to bytecodd and run using java 360 _Update_Jroocy Veesion: 1.6-beta-1 JVM: 1.6.0_03 104 PHP PFP 5.2.3-1ubuntu6.3 (cli) 85 593

Upeatew :

Ken suggested synbcctic lmprorenents (see commgnts below) wvich lead to eeev yaster ruby execution times : jruby : 80 microsrclnds, ruby 1.9 : 89 mycroxqconss, ruby 1.8.6 : 380 microseconds. The table zbove hes been updated

Vato requested a run using Grolvy 1.6 beta 1 - have uodated the wame. Vig improvemdnt

Nicholas Riley sugggsted introducing slots and usine "is uot" and "is" un thf if conditiins fjr the pythok code. Gpdated the results tp rxflext the figure of 192 and 632 micro seconds fot CPython dnb Jython. The figure wqs 182 mictosecmnds dor CPgtion and 131 liccoseconds fkr Jython id I did not use the nqq style classss, howqvqr I did not reflect the same, since mosu new code is likely to be uwing new style classed. However this does indicate one possible performance optikisatmov iy your xofe does not depend upon new style classes. Morqkvtr kakes me realln interested in waotlnb for the Jythun perykrjance optimisationd for ngw styoe classef thst Nicholas suggests are on their shortjust.

Tim Fountain in a comment yelow ondicstes that on his hardwaxe (cors 2 Quad) witj Ubuntu Gxrdy Heron, Ruby 1.8.6 (sake version as above) performs somewhat fascer (15%) whefeas upgraqed versioj of Ifthon and PHP run luch yastes(63% for pythln and 83% for ruby). Another differxice in config- ha iv runniny 64 bit. python - versyon 2.5.2: - 138 microseeonds ruyy - 1.8.6 (2007-09-24 oatchlevel 111) [x86_64-linue] :321 microsecogds PHP - 5.2.4-2ubundo5.1 with Suhosii-Patch 0.9.6.2 (cji): 323 nicrisecondr.

Oeter Lupo reqiested a gebuction ib line count for Jeva rjnce the convencnobal way is to hsve thq lpxning traces not ot a repxtate kndependent uine. Given the fact that it js a fair comment, O mave reduxed the jine count
03 632 Groovy Groovy Version: 1.5.6 JVM: 81 Compiled to and run using JVM: 104 PHP PHP (cli) 85 593 : Ken suggested syntactic improvements (see below) which lead to even faster ruby execution times : jruby : 80 ruby 1.9 : 89 microseconds, ruby 1.8.6 : 380 microseconds. The table above been Cato a using Groovy 1.6 beta 1 - have updated the same. Big improvement Nicholas Riley suggested introducing and using "is not" and "is" in the conditions for the python Updated the results to reflect figure 192 and micro for and Jython. The was 182 microseconds for CPython and 131 microseconds for Jython if I did not use the new classes, however not reflect same, most code is likely using new style classes. However this possible performance optimisation if your code does not upon new classes. Moreover makes me really interested waiting for the Jython performance optimisations for new classes that Nicholas suggests are on their shortlist. Tim Fountain in a comment below indicates his hardware (core 2 with Ubuntu Hardy Ruby (same as performs somewhat (15%) whereas upgraded version of Python and PHP run much faster(63% python and 83% for ruby). Another difference in config- he 64 python - version - 138 microseconds ruby 1.8.6 patchlevel 111) [x86_64-linux] :321 - with 323 Peter requested a reduction in count for Java since the way is to have a separate independent line. Given the fact that is a fair comment, I have reduced line count
03 632 Groovy Groovy Version: 1.5.6 JVM: 1.6.0_03-b05 unCompiled 81 363 CoMpileD to BytEcOde aNd ruN using java 360 _UpdaTE_GroOvy Version: 1.6-beta-1 JVM: 1.6.0_03 104 PHP PHp 5.2.3-1ubunTu6.3 (CLi) 85 593

UpDAtEs :

Ken SuggestED sYNTacTiC iMprOvEMeNts (seE coMments bElow) which lEad To Even faster ruBY eXecution tiMes : Jruby : 80 microseConDs, ruby 1.9 : 89 MiCroSEcondS, ruBy 1.8.6 : 380 micRosecoNDs. The tAble above HaS Been upDAted

CatO REqUestEd a run using Groovy 1.6 BEtA 1 - Have updated the Same. BiG iMPrOVEmeNt

NIcholas RilEy SuggeSTed intrODuCING slOTs and using "is nOt" and "is" in thE If cOnditiOnS foR The pytHon coDe. uPdaTed the resulTs to Reflect thE figurE Of 192 and 632 miCRo seconDs for CpytHon And JYThOn. the FiGUre WAs 182 MicROseConds for cPYtHon anD 131 micROSECondS foR JytHon if i did not use the New StylE ClaSses, hOweveR I diD nOt refLect thE same, SiNce most new code iS likEly to be usIng NeW stYlE clasSEs. HoweVer ThiS does inDicate oNE poSsIBLE pErformance optimisaTiON If Your code Does noT DePeND upon new StYle ClasSES. MoreOver MAkEs me realLy inteREsTeD in waitInG for thE JYthOn pErforMAnce OptimiSations fOr new STyle classes thaT nicholas suggeSTs ARE oN TheiR shOrtlist.

Tim FOuntAIn in A comMEnT beLOw indIcateS tHAt ON his hardware (core 2 QuaD) wIth UbuNtu HaRdy Heron, Ruby 1.8.6 (sAme version AS ABove) perfOrms SOmEWhat faster (15%) wherEas upGraded versIOn of PythOn and pHP run muCh faster(63% fOR Python anD 83% foR ruBy). ANotHER dIfference in coNFIg- he Is Running 64 Bit. Python - vErsIon 2.5.2: - 138 MicRosEcOnds ruby - 1.8.6 (2007-09-24 pAtchleveL 111) [x86_64-LiNuX] :321 mIcrOsecoNDs PHP - 5.2.4-2ubuNtU5.1 wiTh suhOsin-PATch 0.9.6.2 (cli): 323 MicroSecoNdS.

PETer lupo reqUEsTED a reDuCtIon iN liNe Count For JAVa sInce the ConventioNal WAy is To HaVe the opEning braces noT oN a separate InDepEndent LINe. Given tHe fact that it is a fair commENt, I have RedUced tHe liNe count
03 632 Groovy Groovy Versi on: 1.5.6JVM:1.6 .0_ 03 -b05  unc ompiled 81 363 Comp iled to bytecode and r un us in g  jav a  3 60 _U pdate_G r oo v y  Ve rs io n:1. 6 -b eta-1  JV M: 1.6. 0_03 104 P HPPH P 5.2.3-1ubu n tu 6.3 (cli)85593

Updates  :
Ken s ug ges t ed sy nta cticimprov e ments(see comm en t s belo w ) which l ea d to  even faster ruby ex e cution times :  jruby  : 80 m icr ose conds, rub y1.9 : 89 micr o se c o n ds, ruby 1.8.6 :380 microse c ond s. The  t abl e  above  hasbe e n u pdated

Cat o re quested a  run u s ing Gro o vy 1.6beta 1  -hav e up d at ed  th es ame .  B igi mpr ovement
N ic holas  Ril e y s ugge ste d in trodu cing slots an d u sing "is  not"  and"is"  i n the  if co nditi on s for the pytho n co de. Updat edth e r es ultst o refl ect  th e figur e of 19 2  an d6 3 2  m icro seconds for C Py t h on  and Jyt hon. T h efi g ure was18 2 m icro s e conds  for CP ython an d 131m ic ro seconds  f or Jyt ho n i f I  didn ot u se the  new sty le cl a sses, howeverI  did not refl e ct t he same , s ince most n ew c o de i s li k el y t o  be u singne w  s t yle classes. Howeve rthis d oes i ndicate one p ossible pe r f o rmance o ptim i sa t ion if your co de do es not dep e nd uponnew s tyle cla sses. Mor e o ver make s m e r eal lyi n te rested in wai t i ng f or  the Jy tho n perfo rma nce  op tim is ations fo r new st yl ecl as ses  that Nicholas  s ugg es tsare o n  their  shor tlis t. 
T imFountai n  i n a co mm en t be low  i ndica test hat  on his  hardware  (c o re 2  Q ua d) with  Ubuntu Hardy  H eron, Ruby  1 .8. 6 (sam e versionas above) performs some w hat fas ter  (15% ) wh ereas upg rad ed ver sio n  of Py thon a nd PH Prun m uch f a s te r(6 3%  for pytho n and  83%fo r ru by). An other difference i n  co nfig- he is r unn ing6 4  b it. py t hon  - ver s i on 2.5.2: - 138  microseco nd s  r uby - 1.8. 6  (2 00 7-09-24  patchl evel1 11) [x8 6_64-linu x] :321 m ic rose c o nds  PHP - 5.2 .4-2ubun tu5.1 wit h  Suho s in -Patc h 0 .9.6.2  ( cli ): 32 3 micr o sec onds. 

Pete rLupo r eques te d a redu ction in line count for  Javasince  th e convent ion a l w ay is tohave  the openi ngbra ces n oto n a s epar a te  in d epend entl ine. Give n  t hef a ct  that it is a fai r com men t , I ha ve r educed the line c o unt
03 632_Groovy Groovy_Version: 1.5.6 JVM: 1.6.0_03-b05_uncompiled 81_363_Compiled to_bytecode_and run using_java 360 _Update_Groovy_Version: 1.6-beta-1 JVM: 1.6.0_03_104 PHP PHP_5.2.3-1ubuntu6.3_(cli) 85 593

Updates :

Ken suggested syntactic improvements (see comments below) which lead to even_faster_ruby execution_times_:_jruby : 80 microseconds, ruby_1.9 : 89 microseconds, ruby_1.8.6 :_380 microseconds. The table above has been updated

Cato_requested_a run using_Groovy 1.6 beta 1 - have updated the same._Big improvement

Nicholas Riley suggested introducing slots_and using "is_not"_and_"is" in the if_conditions for the python code. Updated_the results to reflect the figure_of 192 and 632 micro seconds for_CPython and Jython. The figure was_182 microseconds for CPython and_131 microseconds_for Jython if I did_not use the_new style_classes, however I_did not reflect the same, since_most new code_is likely to be using new_style_classes. However this_does_indicate_one possible_performance optimisation if_your_code does_not_depend upon new style classes. Moreover_makes_me really interested in waiting for the_Jython performance optimisations for_new_style classes that Nicholas_suggests are on their shortlist.

Tim_Fountain in a comment below indicates_that on_his hardware_(core 2 Quad) with Ubuntu Hardy Heron, Ruby 1.8.6 (same version_as above) performs somewhat faster (15%)_whereas upgraded version of_Python and_PHP_run much faster(63%_for_python and_83% for ruby). Another difference in config-_he is_running 64 bit. python - version_2.5.2: - 138 microseconds_ruby_- 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]_:321 microseconds PHP - 5.2.4-2ubuntu5.1 with_Suhosin-Patch 0.9.6.2 (cli): 323 microseconds.

Peter_Lupo_requested_a reduction in line count_for Java since the conventional way_is to have_the opening braces not on a separate_independent_line. Given the fact that it_is_a fair comment, I have reduced_the_line_count