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 10.38 634,548 929 29.48 70% 64% 69% 82%
mandelbrot
source secs mem gz cpu cpu load
C gcc 1.65 32,684 1135 6.53 99% 99% 100% 99%
Java 6.08 77,056 796 23.61 97% 97% 99% 97%
binary-trees
source secs mem gz cpu cpu load
C gcc 2.38 131,728 836 7.70 98% 87% 73% 68%
Java 8.58 966,808 835 28.98 86% 84% 90% 81%
reverse-complement
source secs mem gz cpu cpu load
C gcc 0.42 143,948 812 0.58 15% 26% 98% 2%
Java 1.13 199,672 2124 2.76 48% 74% 70% 54%
n-body
source secs mem gz cpu cpu load
C gcc 9.96 1,016 1490 9.95 1% 1% 1% 100%
Java 22.56 35,208 1424 22.65 99% 1% 1% 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.25 36,364 950 16.30 97% 96% 95% 97%
pidigits
source secs mem gz cpu cpu load
C gcc 1.73 2,116 448 1.73 1% 99% 1% 0%
Java 3.12 37,444 938 3.30 2% 5% 98% 4%
fasta
source secs mem gz cpu cpu load
C gcc 1.33 2,856 2249 5.28 100% 99% 100% 99%
Java 2.32 46,816 2457 6.37 61% 60% 96% 60%
fannkuch-redux
source secs mem gz cpu cpu load
C gcc 8.97 1,660 910 35.00 98% 94% 99% 100%
Java 15.09 34,764 1282 59.26 99% 98% 98% 100%
k-nucleotide
source secs mem gz cpu cpu load
C gcc 5.38 129,772 1499 16.37 61% 82% 89% 74%
Java 8.38 375,988 1802 26.25 73% 97% 70% 74%
C gcc

gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

Java

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