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.12 37,444 938 3.30 2% 5% 98% 4%
reverse-complement
source secs mem gz cpu cpu load
Lua 17.44 740,584 553 17.43 100% 1% 1% 0%
Java 1.13 199,672 2124 2.76 48% 74% 70% 54%
n-body
source secs mem gz cpu cpu load
Lua 389.29 1,176 1193 389.20 0% 1% 1% 100%
Java 22.56 35,208 1424 22.65 99% 1% 1% 1%
fasta
source secs mem gz cpu cpu load
Lua 45.92 2,828 1052 45.90 100% 1% 1% 0%
Java 2.32 46,816 2457 6.37 61% 60% 96% 60%
k-nucleotide
source secs mem gz cpu cpu load
Lua 182.12 572,508 613 180.68 1% 100% 1% 1%
Java 8.38 375,988 1802 26.25 73% 97% 70% 74%
mandelbrot
source secs mem gz cpu cpu load
Lua 201.89 23,560 623 696.14 84% 94% 85% 83%
Java 6.08 77,056 796 23.61 97% 97% 99% 97%
binary-trees
source secs mem gz cpu cpu load
Lua 364.38 2,194,388 412 363.90 38% 28% 36% 1%
Java 8.58 966,808 835 28.98 86% 84% 90% 81%
spectral-norm
source secs mem gz cpu cpu load
Lua 180.25 2,628 329 180.20 100% 1% 1% 0%
Java 4.25 36,364 950 16.30 97% 96% 95% 97%
fannkuch-redux
source secs mem gz cpu cpu load
Lua 1,315.48 1,284 462 1,315.20 53% 0% 47% 0%
Java 15.09 34,764 1282 59.26 99% 98% 98% 100%
regex-redux
source secs mem gz cpu cpu load
Lua   Bad Output
Java 0.56 37,036 929 1.45 67% 52% 93% 58%
Lua

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

Java

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