Skip to content

Reduce transient allocations in hot compiler passes - #1282

Merged
Frotty merged 7 commits into
masterfrom
codex/bump-abstractsyntaxgen-2b3d742e8a-clean
Sep 3, 2026
Merged

Reduce transient allocations in hot compiler passes#1282
Frotty merged 7 commits into
masterfrom
codex/bump-abstractsyntaxgen-2b3d742e8a-clean

Conversation

@Frotty

@Frotty Frotty commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • bump abstractsyntaxgen from 623da1c60f to 2b3d742e8a on both the compiler and AST-generation classpaths
  • replace allocation-producing iterator, stream, lambda, and collection-copy traversals with indexed access across frequently repeated IM passes
  • avoid materializing combined function collections when flattening, merging locals, analyzing local-player context, and tracing Lua reachability
  • preserve the required iterator for the HashMultimap removal view, where indexed traversal is not available and taking a snapshot would allocate more

Affected compiler paths

  • IM flattening and helper traversal
  • local-variable liveness and merging
  • local-player dependency analysis
  • Lua dispatch preparation
  • Lua garbage collection and generic-static initializer cleanup

Motivation

These passes repeatedly traverse generated AST/IM list types across the whole program. Using their indexed access directly removes avoidable transient iterators, streams, snapshots, and aggregate sets without changing traversal order or compiler semantics.

Validation

  • Gradle build and test CI passed
  • published test results passed
  • Codex reviewed head 51456777b3 and reported no major issues

No source-language or backend behavior change is intended.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 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-09-03T07:11:46.416547Z 5145677 Manual request
ℹ️ 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 commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 51456777b3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty Frotty changed the title Bump abstractsyntaxgen to 2b3d742e8a Reduce transient allocations in hot compiler passes Sep 3, 2026
@Frotty
Frotty merged commit d1bf067 into master Sep 3, 2026
3 checks passed
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