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

Each chart bar shows, for one unidentified benchmark, how much the fastest Go program used compared to the fastest Java 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 Go programs faster?

Each table row shows, for one named benchmark, how much the fastest Go program used compared to the fastest Java 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
 reverse-complement±±±
 fasta-redux± ±
 spectral-norm± 1/2
 mandelbrot± ±
 fannkuch-redux± ±
 fasta± 1/2
 n-body± ±
 binary-trees1/5±
 pidigits ±
 k-nucleotide1/4±
 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 : Measurements - Are the Go 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 Go program are shown for comparison against measurements of the fastest Java program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 reverse-complement 
Go1.541.28265,8561243  12% 1% 100% 10%
Java2.911.44308,0601661  47% 31% 85% 43%
 fasta-redux 
Go1.781.771,7241237  2% 100% 1% 2%
Java1.991.9324,5881443  98% 2% 4% 3%
 spectral-norm 
Go15.703.962,364536  99% 99% 100% 99%
Java16.534.3026,476950  99% 96% 95% 96%
 mandelbrot 
Go27.186.8432,568894  99% 100% 100% 100%
Java27.797.1287,832796  97% 99% 97% 97%
 fannkuch-redux 
Go92.1123.151,724900  100% 100% 99% 100%
Java67.5617.1325,8041282  100% 98% 99% 98%
 fasta 
Go9.252.473,4961344  94% 96% 93% 94%
Java5.901.8231,6002457  80% 83% 80% 82%
 n-body 
Go36.0336.011,6081310  0% 69% 31% 1%
Java24.3424.3124,1561424  1% 1% 1% 100%
 binary-trees 
Go18.258.95100,584752  53% 50% 50% 50%
Java19.645.88513,180926  95% 79% 87% 76%
 pidigits 
Go8.097.178,428674  25% 31% 27% 31%
Java4.174.0726,324938  3% 3% 4% 96%
 k-nucleotide 
Go49.8318.82277,9921268  38% 61% 83% 83%
Java35.2710.611,199,1841844  79% 78% 90% 88%
 regex-dna 
Go49.8117.23532,312789  90% 64% 64% 72%
Java25.798.80729,244929  77% 80% 72% 66%

 4 : Are there other Go programs for these benchmarks?

Remember - those are just the fastest Go and Java 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 Java 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.5 linux/386

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