The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Java 6.60 263,468 2568 20.56 76% 76% 90% 70%
C gcc 12.53 191,152 2280 37.33 90% 55% 100% 55%
mandelbrot
secs KB gz cpu cpu load
Java 6.27 88,992 796 24.24 96% 97% 97% 98%
C gcc 5.92 32,904 694 22.77 100% 95% 95% 95%
fasta
secs KB gz cpu cpu load
Java 2.19 39,368 2457 5.60 58% 72% 66% 61%
C gcc 1.36 8,180 1993 5.26 97% 96% 100% 97%
fasta-redux
secs KB gz cpu cpu load
Java 2.59 29,940 1443 2.65 1% 76% 1% 25%
C gcc 1.55 796 1321 1.55 0% 1% 1% 99%
pidigits
secs KB gz cpu cpu load
Java 3.12 33,528 938 3.22 3% 2% 80% 21%
C gcc 1.73 1,992 448 1.73 2% 6% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
Java 17.41 33,032 1282 68.64 98% 98% 99% 99%
C gcc 8.97 1,588 910 35.14 99% 95% 100% 99%
spectral-norm
secs KB gz cpu cpu load
Java 4.28 32,696 950 16.53 96% 96% 96% 99%
C gcc 1.98 1,868 569 7.88 100% 100% 99% 99%
n-body
secs KB gz cpu cpu load
Java 22.66 30,036 1424 22.68 97% 3% 0% 1%
C gcc 9.56 1,008 1490 9.56 1% 100% 0% 1%
reverse-complement
secs KB gz cpu cpu load
Java 1.27 315,296 1661 2.68 41% 48% 34% 92%
C gcc 0.53 251,672 741 0.77 50% 2% 81% 21%
regex-dna
secs KB gz cpu cpu load
Java 8.24 761,724 929 24.70 68% 73% 77% 83%
C gcc 2.46 336,804 2579 5.81 74% 46% 70% 51%
binary-trees
secs KB gz cpu cpu load
Java 11.58 649,456 889 40.18 94% 85% 87% 83%
C gcc 3.26 156,840 906 10.12 59% 76% 78% 99%
Java

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

C gcc

gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413