The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

mandelbrot
source secs KB gz cpu cpu load
Java 7.14 88,236 796 27.93 97% 98% 98% 99%
C gcc 5.92 32,904 694 22.77 100% 95% 95% 95%
fannkuch-redux
source secs KB gz cpu cpu load
Java 13.65 31,996 1282 53.64 99% 98% 99% 98%
C gcc 8.97 1,588 910 35.14 99% 95% 100% 99%
fasta
source secs KB gz cpu cpu load
Java 2.20 37,072 2457 6.37 81% 68% 72% 72%
C gcc 1.36 8,180 1993 5.26 97% 96% 100% 97%
fasta-redux
source secs KB gz cpu cpu load
Java 2.53 31,648 1443 2.59 3% 98% 1% 3%
C gcc 1.55 796 1321 1.55 0% 1% 1% 99%
pidigits
source secs KB gz cpu cpu load
Java 3.11 33,364 938 3.20 99% 2% 2% 2%
C gcc 1.73 1,992 448 1.73 2% 6% 1% 100%
spectral-norm
source secs KB gz cpu cpu load
Java 4.26 32,244 950 16.41 96% 98% 95% 97%
C gcc 1.98 1,868 569 7.88 100% 100% 99% 99%
reverse-complement
source secs KB gz cpu cpu load
Java 1.17 345,940 1661 2.42 41% 43% 57% 72%
C gcc 0.53 251,672 741 0.77 50% 2% 81% 21%
n-body
source secs KB gz cpu cpu load
Java 22.53 28,212 1430 22.54 100% 7% 1% 1%
C gcc 9.56 1,008 1490 9.56 1% 100% 0% 1%
regex-dna
source secs KB gz cpu cpu load
Java 8.23 753,008 929 24.56 71% 78% 81% 70%
C gcc 2.46 336,804 2579 5.81 74% 46% 70% 51%
binary-trees
source secs KB gz cpu cpu load
Java 11.51 622,328 889 40.10 86% 86% 92% 87%
C gcc 3.26 156,840 906 10.12 59% 76% 78% 99%
k-nucleotide
source secs KB gz cpu cpu load
Java 0.54 44,404 1602 1.55 71% 80% 75% 67%
  No program contribute your program
Java

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

C gcc

gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413