Cache ReferenceType resolution and skip allocations in getSymbol - #1831
Merged
Merged
Conversation
…ble changes Every property access on a ReferenceType proxy was doing the full symbol table lookup again. Now it keeps the resolved type until the cache token changes or anything bumps the new `SymbolTable.mutationCount`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- unordered tables only need the flags check, no lookup filter closure - only augment with pocket table results when the table has pocket tables (it was a no-op otherwise, but allocated options/arrays every level) - don't map own-table hits through addAncestorInfo, it was an identity copy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Hey there! I just built a new temporary npm package based on 41376ee. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.55-referencetype-resolve-cache.20260924153536.tgz |
Contributor
|
Hey there! I just built a new temporary npm package based on 517c96a. You can download it here or install it by running the following command: npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.55-referencetype-resolve-cache.20260924155835.tgz |
This was referenced Sep 24, 2026
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.
Addresses #1827.
ReferenceTypekeeps its resolved type until a scope gets linked (new cache token) or any symbol table changes (newSymbolTable.mutationCount). Every property access on the proxy was doing the full lookup againgetSymbolskips the lookup filter closure on unordered tables, skips the pocket table augment when there aren't any, and doesn't copy own-table hits throughaddAncestorInfoAlso tried a
getSymbolresult memo on top of this (cache token + mutation count, same as ReferenceType). Diagnostics were identical, but it's a net loss now that lookups are cheap - load up to 22% slower, validate +9% to -8%, heap +3-6%. So it's not in here.benchmark:scenarios, best of 3 vs alpha.55, diagnostics identical, heap unchanged:On a big client project (bslint + rooibos, no profiler): validate 34.5s -> 25.3s (-27%), wall -21%, peak RSS -310MB, same 13040 errors / 8139 warnings. In the profile
ReferenceType.resolvegoes 2.18s -> 0.06s andgetSymbol7.37s -> 2.95s.Also tried turning off the SymbolTable type cache on top of this - no diagnostic changes and validate is about the same, but load gets up to 31% slower, so it stays.
🤖 Generated with Claude Code