vs

 1 : Are the Go programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Go program used compared to the fastest C++ g++ 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 : Are the Go programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Go program used compared to the fastest C++ g++ program.

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

 Go used what fraction? used how many times more? 
Benchmark Time Memory Code
 fasta-redux± ±
 k-nucleotide±±
 reverse-complement±±1/2
 fannkuch-redux± 1/2
 pidigits ±
 spectral-norm 1/2
 fasta ±
 mandelbrot ±
 binary-trees±±
 n-body ±
 regex-dna±
 Go used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)±±±

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

 3 : Are the Go programs faster? Measurements.

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 Go program are shown for comparison against measurements of the fastest C++ g++ program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 fasta-redux 
Go1.711.711,0361237  0% 1% 1% 99%
C++ g++1.781.788241474  0% 2% 100% 1%
 k-nucleotide 
Go30.938.42251,0241399  98% 91% 90% 90%
C++ g++24.797.34154,7841252  81% 80% 81% 97%
 reverse-complement 
Go0.930.77250,5641243  10% 69% 11% 35%
C++ g++1.020.65247,5082275  17% 64% 34% 48%
 fannkuch-redux 
Go67.1616.861,032900  100% 100% 100% 100%
C++ g++53.3313.631,2641440  100% 98% 99% 94%
 pidigits 
Go3.763.523,668674  4% 48% 7% 51%
C++ g++2.292.301,656682  1% 0% 0% 100%
 spectral-norm 
Go15.703.961,816536  99% 99% 99% 99%
C++ g++10.092.544961044  99% 99% 100% 100%
 fasta 
Go7.267.271,0281036  1% 1% 1% 100%
C++ g++4.234.231,0721286  1% 95% 1% 5%
 mandelbrot 
Go41.7510.4833,484837  100% 100% 100% 100%
C++ g++23.775.9732,3881017  100% 100% 100% 100%
 binary-trees 
Go68.4118.42266,624814  94% 94% 92% 93%
C++ g++27.048.03357,812892  58% 97% 91% 94%
 n-body 
Go22.9522.951,0361310  0% 0% 100% 1%
C++ g++9.359.354321544  98% 1% 3% 1%
 regex-dna 
Go47.4016.27543,868789  86% 64% 64% 78%
C++ g++5.273.55198,920695  9% 49% 69% 26%

 4 : Are there other Go programs for these benchmarks?

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

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

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Go and C++ g++ 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.

 Go : types just are - Go is an experiment 

go version go1.3 linux/amd64

SPLASH 2012 Go at Google: Language Design in the Service of Software Engineering

Home Page: Go - a systems programming language

Download: Installing Go

Revised BSD license

  Home   Conclusions   License   Play