The Computer Language
Benchmarks Game

Lua versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

binary-trees
source secs mem gz busy cpu load
Lua 50.85 884,352 664 189.06 92% 97% 91% 92%
Java 2.50 2,487,096 835 7.90 88% 75% 75% 79%
mandelbrot
source secs mem gz busy cpu load
Lua 86.29 18,496 623 304.76 86% 88% 100% 80%
Java 4.11 68,204 796 16.20 98% 99% 98% 99%
fasta
source secs mem gz busy cpu load
Lua 28.31 2,840 1061 28.57 0% 1% 0% 100%
Java 1.20 44,124 2543 3.61 79% 86% 69% 65%
k-nucleotide
source secs mem gz busy cpu load
Lua 119.24 596,500 613 119.78 0% 100% 0% 0%
Java 5.00 408,040 1812 16.36 74% 81% 86% 86%
reverse-complement
source secs mem gz busy cpu load
Lua 44.41 2,165,032 752 44.52 0% 0% 100% 0%
Java 1.54 702,332 2183 3.55 78% 46% 49% 57%
n-body
source secs mem gz busy cpu load
Lua 217.77 1,288 1193 218.86 0% 0% 0% 100%
Java 6.75 35,200 1489 6.83 0% 0% 100% 1%
spectral-norm
source secs mem gz busy cpu load
Lua 87.25 2,736 329 87.59 0% 0% 100% 0%
Java 1.68 38,348 950 6.43 96% 96% 96% 95%
fannkuch-redux
source secs mem gz busy cpu load
Lua 719.15 1,224 462 723.72 0% 0% 0% 100%
Java 11.00 34,104 1282 43.42 99% 98% 98% 99%
regex-redux
source secs mem gz busy cpu load
Lua   Failed
Java 5.70 656,328 929 18.25 89% 76% 79% 75%
pidigits
source secs mem gz busy cpu load
Lua   Failed
Java 0.79 35,568 764 0.84 99% 3% 3% 1%
Lua

Lua 5.4.0 Copyright (C) 1994-2020 Lua.org, PUC-Rio

Java

openjdk 15 2020-09-15
OpenJDK Runtime Environment (build 15+36-1562)
OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)