The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Java 33.48 1,190,032 1844 33.44 1% 1% 0% 100%
C gcc 34.26 127,908 1535 34.24 1% 1% 100% 100%
binary-trees
secs KB gz cpu cpu load
Java 10.70 518,220 926 10.68 1% 1% 0% 100%
C gcc 9.64 100,732 906 9.63 1% 0% 1% 100%
mandelbrot
secs KB gz cpu cpu load
Java 27.19 88,448 796 27.18 1% 0% 1% 100%
C gcc 22.37 31,976 799 22.36 1% 0% 100% 100%
fasta-redux
secs KB gz cpu cpu load
Java 2.05 24,576 1443 2.04 1% 0% 0% 100%
C gcc 1.58 572 1402 1.58 1% 100% 1% 100%
pidigits
secs KB gz cpu cpu load
Java 4.14 26,616 938 4.14 2% 0% 1% 100%
C gcc 2.50 2,120 448 2.49 1% 1% 100% 100%
fasta
secs KB gz cpu cpu load
Java 4.81 24,836 1507 4.80 1% 1% 0% 100%
C gcc 2.83 704 1261 2.82 2% 2% 100% 100%
spectral-norm
secs KB gz cpu cpu load
Java 16.37 26,876 950 16.36 1% 1% 0% 100%
C gcc 7.85 1,612 569 7.85 1% 1% 100% 100%
reverse-complement
secs KB gz cpu cpu load
Java 1.80 522,620 745 1.80 3% 1% 1% 99%
C gcc 0.76 251,292 741 0.76 1% 100% 0% 100%
n-body
secs KB gz cpu cpu load
Java 24.33 24,036 1424 24.32 1% 0% 0% 100%
C gcc 9.94 736 1490 9.94 1% 100% 1% 100%
fannkuch-redux
secs KB gz cpu cpu load
Java 67.66 26,644 1282 67.63 1% 1% 0% 100%
C gcc 24.20 708 1183 24.19 1% 91% 10% 100%
regex-dna
secs KB gz cpu cpu load
Java 20.80 567,404 1284 20.79 0% 0% 1% 100%
C gcc 5.46 288,880 2579 5.45 2% 100% 0% 100%
Java

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

C gcc

gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010