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 385,768 1812 26.52 76% 81% 74% 76%
C gcc 5.07 130,008 1506 15.25 88% 84% 58% 73%
fasta
source secs mem gz cpu cpu load
Java 2.32 42,556 2473 6.24 73% 85% 49% 63%
C gcc 1.32 2,892 2268 5.22 100% 100% 99% 99%
pidigits
source secs mem gz cpu cpu load
Java 3.13 37,324 938 3.35 98% 5% 3% 3%
C gcc 1.75 2,728 452 1.74 1% 2% 0% 100%
reverse-complement
source secs mem gz cpu cpu load
Java 3.31 626,956 2183 7.44 56% 60% 83% 45%
C gcc 1.75 994,468 1438 3.96 48% 44% 95% 44%
fannkuch-redux
source secs mem gz cpu cpu load
Java 17.91 31,560 1282 70.25 99% 98% 99% 97%
C gcc 8.72 980 910 34.43 98% 97% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Java 4.27 32,960 950 16.41 95% 97% 98% 96%
C gcc 1.99 1,292 569 7.89 99% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Java 22.00 32,496 1489 22.07 1% 100% 0% 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.28 982,224 835 27.19 79% 86% 83% 83%
C gcc 2.55 130,516 836 7.77 82% 66% 64% 94%
mandelbrot
source secs mem gz cpu cpu load
Java 6.96 76,748 796 27.07 98% 98% 96% 98%
C gcc 1.64 26,416 1135 6.55 100% 100% 99% 100%
regex-redux
source secs mem gz cpu cpu load
Java 10.52 637,380 929 31.89 75% 80% 77% 72%
C gcc 1.45 152,208 1397 3.40 46% 49% 42% 100%
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 7.3.0-16ubuntu3) 7.3.0