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 568 1402 1.56 0% 1% 2% 99%
mandelbrot
source secs KB gz cpu cpu load
Java 27.41 55,556 796 27.40 1% 0% 1% 100%
C gcc 22.37 32,124 694 22.36 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,972 448 2.50 1% 0% 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.62 100,812 906 9.61 0% 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.77 644 1261 2.77 0% 1% 2% 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 0% 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 752 1490 10.01 0% 1% 1% 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.20 640 1183 24.19 1% 1% 1% 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.63 125,280 812 0.62 0% 3% 0% 98%
regex-dna
source secs KB gz cpu cpu load
Java 22.35 623,244 740 22.34 1% 1% 0% 100%
C gcc 5.53 295,572 2579 5.51 0% 1% 1% 100%
k-nucleotide
source secs KB gz cpu cpu load
Java 1.18 50,052 1602 1.18 1% 0% 1% 99%
  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) Server VM (build 25.92-b14, mixed mode)

C gcc

gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)