The Computer Language
24.11 Benchmarks Game

Go versus Java GraalVM fastest performance

How the programs are written matters! Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
Go #3 8.34 19,808 975 33.31
Java GraalVM #3 34.03 90,752 1264 34.21
Java GraalVM 9.33 91,152 1289 36.72
Java GraalVM #2 38.48 91,636 520 38.63
Java GraalVM #8 42.18 91,368 517 42.35
Go #8 46.13 19,440 500 46.24
Go 12.29 19,808 906 49.04
Go #2 12.35 19,808 903 49.32
n-body
source secs mem gz cpu secs
Java GraalVM #4 6.22 90,128 1495 6.36
Go #3 6.38 19,808 1207 6.40
Java GraalVM #5 6.47 90,344 1435 6.61
Java GraalVM #3 6.89 89,592 1436 7.03
Go 7.01 19,808 1316 7.03
Java GraalVM #2 6.90 89,600 1430 7.03
Go #2 7.03 19,808 1222 7.05
Java GraalVM #8 7.11 88,832 1322 7.24
Java GraalVM 7.31 89,724 1437 7.44
Go #8 9.60 19,436 1224 9.62
spectral-norm
source secs mem gz cpu secs
Go #8 5.33 19,416 429 5.34
Go 5.33 19,808 417 5.34
Go #2 1.50 19,808 674 5.68
Go #4 1.45 19,808 555 5.69
Java GraalVM #3 1.64 92,416 762 6.14
Java GraalVM #2 1.80 92,800 956 6.83
Java GraalVM #8 11.19 91,648 453 11.38
mandelbrot
source secs mem gz cpu secs
Go #4 3.76 35,456 912 14.99
Go #3 3.77 35,456 900 15.00
Java GraalVM #4 4.37 138,740 667 16.04
Java GraalVM #2 4.14 132,372 802 16.30
Java GraalVM #6 4.16 129,024 808 16.36
Go 5.02 33,024 829 20.02
Go #8 26.68 19,440 500 26.74
Java GraalVM 26.60 90,356 671 26.78
Go #2 6.85 33,152 843 27.28
Go #6 6.89 33,024 707 27.44
Java GraalVM #3 7.27 127,788 910 28.79
Java GraalVM #8 29.95 93,304 441 30.20
fasta
source secs mem gz cpu secs
Java GraalVM #6 1.28 99,840 2549 3.66
Go 3.73 19,808 1055 3.74
Java GraalVM #5 1.27 97,536 2478 3.75
Go #2 1.27 19,808 1405 4.06
Go #3 1.51 19,808 1362 4.09
Java GraalVM #4 3.55 142,080 1528 4.56
Java GraalVM #2 4.63 142,480 1259 5.61
Java GraalVM #8 15.83 96,000 894 16.43
Go #8 18.27 19,440 838 18.46
k-nucleotide
source secs mem gz cpu secs
Java GraalVM 4.31 475,296 1821 13.63
Java GraalVM #6 7.69 471,456 1614 27.24
Java GraalVM #3 7.79 472,096 1642 27.63
Go #7 7.63 163,072 1613 28.79
Go #3 8.18 145,280 1729 29.88
Go #6 8.21 145,152 1596 30.01
Go #4 9.16 140,032 1552 31.38
Java GraalVM #4 33.45 239,724 1887 34.10
Java GraalVM #5 15.99 248,224 2225 38.12
Java GraalVM #8 84.32 1,586,392 786 87.17
reverse-complement
source secs mem gz cpu secs
Go #2 2.19 800,640 614 2.29
Go #3 2.48 800,384 609 2.57
Go #6 1.91 1,244,508 1340 3.40
Java GraalVM #6 3.44 2,080,968 760 4.23
Java GraalVM #5 4.95 1,145,720 1115 5.31
Java GraalVM #4 5.69 1,906,560 656 5.99
Java GraalVM #7 24.65 1,180,012 1654 12.56
Go #5   Bad Output  
Go   Failed  
Java GraalVM #3   Bad Output  
binary-trees
source secs mem gz cpu secs
Java GraalVM #2 5.11 1,948,200 558 6.99
Java GraalVM #4 5.42 1,815,132 846 7.22
Java GraalVM #6 6.00 1,794,592 535 7.91
Java GraalVM #3 5.95 1,880,164 546 8.60
Java GraalVM #7 2.81 1,850,008 841 8.76
Java GraalVM #8 7.19 1,757,812 596 9.15
Go #6 27.90 404,096 618 29.26
Go #2 14.17 624,780 672 56.29
Go #3 14.91 326,508 806 58.00
Go #5 14.87 425,960 957 58.15
Go 32.01 243,192 488 59.78
Go #7 32.52 248,604 531 61.47
pidigits
source secs mem gz cpu secs
* Go #4 0.82 19,808 689 0.83
Java GraalVM #3 0.84 87,552 770 0.96
Go 1.18 19,808 715 1.20
* Go #3 1.40 19,808 610 1.44
Java GraalVM #2 1.34 96,384 944 1.53
Go #2 1.84 19,808 740 1.89
Go #6 2.46 19,512 727 2.46
Go #7 4.99 19,808 702 5.61
Java GraalVM 7.08 528,896 807 8.13
regex-redux
source secs mem gz cpu secs
Java GraalVM #2 1.56 408,236 2201 3.36
Go #5 3.25 321,360 817 5.43
Java GraalVM 7.95 617,884 875 15.48
Java GraalVM #3 4.93 646,312 935 16.03
Java GraalVM #6 5.21 1,281,824 746 16.40
Go #4 14.61 369,008 832 35.91
Go 25.37 319,956 749 61.07
Go #3 25.62 371,204 836 61.79
Go

go version go1.23.1 linux/amd64
GOAMD64=v2

Java GraalVM

openjdk 23 2024-09-17
Java HotSpot(TM) 64-Bit Server VM
OpenJDK GraalVM CE
(build 23+37-jvmci-b01,
mixed mode, sharing)