Skip to content

[MicroPerf] Drop the per-call closure in generic type-argument codegen - #20437

Open
T-Gro wants to merge 1 commit into
t-gro-list-hof-closure-spikefrom
t-gro-iltypeinst-iter2
Open

[MicroPerf] Drop the per-call closure in generic type-argument codegen#20437
T-Gro wants to merge 1 commit into
t-gro-list-hof-closure-spikefrom
t-gro-iltypeinst-iter2

Conversation

@T-Gro

@T-Gro T-Gro commented Sep 3, 2026

Copy link
Copy Markdown
Member

GenTypeArgsAux fed the partial application GenTypeArgAux cenv m tyenv to List.map, so every IL generic type-instantiation heap-allocated the mapping closure (ilTypeInst@655, 21.9 MB sampled) on one of the hottest codegen paths. ListInline.map folds the mapping in, so nothing is allocated per instantiation.

closure mechanism before (MB) after
ilTypeInst@655 ListInline.map in GenTypeArgsAux 21.9 gone

GenTypeArgsAux fed the partial application `GenTypeArgAux cenv m tyenv` to
List.map, so every IL generic type-instantiation heap-allocated the mapping
closure (ilTypeInst@655, 21.9 MB sampled) on one of the hottest codegen paths.
ListInline.map folds the mapping in, so nothing is allocated per instantiation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@T-Gro
T-Gro requested a review from a team as a code owner September 3, 2026 13:38
@T-Gro T-Gro added Theme-Performance NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes labels Sep 3, 2026
@T-Gro
T-Gro requested a review from abonie September 3, 2026 13:38
@github-actions github-actions Bot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes Theme-Performance

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant