The Computer Language
Benchmarks Game

Java versus C gcc fastest programs

by faster benchmark performance

k-nucleotide
source secs mem gz cpu cpu load
Java 8.66 384,756 1812 26.91 69% 88% 81% 75%
C gcc 5.07 130,008 1506 15.25 88% 84% 58% 73%
fasta
source secs mem gz cpu cpu load
Java 2.29 43,724 2473 6.16 67% 76% 59% 70%
C gcc 1.32 2,892 2268 5.22 100% 100% 99% 99%
pidigits
source secs mem gz cpu cpu load
Java 3.14 37,080 938 3.35 4% 4% 1% 98%
C gcc 1.75 2,728 452 1.74 1% 2% 0% 100%
reverse-complement
source secs mem gz cpu cpu load
Java 3.18 672,272 2183 7.17 67% 46% 43% 77%
C gcc 1.75 994,468 1438 3.96 48% 44% 95% 44%
fannkuch-redux
source secs mem gz cpu cpu load
Java 17.74 31,900 1282 69.78 99% 98% 99% 98%
C gcc 8.72 980 910 34.43 98% 97% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Java 4.41 35,028 950 16.79 96% 97% 98% 95%
C gcc 1.99 1,292 569 7.89 99% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Java 22.19 33,272 1489 22.28 35% 2% 66% 1%
C gcc 9.17 1,228 1490 9.17 100% 0% 0% 1%
binary-trees
source secs mem gz cpu cpu load
Java 8.29 930,040 835 28.13 78% 94% 85% 86%
C gcc 2.54 130,292 836 7.76 78% 67% 64% 98%
mandelbrot
source secs mem gz cpu cpu load
Java 6.13 76,876 796 23.60 96% 96% 96% 97%
C gcc 1.64 26,416 1135 6.55 100% 100% 99% 100%
regex-redux
source secs mem gz cpu cpu load
Java 10.43 609,920 929 31.73 72% 78% 72% 83%
C gcc 1.50 152,088 1230 4.06 54% 59% 60% 100%
Java

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

C gcc

gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0