The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

k-nucleotide
secs KB gz cpu cpu load
Java 23.60 257,300 2568 23.58 0% 0% 1% 100%
C gcc 34.18 127,896 1535 34.16 1% 1% 0% 100%
mandelbrot
secs KB gz cpu cpu load
Java 27.19 88,448 796 27.18 1% 0% 1% 100%
C gcc 22.37 32,124 694 22.36 0% 1% 1% 100%
fasta-redux
secs KB gz cpu cpu load
Java 2.05 24,576 1443 2.04 1% 0% 0% 100%
C gcc 1.57 568 1402 1.56 0% 1% 2% 99%
pidigits
secs KB gz cpu cpu load
Java 4.14 26,616 938 4.14 2% 0% 1% 100%
C gcc 2.50 1,972 448 2.50 1% 0% 0% 100%
binary-trees
secs KB gz cpu cpu load
Java 16.35 526,588 584 16.33 1% 1% 0% 100%
C gcc 9.62 100,812 906 9.61 0% 1% 1% 100%
fasta
secs KB gz cpu cpu load
Java 4.81 24,836 1507 4.80 1% 1% 0% 100%
C gcc 2.77 644 1261 2.77 0% 1% 2% 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,628 569 7.85 0% 1% 1% 100%
reverse-complement
secs KB gz cpu cpu load
Java 1.80 522,620 745 1.80 3% 1% 1% 99%
C gcc 0.78 251,604 741 0.77 6% 0% 0% 100%
n-body
secs KB gz cpu cpu load
Java 24.33 24,036 1424 24.32 1% 0% 0% 100%
C gcc 10.01 752 1490 10.01 0% 1% 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 640 1183 24.19 1% 1% 1% 100%
regex-dna
secs KB gz cpu cpu load
Java 20.80 567,404 1284 20.79 0% 0% 1% 100%
C gcc 5.53 295,572 2579 5.51 0% 1% 1% 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 version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2)