The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

fasta-redux
source secs KB gz cpu cpu load
Java 1.89 23,120 1443 1.88 2% 2% 0% 100%
C gcc 1.57 552 1402 1.57 0% 1% 1% 100%
mandelbrot
source secs KB gz cpu cpu load
Java 27.41 55,556 796 27.40 1% 0% 1% 100%
C gcc 22.37 31,904 694 22.36 1% 1% 1% 100%
k-nucleotide
source secs KB gz cpu cpu load
Java 36.57 512,948 1802 36.54 1% 0% 0% 100%
C gcc 23.93 126,832 1500 23.91 0% 1% 1% 100%
pidigits
source secs KB gz cpu cpu load
Java 4.14 25,988 938 4.13 1% 1% 0% 100%
C gcc 2.50 1,992 448 2.50 2% 1% 1% 100%
fasta
source secs KB gz cpu cpu load
Java 4.77 23,400 1507 4.76 1% 1% 1% 100%
C gcc 2.79 640 1261 2.79 1% 1% 0% 100%
binary-trees
source secs KB gz cpu cpu load
Java 16.53 511,692 584 16.51 1% 1% 0% 100%
C gcc 9.58 100,796 906 9.57 1% 1% 1% 100%
regex-dna
source secs KB gz cpu cpu load
Java 11.41 699,176 1085 11.39 1% 1% 0% 100%
C gcc 5.53 297,880 2579 5.50 2% 1% 1% 100%
spectral-norm
source secs KB gz cpu cpu load
Java 16.30 23,872 950 16.29 1% 0% 1% 100%
C gcc 7.85 1,628 569 7.85 1% 1% 1% 100%
n-body
source secs KB gz cpu cpu load
Java 24.07 23,184 1430 24.06 1% 1% 1% 100%
C gcc 10.01 740 1490 10.00 1% 1% 0% 100%
fannkuch-redux
source secs KB gz cpu cpu load
Java 67.56 23,480 1282 67.53 1% 1% 1% 100%
C gcc 24.19 636 1183 24.18 1% 1% 0% 100%
reverse-complement
source secs KB gz cpu cpu load
Java 1.79 521,988 745 1.78 1% 2% 2% 100%
C gcc 0.62 125,340 812 0.62 3% 0% 0% 100%
Java

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

C gcc

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609