Repository navigation
Avoid zeroing unused Relater fields in putRelater - #65811
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
putRelater previously zeroed the entire Relater struct on every return
to the free list even when most fields were never touched during a
simple type relation check.
Clear only the fields that were actually populated before returning
the Relater to the free list.
benchstat (-pgo=off, parent vs commit, n=6):
goos: linux
goarch: amd64
│ old │ new │
│ sec/op │ sec/op vs base │
Tsc/vscode 6.227 ± 1% 6.248 ± 2% ~ (p=1.000 n=6)
Tsc/mui-docs 3.761 ± 1% 3.732 ± 2% -0.77% (p=0.015 n=6)
geomean 4.840 4.829 -0.22%
│ old │ new │
│ B-rss │ B-rss vs base │
Tsc/vscode 4.615Gi ± 2% 4.576Gi ± 2% ~ (p=0.394 n=6)
Tsc/mui-docs 2.126Gi ± 7% 2.174Gi ± 4% ~ (p=0.132 n=6)
geomean 3.132Gi 3.154Gi +0.71%
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the relater pool cleanup optimization.
No open issues 🎉
What changed in this PR
Optimizes pooled relater cleanup in the TypeScript checker, building on #65327 to avoid unnecessary field resets.
Changes:
- Replaces whole-struct assignment with targeted field resets.
- Clears cached relation keys only when used and preserves reusable stack storage.
| File | Description |
|---|---|
tsc/internal/checker/relater.go |
Reduces reset work when returning relaters to the pool. |
Review effort: Balanced
This branch has not been deployed
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.
This is basically #65327 redone, but with further optimization.
benchstat (-pgo=off, parent vs commit, n=6):