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 2.86 106,260 1266 4.47 19% 18% 100% 21%
Java 12.16 927,212 929 37.28 73% 81% 75% 78%
mandelbrot
source secs mem gz cpu cpu load
C gcc 1.64 29,848 1135 6.51 100% 100% 100% 100%
Java 5.89 89,504 796 23.08 98% 98% 98% 99%
binary-trees
source secs mem gz cpu cpu load
C gcc 3.28 156,780 906 10.12 91% 77% 59% 83%
Java 11.52 643,924 889 40.54 89% 92% 85% 89%
reverse-complement
source secs mem gz cpu cpu load
C gcc 0.42 145,900 812 0.57 0% 26% 20% 100%
Java 1.11 345,308 1661 2.44 33% 58% 54% 80%
n-body
source secs mem gz cpu cpu load
C gcc 9.56 1,000 1490 9.56 1% 100% 1% 1%
Java 21.50 27,240 1489 21.52 1% 1% 100% 0%
spectral-norm
source secs mem gz cpu cpu load
C gcc 1.98 1,776 1139 7.87 99% 99% 100% 99%
Java 4.29 31,428 950 16.56 97% 96% 98% 97%
fannkuch-redux
source secs mem gz cpu cpu load
C gcc 9.07 1,576 910 35.43 100% 99% 98% 94%
Java 17.74 30,048 1282 69.90 98% 98% 100% 99%
pidigits
source secs mem gz cpu cpu load
C gcc 1.73 1,992 448 1.73 1% 100% 1% 0%
Java 3.06 31,088 938 3.16 0% 3% 9% 92%
fasta
source secs mem gz cpu cpu load
C gcc 1.36 2,800 1993 5.26 96% 97% 100% 97%
Java 2.14 36,192 2457 5.68 71% 58% 62% 77%
k-nucleotide
source secs mem gz cpu cpu load
C gcc 6.46 130,076 1500 17.06 51% 37% 89% 88%
Java 8.02 467,004 1802 25.57 76% 98% 73% 74%
C gcc

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

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)