/mobile Handheld Friendly website

"After all, facts are facts, and although we may quote one to another with a chuckle the words of the Wise Statesman, 'Lies--damned lies--and statistics,' still there are some easy figures the simplest must understand, and the astutest cannot wriggle out of." Leonard Henry Courtney, 1895

Here you'll find provisional facts about the performance of programs written in ≈24 different programming languages for a dozen simple tasks. Here you'll find some easy figures which compare the fastest programs contributed for each programming language.

When the facts are about the performance of programs, the particular way each program does a task matters a lot. Obviously when programs implement different algorithms that difference may itself be enough to explain any difference in program performance. Less obviously, even when the same program is measured with different implementations of the same programming language, the particular way that program does the task may work better with one of the language implementations than the other - but slight changes to the program might reverse that performance difference. So there has to be some flexibility allowed in the way programs implement the same algorithm, and the tasks are kept simple enough for you to check the program source code.

When the facts are about a wide range of different programming languages even more flexibility has to be allowed in the way programs implement the same algorithm - after all, the point of using a different language is for the different approach that language provides. A comparison between programs written in such different languages is a comparison between apples and oranges - but sometimes the choice is between apples and oranges.

There exist multiple implementations for some programming languages - different C++ compilers, different Java VMs - but those other language implementations are not shown here. There exist entirely different programming languages which could be used to program these simple tasks - but those other languages are not shown here. There exist countless other tasks which could be the basis for a performance comparison of programming language implementations - but those other tasks are not shown here. If you're interested in something not shown here then please take the program source code and the measurement scripts and publish your own measurements.

 
 x86 Ubuntu™ Intel® Q6600® one core  x64 Ubuntu™ Intel® Q6600® quad-core  x86 Ubuntu™ Intel® Q6600® quad-core  x64 Ubuntu™ Intel® Q6600® one core 
 
Which programming languages are fastest?Which programming languages are fastest?Which programming languages are fastest?Which programming languages are fastest?
n-bodyPerform an N-body simulation of the Jovian planetsn-bodyn-body
fannkuch-reduxRepeatedly access a tiny integer-sequencefannkuch-reduxfannkuch-redux
meteor-contestSearch for solutions to shape packing puzzlemeteor-contestmeteor-contest
fastaGenerate and write random DNA sequencesfastafasta
spectral-normCalculate an eigenvalue using the power methodspectral-normspectral-norm
reverse-complementRead DNA sequences and write their reverse-complementreverse-complementreverse-complement
mandelbrotGenerate a Mandelbrot set and write a portable bitmapmandelbrotmandelbrot
k-nucleotideRepeatedly update hashtables and k-nucleotide stringsk-nucleotidek-nucleotide
regex-dnaMatch DNA 8-mers and substitute nucleotides for IUB coderegex-dnaregex-dna
pidigitsCalculate the digits of Pi with streaming arbitrary-precision arithmeticpidigitspidigits
chameneos-reduxRepeatedly perform symmetrical thread rendezvous requestschameneos-reduxchameneos-redux
thread-ringRepeatedly switch from thread to thread passing one tokenthread-ringthread-ring
binary-treesAllocate and deallocate many many binary treesbinary-treesbinary-trees
 
 x86 Ubuntu™ Intel® Q6600® one core  x64 Ubuntu™ Intel® Q6600® quad-core  x86 Ubuntu™ Intel® Q6600® quad-core  x64 Ubuntu™ Intel® Q6600® one core 
 
Ada 2005 GNATAda 2005 GNATAda 2005 GNATAda 2005 GNAT
ATSATSATSATS
C GNUC GNUC GNUC GNU
Clean  Clean
ClojureClojureClojureClojure
C# MonoC# MonoC# MonoC# Mono
C++ GNUC++ GNUC++ GNUC++ GNU
Erlang HiPEErlang HiPEErlang HiPEErlang HiPE
F# MonoF# MonoF# MonoF# Mono
Fortran IntelFortran IntelFortran IntelFortran Intel
Go 6g 8gGo 6g 8gGo 6g 8gGo 6g 8g
Haskell GHCHaskell GHCHaskell GHCHaskell GHC
Java 7 -serverJava 7 -serverJava 7 -serverJava 7 -server
JavaScript V8  JavaScript V8
Lisp SBCLLisp SBCLLisp SBCLLisp SBCL
Lua  Lua
Mozart/Oz   
OCamlOCamlOCamlOCaml
Free PascalFree PascalFree PascalFree Pascal
PerlPerlPerlPerl
PHPPHPPHPPHP
Python 3Python 3Python 3Python 3
RacketRacketRacketRacket
Ruby 1.9Ruby 1.9Ruby 1.9Ruby 1.9
JRubyJRubyJRubyJRuby
ScalaScalaScalaScala
Smalltalk VisualWorks  Smalltalk VisualWorks
 
 x86 Ubuntu™ Intel® Q6600® one core  x64 Ubuntu™ Intel® Q6600® quad-core  x86 Ubuntu™ Intel® Q6600® quad-core  x64 Ubuntu™ Intel® Q6600® one core 
 

  Mobile   Conclusions   License   Help