chore(plans): scope B4-B8 perf follow-ups after PR #223#226
Merged
Conversation
Five plan files for the next round of executor performance work. PR #223 closed the cheap-fastpath gap (Luerl 1.5-2x → 0.95-1.35x); these plans address the remaining structural overheads: - B4 — Flat instruction stream + PC dispatch. Replace list-of-tuples instruction representation with a tuple + PC integer. Eliminates per-opcode cons traversal in `do_execute` (currently 43.6% of fib(22) self-time). - B5 — Compile prototypes to Erlang functions. Generate Erlang abstract forms from prototypes; pass through `compile:forms/2` and load as modules. Pushes opcode selection from runtime into compile time. Blocked on B4. - B6 — Direct table refs. Pass the resolved `%Lua.VM.Table{}` through helpers instead of re-fetching from `state.tables` on every step. Combined `Map.get/2 + /3` is ~6.4% of fib(22). - B7 — Array+hash split for table storage. Contiguous integer keys move to a tuple part; everything else stays in the hash. O(1) `#t`, O(1) `t[#t+1] = x`, lower memory ratio. Supersedes A10b. - B8 — Inline `Numeric.to_signed_int64/1` fast path. Guard-clause on in-range integers; one of the smaller, safer wins. Each plan grounds its stretch targets in the post-#223 profile numbers and follows the existing `.agents/plans/` schema. B4, B6, B7, B8 are `status: ready`; B5 is `status: blocked` on B4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five Direction-B plan files scoping the next round of executor
performance work. PR #223 closed the cheap fast-path gap; the
plans here address the remaining structural overheads.
What's in each plan
[tuple()]instructions with a tuple + integer PC;do_executeindexes viaelem/2instead of pattern-matching the list head. Targets the ~43% of fib(22) self-time spent in dispatch.compile:forms/2+:code.load_binary/3. The Luerl strategy. Phased — arithmetic and control flow first, fall back to interpreter for everything else. Blocked on B4.%Lua.VM.Table{}structs through helpers instead of re-fetching fromstate.tablesper access.Map.get/2 + /3is ~6.4% of fib(22) right now — pure indirection.Numeric.to_signed_int64/1fast path with a guard clause for already-in-range integers. Smallest plan; ~3.3% of fib(22) self-time today.Ordering rationale
Each plan includes
Per the
.agents/plans/schema:## Out of scopeblock (anti-scope-creep).No code changes
This PR is plan files only. No
lib/changes. Each plan ships as its own PR via/next-plan.Relationship to the existing perf track (A33-A35)
A33-A35 are the measurement track (baseline, profiling, regression CI). B4-B8 are the implementation track that consumes A33/A34's findings. A33's gap analysis will likely classify the workloads B4-B8 target as
redoryellow, justifying these plans formally.