The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Java 11.29 1,118,288 1844 38.66 83% 97% 82% 82%
C gcc 12.17 189,420 2280 36.18 53% 97% 53% 96%
mandelbrot
secs KB gz cpu cpu load
Java 6.27 88,992 796 24.24 96% 97% 97% 98%
C gcc 5.92 32,464 694 22.81 95% 100% 96% 95%
fasta
secs KB gz cpu cpu load
Java 2.19 39,368 2457 5.60 58% 72% 66% 61%
C gcc 1.90 6,020 1914 5.21 90% 3% 87% 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 732 1321 1.54 1% 100% 0% 1%
pidigits
secs KB gz cpu cpu load
Java 3.12 33,528 938 3.22 3% 2% 80% 21%
C gcc 1.73 1,988 448 1.72 1% 0% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
Java 17.41 33,032 1282 68.64 98% 98% 99% 99%
C gcc 9.16 3,624 910 35.83 95% 99% 99% 99%
binary-trees
secs KB gz cpu cpu load
Java 6.20 524,828 926 20.90 87% 91% 82% 80%
C gcc 3.24 156,848 906 10.15 85% 62% 78% 92%
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,784 1139 7.87 99% 99% 100% 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% 0% 0% 100%
reverse-complement
secs KB gz cpu cpu load
Java 1.27 315,296 1661 2.68 41% 48% 34% 92%
C gcc 0.50 251,028 741 0.76 82% 44% 12% 20%
regex-dna
secs KB gz cpu cpu load
Java 8.24 761,724 929 24.70 68% 73% 77% 83%
C gcc 2.45 317,952 2579 5.87 53% 51% 48% 92%
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.2.1-22ubuntu2) 5.2.1 20151010