Lua ECS Library Benchmark

March 15, 2026 · View on GitHub

Overview

Benchmark suite measuring execution time and memory consumption of popular Lua ECS (Entity-Component-System) libraries. Built on luamark, a statistical benchmarking tool for Lua.

Tested Libraries

LibraryVersion
Concord848652f
ecs-luac6be4a8
evolved.luav1.10.0-0 (luarocks)
lovetoysv0.4.0-2 (luarocks)
nataeb9d49b
tiny-ecsv1.3-3 (luarocks)

Benchmark Tests

19 tests across 5 groups, each run at 3 entity scales (100, 1,000, 10,000):

GroupTestsMeasures
Entity3Creation, destruction, allocation cost
Component4Field read/write, insertion, removal
Tag3Presence check, insertion, removal
System6Iteration throughput, scheduling, dispatch overhead
Structural Scaling3Structural ops with 20 registered systems

Each test reports median execution time and memory consumption. See specifications for full test definitions and rationale for test selection reasoning.

Caveats: These are micro-benchmarks measuring framework overhead in isolation. They do not cover application-level concerns such as event messaging or serialization. Memory figures suit relative comparison, not absolute measurement.

Running the Benchmarks

Install:

Run benchmarks with:

task

Libraries are automatically installed, provided the tools above are installed.

Results

  • Frameworks with relative performance exceeding 20× the fastest are excluded from charts to improve readability.
  • The results are expressed in terms of median execution time and memory usage; lower is better.
InterpreterMarkdownCSV
luajit-onresults.mdresults.csv
luajit-offresults.mdresults.csv
lua5.1results.mdresults.csv

Plots: results/plots/
Interpreting the results: results/README.md

Benchmark environment

OS: macOS 26.3.1
CPU: Apple M2 Max
Cores: 12 cores (12 threads)
Max Frequency: 3.50 GHz
Memory: 64 GB

Summary

Overall ranking using Borda count: each framework earns points based on its rank per test (last place = 1, first place = N). Higher score is better. Computed across all tests at 1,000 entities, grouped by category.

Summary

Plots

Detailed per-test plots: results/plots/

Contributing

Contributions, including adding new tests or ECS libraries, are welcome.

License

MIT