Repository navigation
perf(symbols): share symbols per definition, cache queries - #20845
Open
MangelMaxime wants to merge 6 commits into
Open
MangelMaxime wants to merge 6 commits into
MangelMaxime wants to merge 6 commits into
Conversation
Contributor
✅ Release notes checked
|
auduchinok
reviewed
Oct 22, 2026
T-Gro
reviewed
Oct 23, 2026
T-Gro
left a comment
Member
There was a problem hiding this comment.
🤖 🕵️ AI review — verify independently.
T-Gro
self-requested a review
October 23, 2026 07:51
T-Gro
requested changes
Oct 23, 2026
T-Gro
left a comment
Member
There was a problem hiding this comment.
In general, not just this PR:
Can you pls make PR descriptions more smaller and clearer on what a PR fixes, and less narrating implementation details?
This repo should have a skill for PR descriptions.
(Problem statement + brief problem approach + numerical evidence in case of perf improvements ;; that's all that is needed.)
MangelMaxime
force-pushed
the
symbols-shared-instances
branch
from
October 26, 2026 16:25
5f3057a to
97f34c4
Compare
Contributor
Author
|
Sorry, I missed the PR skill and wanted to give enough context for where the changes came from. The description is rewritten with it now, and the bot's finding is fixed with a regression test. |
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.
Description
Consumers that walk the typed tree through the symbol API (Fable, analyzers, language servers) get a fresh
FSharpMemberOrFunctionOrValueat every call site and a freshFSharpEntityon everyDeclaringEntity,TypeDefinitionorAttributeTypeaccess, and each symbol recomputesCurriedParameterGroups,Attributesand the like on every call. In a Fable compile of its own test suite those queries were 17 % of all allocated bytes.GetHashCodeon a member also hashed itsLogicalName, so dictionaries keyed on members collide on every overload.Within one
SymbolEnv, symbols for the same definition are now the same object (generic entities excepted, since each use gets fresh type arguments), their expensive queries are cached, andGetHashCodeuses the definition stamp, consistent with the existingEquals. No public API change, andfscnever loads the symbol API.SymbolApiBenchmarks.WalkSymbols(added in this PR)tests/Js/Main, symbol API allocationstests/Js/Main, compile timeAcross seven real Fable projects compile time drops 0 to 4 % with byte-identical output.
Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: