The Computer Language
Benchmarks Game

Java versus C gcc fastest programs

by faster benchmark performance

fasta
source secs mem gz cpu cpu load
Java 2.32 42,212 2473 6.30 65% 85% 47% 76%
C gcc 1.36 2,864 2268 5.41 99% 100% 100% 99%
pidigits
source secs mem gz cpu cpu load
Java 3.13 37,376 938 3.35 1% 98% 4% 6%
C gcc 1.75 2,672 452 1.75 100% 2% 2% 0%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.74 470,116 1812 27.12 71% 73% 93% 74%
C gcc 4.88 130,060 1506 16.06 87% 96% 87% 60%
reverse-complement
source secs mem gz cpu cpu load
Java 3.32 609,712 2183 7.54 64% 44% 44% 76%
C gcc 1.76 994,488 1438 3.98 97% 43% 44% 46%
fannkuch-redux
source secs mem gz cpu cpu load
Java 17.98 31,180 1282 70.57 97% 99% 97% 99%
C gcc 8.67 852 910 34.14 99% 100% 100% 95%
spectral-norm
source secs mem gz cpu cpu load
Java 4.26 33,572 950 16.39 96% 96% 98% 95%
C gcc 1.98 1,168 1139 7.87 100% 99% 100% 99%
binary-trees
source secs mem gz cpu cpu load
Java 8.39 960,056 835 27.39 81% 85% 74% 90%
C gcc 3.73 116,600 836 11.74 76% 71% 98% 72%
n-body
source secs mem gz cpu cpu load
Java 22.00 32,272 1489 22.07 1% 0% 0% 100%
C gcc 9.37 1,088 1490 9.37 100% 0% 1% 0%
mandelbrot
source secs mem gz cpu cpu load
Java 6.96 76,316 796 27.06 97% 97% 97% 97%
C gcc 1.64 26,512 1135 6.54 99% 100% 99% 100%
regex-redux
source secs mem gz cpu cpu load
Java 10.50 571,736 929 31.63 71% 73% 66% 92%
C gcc 1.46 152,216 1397 3.40 45% 41% 100% 49%
Java

openjdk 11 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

C gcc

gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0