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 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 : 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 Ruby 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 †1/83 ±
 mandelbrot1/73 ±
 fasta-redux1/62 
 fannkuch-redux1/50 1/2
 n-body1/28 ±
 spectral-norm1/26 1/2
 reverse-complement †1/11
 binary-trees1/3±±
 pidigits1/3 
 k-nucleotide±1/2±
 regex-dna±
 Go used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/831/831/561/261/3±

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

± 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 Ruby program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 fasta 
Go6.171.802,8561344  85% 85% 86% 89% †
Ruby148.59148.667,652987  18% 23% 32% 29% †
 mandelbrot 
Go25.506.4131,748894  100% 100% 99% 100%
Ruby1,865.72467.2365,1761019  100% 100% 100% 100%
 fasta-redux 
Go1.741.751,0241236  4% 0% 1% 99%
Ruby108.37108.45252,508772  1% 0% 100% 1%
 fannkuch-redux 
Go65.2916.461,024900  100% 99% 99% 99%
Ruby3,197.06828.6030,5921426  96% 98% 96% 97%
 n-body 
Go22.9322.921,0201310  1% 0% 100% 0%
Ruby640.09640.267,1601137  1% 0% 0% 100%
 spectral-norm 
Go15.723.961,024536  99% 99% 99% 99%
Ruby391.41102.2041,320828  96% 96% 95% 95%
 reverse-complement 
Go0.920.76250,6801243  88% 9% 26% 3% †
Ruby8.218.22132,256255  1% 0% 0% 100% †
 binary-trees 
Go64.1918.90265,788814  86% 86% 85% 85%
Ruby169.6857.70257,3881123  65% 97% 67% 67%
 pidigits 
Go3.953.773,612674  69% 2% 5% 34%
Ruby10.9610.9876,712240  0% 1% 100% 1%
 k-nucleotide 
Go30.718.30256,7521399  91% 99% 91% 91%
Ruby37.3512.36457,396996  70% 69% 97% 68%
 regex-dna 
Go48.4916.64549,688789  64% 64% 95% 69%
Ruby28.739.65118,660529  66% 65% 67% 100%

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

 4 : Are there other Go programs for these benchmarks?

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

 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