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 gcc 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 gcc 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
 k-nucleotide±±1/2
 fasta-redux± ±
 mandelbrot± ±
 reverse-complement±±
 fasta ±
 fannkuch-redux ±
 spectral-norm ±
 pidigits 
 n-body ±
 binary-trees±
 regex-dna1/3
 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 gcc program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 k-nucleotide 
Go30.718.30256,7521399  91% 99% 91% 91%
C gcc35.0911.37188,4962280  64% 91% 61% 94%
 fasta-redux 
Go1.741.751,0241236  4% 0% 1% 99%
C gcc1.631.643641402  2% 1% 100% 1%
 mandelbrot 
Go25.506.4131,748894  100% 100% 99% 100%
C gcc19.445.0231,928694  96% 96% 100% 96%
 reverse-complement 
Go0.920.76250,6801243  88% 9% 26% 3%
C gcc0.770.51250,784741  21% 18% 74% 43%
 fasta 
Go6.653.0611,1721388  44% 74% 54% 46%
C gcc5.721.945,0401914  89% 99% 63% 47%
 fannkuch-redux 
Go65.2916.461,024900  100% 99% 99% 99%
C gcc34.618.854,520910  99% 98% 100% 94%
 spectral-norm 
Go15.723.961,024536  99% 99% 99% 99%
C gcc7.891.98752569  99% 99% 100% 100%
 pidigits 
Go3.953.773,612674  69% 2% 5% 34%
C gcc1.731.73932448  1% 1% 3% 100%
 n-body 
Go22.9322.921,0201310  1% 0% 100% 0%
C gcc10.1910.194361490  0% 1% 1% 100%
 binary-trees 
Go64.1918.90265,788814  86% 86% 85% 85%
C gcc10.373.33155,504906  79% 62% 74% 99%
 regex-dna 
Go48.4916.64549,688789  64% 64% 95% 69%
C gcc5.812.44305,4882579  60% 51% 80% 52%

 4 : Are there other Go programs for these benchmarks?

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