1 : At a glance - Are the Perl programs faster?

Each chart bar shows, for one unidentified benchmark, how much the fastest Perl program used compared to the fastest Ruby program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Approximately - Are the Perl programs faster?

Each table row shows, for one named benchmark, how much the fastest Perl program used compared to the fastest Ruby program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Perl used what fraction? used how many times more? 
Benchmark Time Memory Code
 pidigits1/3 ±
 reverse-complement1/3±
 spectral-norm1/2 1/2
 k-nucleotide †1/2±
 fasta± ±
 fasta-redux± ±
 fannkuch-redux± 1/3
 regex-dna±±±
 mandelbrot 1/2
 n-body ±
 binary-trees1/2
 Perl used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/31/31/2±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Measurements - Are the Perl programs faster?

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Perl program are shown for comparison against measurements of the fastest Ruby program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 pidigits 
Perl3.483.484,392261  1% 0% 100% 1%
Ruby11.1911.21147,748242  1% 0% 100% 1%
 reverse-complement 
Perl2.742.74375,760284  1% 0% 0% 100%
Ruby8.388.39131,808255  0% 1% 0% 100%
 spectral-norm 
Perl190.7749.439,540551  96% 96% 99% 96%
Ruby392.71102.0140,236828  96% 97% 96% 96%
 k-nucleotide 
Perl221.4368.001,067,916472  69% 68% 97% 92% †
Ruby109.07109.11503,176449  0% 1% 1% 100% †
 fasta 
Perl105.80105.8352,320838  1% 1% 0% 100%
Ruby156.52158.177,216987  18% 25% 23% 36%
 fasta-redux 
Perl77.1777.193,456854  1% 0% 0% 100%
Ruby114.38114.48248,948772  0% 1% 9% 92%
 fannkuch-redux 
Perl2,297.64577.7010,976565  100% 99% 100% 99%
Ruby3,110.09799.6428,5321426  97% 97% 98% 98%
 regex-dna 
Perl27.169.70142,492527  76% 75% 77% 54%
Ruby27.989.46106,548529  64% 68% 92% 72%
 mandelbrot 
Perl3,071.86769.0043,400579  100% 100% 100% 100%
Ruby1,974.54494.4062,6361019  100% 100% 100% 100%
 n-body 
Perl1,080.051,080.343,4521401  1% 0% 100% 1%
Ruby673.78673.987,3041137  54% 0% 46% 1%
 binary-trees 
Perl804.23238.081,706,872706  94% 72% 96% 77%
Ruby176.2260.91240,6761123  95% 65% 63% 69%

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Perl programs for these benchmarks?

Remember - those are just the fastest Perl and Ruby programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Perl.

Maybe one of those other Perl programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Perl and Ruby programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Perl : server-side shell & cgi scripts 

This is perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-linux-thread-multi

Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
                        USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS
                        USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
                        USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
                        USE_PERL_ATOF USE_REENTRANT_API

Home Page: http://www.perl.org/

Download: http://www.cpan.org/src/5.0/

Revised BSD license

  Home   Conclusions   License   Play