The Computer Language
Benchmarks Game

C gcc programs versus Java

by benchmark task performance

regex-redux
source secs mem gz cpu cpu load
C gcc 1.45 155,768 1230 4.03 61% 64% 56% 100%
Java 12.31 902,528 929 38.75 73% 76% 86% 81%
binary-trees
source secs mem gz cpu cpu load
C gcc 2.38 131,728 836 7.70 98% 87% 73% 68%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
mandelbrot
source secs mem gz cpu cpu load
C gcc 1.65 32,684 1135 6.53 99% 99% 100% 99%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
reverse-complement
source secs mem gz cpu cpu load
C gcc 0.42 143,948 812 0.58 15% 26% 98% 2%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
n-body
source secs mem gz cpu cpu load
C gcc 9.96 1,016 1490 9.95 1% 1% 1% 100%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
spectral-norm
source secs mem gz cpu cpu load
C gcc 1.99 1,824 1139 7.88 99% 99% 99% 100%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
pidigits
source secs mem gz cpu cpu load
C gcc 1.73 2,116 448 1.73 1% 99% 1% 0%
Java 3.06 31,760 938 3.16 6% 3% 97% 1%
fasta
source secs mem gz cpu cpu load
C gcc 1.33 2,856 2249 5.28 100% 99% 100% 99%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
fannkuch-redux
source secs mem gz cpu cpu load
C gcc 8.97 1,660 910 35.00 98% 94% 99% 100%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
k-nucleotide
source secs mem gz cpu cpu load
C gcc 5.38 129,772 1499 16.37 61% 82% 89% 74%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
C gcc

gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

Java

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)