The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

k-nucleotide
source secs KB gz cpu cpu load
Java 10.61 1,199,184 1844 35.27 79% 78% 90% 88%
C gcc 12.35 131,904 1535 36.58 37% 71% 95% 94%
fasta
source secs KB gz cpu cpu load
Java 1.82 31,600 2457 5.90 80% 83% 80% 82%
C gcc 1.81 2,352 1914 5.29 89% 53% 54% 100%
fasta-redux
source secs KB gz cpu cpu load
Java 1.93 24,588 1443 1.99 98% 2% 4% 3%
C gcc 1.59 624 1402 1.59 100% 1% 1% 0%
mandelbrot
source secs KB gz cpu cpu load
Java 7.12 87,832 796 27.79 97% 99% 97% 97%
C gcc 5.61 28,988 799 22.40 100% 100% 100% 100%
pidigits
source secs KB gz cpu cpu load
Java 4.07 26,324 938 4.17 3% 3% 4% 96%
C gcc 2.50 2,140 448 2.49 100% 0% 1% 0%
fannkuch-redux
source secs KB gz cpu cpu load
Java 17.13 25,804 1282 67.56 100% 98% 99% 98%
C gcc 10.06 1,388 910 39.49 99% 99% 95% 100%
binary-trees
source secs KB gz cpu cpu load
Java 5.88 513,180 926 19.64 95% 79% 87% 76%
C gcc 2.97 105,024 906 9.68 93% 77% 87% 72%
spectral-norm
source secs KB gz cpu cpu load
Java 4.30 26,476 950 16.53 99% 96% 95% 96%
C gcc 1.98 1,704 569 7.86 99% 100% 99% 99%
n-body
source secs KB gz cpu cpu load
Java 24.31 24,156 1424 24.34 1% 1% 1% 100%
C gcc 10.39 736 1490 10.38 0% 100% 1% 1%
reverse-complement
source secs KB gz cpu cpu load
Java 1.44 308,060 1661 2.91 47% 31% 85% 43%
C gcc 0.60 251,368 741 0.86 95% 84% 44% 15%
regex-dna
source secs KB gz cpu cpu load
Java 8.80 729,244 929 25.79 77% 80% 72% 66%
C gcc 2.67 290,792 2579 6.34 96% 76% 84% 67%
Java

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)

C gcc

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)