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.48 152,352 1230 4.05 59% 99% 57% 61%
Java 10.34 627,224 929 29.88 74% 72% 65% 79%
mandelbrot
source secs mem gz cpu cpu load
C gcc 1.64 29,424 1135 6.53 99% 100% 100% 100%
Java 6.04 76,528 796 23.34 98% 97% 97% 97%
binary-trees
source secs mem gz cpu cpu load
C gcc 2.44 133,956 836 7.57 80% 65% 68% 100%
Java 8.34 893,008 835 28.20 87% 79% 96% 81%
n-body
source secs mem gz cpu cpu load
C gcc 9.12 1,176 1490 9.12 1% 100% 2% 2%
Java 22.10 33,136 1429 22.20 31% 1% 1% 70%
reverse-complement
source secs mem gz cpu cpu load
C gcc 0.48 200,492 820 0.66 4% 19% 25% 98%
Java 1.03 191,064 2183 2.31 52% 57% 43% 74%
spectral-norm
source secs mem gz cpu cpu load
C gcc 2.00 1,300 569 7.89 99% 99% 100% 99%
Java 4.23 34,472 950 16.27 96% 97% 97% 96%
fannkuch-redux
source secs mem gz cpu cpu load
C gcc 8.66 980 910 34.22 100% 97% 100% 100%
Java 17.26 32,116 1282 67.75 98% 99% 97% 99%
pidigits
source secs mem gz cpu cpu load
C gcc 1.74 2,716 452 1.74 100% 1% 1% 2%
Java 3.12 36,788 938 3.31 6% 3% 4% 96%
fasta
source secs mem gz cpu cpu load
C gcc 1.32 2,912 2268 5.25 100% 99% 100% 99%
Java 2.33 43,924 2473 6.07 53% 71% 63% 74%
k-nucleotide
source secs mem gz cpu cpu load
C gcc 6.67 130,160 1506 19.33 76% 50% 92% 75%
Java 8.70 375,568 1812 27.17 80% 72% 74% 88%
C gcc

gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0

Java

java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)