Merged
Conversation
Contributor
|
Contributor
|
fcd2fa4 to
51f94f0
Compare
Contributor
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
88cd5f2 to
892f555
Compare
892f555 to
59bdcfa
Compare
dcreager
added a commit
that referenced
this pull request
Aug 7, 2025
* origin/main: [ty] Implemented support for "rename" language server feature (#19551) [ty] Reduce size of member table (#19572) [ty] Move server capabilities creation (#19798) [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793) [ty] Validate writes to `TypedDict` keys (#19782) [ty] Add support for using the test command emitted when a mdtest fails (#19794)
dcreager
added a commit
that referenced
this pull request
Aug 7, 2025
* dcreager/bound-typevar: (24 commits) more comment fix this isn't true anymore fix inner function in overload implementation ecosystem error Update Rust toolchain to 1.89 (#19807) [ty] Add `ty.inlayHints.variableTypes` server option (#19780) synthetic typevars for type materializations are bound [ty] Add failing tests for tuple subclasses (#19803) [ty] Add `ty.experimental.rename` server setting (#19800) clippy make BoundTypeVarInstance interned [ty] Implemented support for "rename" language server feature (#19551) [ty] Reduce size of member table (#19572) [ty] Move server capabilities creation (#19798) separate types! tmp allow KnownInstance::TypeVar in type expressions bind typevar in Generic/Protocol base class reference [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793) remove unneeded GenericContext::with_binding_context create KnownInstanceType::TypeVar for PEP 695 too ...
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.
Summary
This PR shrinks the size of the members table by ~28% (from 611MB to 438MB on a large project).
This is achieved by changing how we store
MemberExpr.Before
There are a few issues with this layout:
MemberSegmentitself is 32 bytes because it stores aString(or int) for each segment. This is an issue for multiple reasons:This PR shrinks the size of
MemberExprandMemberSegmentand reduces the cases where heap allocating the segments is necessary.New
The first change is that we change
symbol_nameto a path. The path stores the entire path of the member expression. For example,a.b[4]becomesab4. This avoids the need for each segment to store its ownName(orInt)The second important change is that
Segmentsis now an enum over a small and a heap variant:SmallSegmentspacks up to 7 segments into a singleu64(see docstring for more details).SegmentInfopacks both an offset and a kind, so that a single segment only takes 4 bytes (it's au32).All these improvements together shrink
MemberExprfrom 64 bytes to 40 bytes