The Computer Language
Benchmarks Game

Lua programs versus Java

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Lua 1.94 3,248 479 1.93 1% 1% 1% 99%
Java 3.06 31,760 938 3.16 6% 3% 97% 1%
reverse-complement
source secs mem gz cpu cpu load
Lua 17.44 740,584 553 17.43 100% 1% 1% 0%
Java 1.10 345,352 1661 2.40 33% 82% 53% 54%
n-body
source secs mem gz cpu cpu load
Lua 389.29 1,176 1193 389.20 0% 1% 1% 100%
Java 21.54 27,092 1489 21.56 1% 1% 100% 1%
fasta
source secs mem gz cpu cpu load
Lua 45.92 2,828 1052 45.90 100% 1% 1% 0%
Java 2.13 36,036 2457 5.66 94% 58% 59% 60%
k-nucleotide
source secs mem gz cpu cpu load
Lua 182.12 572,508 613 180.68 1% 100% 1% 1%
Java 7.93 465,372 1802 25.11 75% 75% 75% 93%
mandelbrot
source secs mem gz cpu cpu load
Lua 201.89 23,560 623 696.14 84% 94% 85% 83%
Java 7.10 90,588 796 27.92 99% 99% 98% 98%
binary-trees
source secs mem gz cpu cpu load
Lua 364.38 2,194,388 412 363.90 38% 28% 36% 1%
Java 11.26 593,156 835 39.02 85% 88% 90% 88%
spectral-norm
source secs mem gz cpu cpu load
Lua 180.25 2,628 329 180.20 100% 1% 1% 0%
Java 4.29 29,884 950 16.56 96% 97% 99% 95%
fannkuch-redux
source secs mem gz cpu cpu load
Lua 1,315.48 1,284 462 1,315.20 53% 0% 47% 0%
Java 13.74 30,368 1282 54.12 100% 98% 98% 99%
regex-redux
source secs mem gz cpu cpu load
Lua   Bad Output
Java 0.56 39,104 929 1.57 72% 71% 75% 71%
Lua

Lua 5.3.3 Copyright (C) 1994-2016 Lua.org, PUC-Rio

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)