Skip to content

Collect each dispatch group's slot names once per Lua class table - #1539

Merged
Frotty merged 1 commit into
masterfrom
lua-slot-names-once
Oct 22, 2026
Merged

Frotty merged 1 commit into
masterfrom
lua-slot-names-once

Conversation

@Frotty

@Frotty Frotty commented Oct 22, 2026

Copy link
Copy Markdown
Member

LuaTranslator.createMethods assigns dispatch slots in two passes, and each pass collected every group's slot names (collectDispatchSlotNames) and member names again. Neither changes between the passes, so they are now collected once per group. The new maps are lookup-only: they are keyed by identity and never iterated, so the output order cannot change.

Measured on a large real map's Lua build, by JFR main-thread samples: collectDispatchSlotNames fell from 18–21 samples to 10–11. That is about 0.3% of the main thread, roughly 0.1 s of "translate to lua". The emitted Lua is byte-identical to master's (cmp).

Tests: LuaTranslationTests, LuaBackendAuditTests, DispatchImplementationTests, ClosureTests, LuaNameCompressionTests and DeterministicChecks pass, 548 tests in total.

createMethods collected the slot names and member names of every dispatch group in
each of its two passes; they do not change between the passes, so they are collected
once. On a large real map this halves the time spent collecting them; the emitted Lua
is unchanged.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T08:41:30.779915Z 34c3857 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty
Frotty merged commit 3efebe3 into master Oct 22, 2026
2 checks passed
@Frotty
Frotty deleted the lua-slot-names-once branch November 25, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant