You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Structural follow-up after Tiers 1–3 (issues T1–T7). Only worth pursuing if
table-build / sort residual gap persists after the per-element write-back
fixes (T1, T2) — otherwise defer or close.
We currently store array and hash keys in a single %Table{} map plus an order/order_tail/dead triple (lib/lua/vm/table.ex). Luerl
(deps/luerl/src/luerl_heap.erl:127-281) routes integer keys ≥ 1 to
Erlang's :array module (dense, O(1) functional update) and other keys to
a tree dict.
Splitting storage is the deepest structural lever for going past luerl
on table-heavy workloads.
Change (sketch — requires its own design pass first)
Dispatcher equivalents in lib/lua/vm/dispatcher.ex
Rework length, pairs, ipairs. Order tracking can simplify — :array
gives dense-integer ordering for free.
Process
Frame as a research spike first. Land a prototype on a branch, benchmark
in isolation, decide whether to merge based on measured gain vs the
refactor cost.
Verification
mix test (full suite)
Lua 5.3 official suite
All benchmarks/* runs — no regressions, gains where expected
Expected
Pushes us ahead of luerl on table-build / sort. Closes the array-iteration
gap at larger n. Possibly closes the state.tables Map.fetch cost too.
Activity