The Computer Language
Benchmarks Game

Java programs versus C gcc

by benchmark task performance

fasta
source secs mem gz cpu cpu load
Java 2.27 43,628 2473 5.93 51% 75% 57% 81%
C gcc 1.32 2,892 2268 5.22 100% 100% 99% 99%
k-nucleotide
source secs mem gz cpu cpu load
Java 8.75 385,056 1812 27.09 85% 72% 70% 85%
C gcc 5.07 130,008 1506 15.25 88% 84% 58% 73%
pidigits
source secs mem gz cpu cpu load
Java 3.13 36,984 938 3.36 4% 4% 99% 3%
C gcc 1.75 2,728 452 1.74 1% 2% 0% 100%
reverse-complement
source secs mem gz cpu cpu load
Java 3.15 680,424 2183 7.07 52% 70% 43% 63%
C gcc 1.75 994,468 1438 3.96 48% 44% 95% 44%
fannkuch-redux
source secs mem gz cpu cpu load
Java 18.27 31,820 1282 72.06 99% 99% 98% 98%
C gcc 8.72 980 910 34.43 98% 97% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Java 4.38 35,388 950 16.80 96% 96% 95% 97%
C gcc 1.99 1,292 569 7.89 99% 99% 99% 99%
n-body
source secs mem gz cpu cpu load
Java 22.17 33,040 1489 22.27 100% 1% 0% 1%
C gcc 9.22 1,228 1490 9.22 100% 1% 1% 0%
binary-trees
source secs mem gz cpu cpu load
Java 8.39 933,808 835 28.28 82% 86% 84% 88%
C gcc 2.54 130,292 836 7.76 78% 67% 64% 98%
mandelbrot
source secs mem gz cpu cpu load
Java 6.10 76,520 796 23.59 97% 98% 98% 96%
C gcc 1.64 26,416 1135 6.55 100% 100% 99% 100%
regex-redux
source secs mem gz cpu cpu load
Java 10.51 573,972 929 31.30 70% 73% 70% 86%
C gcc 1.50 152,088 1230 4.06 54% 59% 60% 100%
Java

java 10 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

C gcc

gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0