6 ms·
That page shows Perl as being roughly 5% slower than Ruby, however when comparing Ruby and Perl directly, things look significantly different: http://benchmark
by Mithaldu 14y ago
That page shows Perl as being roughly 5% slower than Ruby, however when comparing Ruby and Perl directly, things look significantly different:
http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=perl&lang2=yarv http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...
So i have to say i am quite suspicious of the chart on the page you linked.
- igouy 14y agoAre you suspicious that you may not have understood what is shown? Do both show the same thing?
- Mithaldu 14y agoIn fact, i know i do not understand how the table on this page is generated: http://benchmarksgame.alioth.debian.org/u32/which-programs-are-fastest.php?gcc=on&gpp=on&ifc=on&java=on&v8=on&hipe=on&jruby=on&php=on&python3=on&yarv=on&perl=on&calc=chart http://benchmarksgame.alioth.debian.org/u32/which-programs-a... That is precisely why i am suspicious. I cannot say for a fact that it is deceptive, but it certainly seems deceptive. On that page Ruby is being shown as 10% faster than Perl. Yet on the direct comparison page things look quite different: http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=perl&lang2=yarv http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te... On that page, for all benchmarks that can be compared, Perl has used an overall time of 9255 seconds, while Ruby has used an overall time of 10662 seconds. As such Ruby is actually 10% slower than Perl. Where does this difference come from?
- igouy 14y ago>> but it certainly seems deceptive << You go too far -- your lack of understanding is simply your lack of understanding ;) What are you told the table shows? >> Where does this difference come from? << Check the same thing for 2 other language implementations were the arithmetic should be easy. For example, Java median 2.04 and Smalltalk median 21.22 -- the direct comparison shows 11x as the rounded median of the Smalltalk/Java program times.
- Mithaldu 14y agoSo, basically: Because Perl is considerably slower in one single comparison, even though it is faster in 7 others, it gets judged as slower overall? Seems like your graphs up top in the language versus language comparison need to be reworked to make it clear how bit the difference in reality between x3 and 1/3 is, because right now it is deceptive.
- Mithaldu 14y agoPS: The source doesn't show here: http://benchmarksgame.alioth.debian.org/u32/program.php?test=binarytrees&lang=perl&id=1#log http://benchmarksgame.alioth.debian.org/u32/program.php?test...
- Mithaldu 14y agoAnother addendum, i'm not sure i'm getting what's happening here: If i calculate the average of the time perl took divided by the time ruby took, i get this: ((226/724)+(5.35/16.8)+(3/9)+(2750/3960)+(1120/1368)+(3236/3837)+(30.5/35.8)+(939/618)+(263/135)+(662/214))/10 = 1.07 Which i understand to mean that perl on average took 7% longer. ----- However if i turn this around i get: ((724/226)+(16.8/5.35)+(9/3)+(3960/2750)+(1368/1120)+(3837/3236)+(35.8/30.5)+(618/939)+(135/263)+(214/662))/10 = 1.58 Which i interpret to mean that Ruby took, on average, 58% longer. ------ These things contradict and i made some mistake here. Can you clear up what i should've been doing?
- 14y ago
- draegtun 14y agoTake away those last three benchmarks (spectral-norm, fasta & binary-trees) then things do look quite different. For eg: Here is Which programs are best with those benchmarks removed: http://benchmarksgame.alioth.debian.org/u32/which-programs-are-best.php?gpp=on&ifc=on&java=on&ghc=on&sbcl=on&csharp=on&v8=on&dart=on&hipe=on&lua=on&vw=on&php=on&jruby=on&python3=on&perl=on&xfullcpu=1&xmem=0&xloc=0&nbody=1&fannkuchredux=1&meteor=0&fasta=0&fastaredux=1&spectralnorm=0&revcomp=1&mandelbrot=1&knucleotide=1®exdna=1&pidigits=1&chameneosredux=0&threadring=0&binarytreesredux=0&binarytrees=0&calc=chart http://benchmarksgame.alioth.debian.org/u32/which-programs-a... This shows Perl higher up the chart with it being 49% better (on average) than Ruby. Some other things to note: 1. Perl has never been fast with binary trees. But Ruby 1.8 is even worse (I recall it being many times slower than Perl at this). So hats off to the Ruby 1.9 VM guys because they've turned things around and now it's even out pacing Lua on this benchmark! - http://benchmarksgame.alioth.debian.org/u32/performance.php?test=binarytrees http://benchmarksgame.alioth.debian.org/u32/performance.php?... 2. Fasta in Ruby maybe twice quicker than Perl however it uses over 100 times more memory! This is be because it's inlining some code (eval) giving it a huge speed bump at expense of a bigger program footprint. If I do a port of this to Perl then this fasta.pl runs 2.6 times faster than alioth's perl version (which now means the Ruby version is about 30% slower than it's direct equivalent Perl version). 3. My make_repeat_fasta idiomatic subroutine is actually a little slower than the one in fasta.pl on alioth. So both my fasta.pl & alioth's fasta.rb programs could be speeded up more :) 4. I may even be able to shave a little bit more off fasta.pl time. Same might be true for spectral norm & binary-tree however the Perl versions aren't showing up on alioth site at moment :( ... IIRC, when I last looked at the perl binary-trees code on alioth a couple of years ago I was able to shave 10% off. ref: My perl port of fasta.rb on alioth - https://gist.github.com/4675254 https://gist.github.com/4675254
- Mithaldu 14y agoFrankly, i'm not convinced there's any point in investing time on improving the benchmarks there, considering the overall comparison directly contradicts the detailed comparison, by putting perl in a worse position than languages it outperforms.
- 14y ago