Skip to content

Filtering mapped types declarations #51650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 16, 2023

Conversation

Andarist
Copy link
Contributor

This should help with things like:

  • go to definition
  • and symbol renaming

closes #47813

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Nov 27, 2022
Comment on lines -8 to -10
!!! error TS4118: The type of this node cannot be serialized because its property '[iterator]' cannot be serialized.
~~~~~
!!! error TS4118: The type of this node cannot be serialized because its property '[unscopables]' cannot be serialized.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably highly related to what I've mentioned in the other comment here. Those symbols~ should be serializable though (IMHO), so it looks like a good change



//// [mappedTypeWithAsClauseAndLateBoundProperty2.d.ts]
export declare const thing: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this on the other hand is a direct result of the fact that we now can serialize those symbols properly, so the type for this could be emitted here

//// [DtsFileErrors]


tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.d.ts(24,118): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little bit worrying though. It doesn't exactly look like a new problem though. It's just accidental that by making this thing serializable I now emit this error. I think that this should be handled separately. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely it can be handled separately; I can't tell if it's a bug or not that this is emitted as a return type of an object literal, but it's worth investigating.

////const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { a: 0 };
////filtered.[|/*ref*/a|];

verify.goToDefinition("ref", "def");
Copy link
Contributor Author

@Andarist Andarist Nov 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to add a test for symbol renaming too but I can't figure out how to write one properly. Any tips would be highly appreciated.

So far I have this:

/// <reference path='fourslash.ts' />

////const obj = { [|[|{| "contextRangeIndex": 0 |}a|]: 1|], b: 2 };
////const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { [|a|]: 0 };
////filtered.[|a|]();

const [r0Def, r0, r1, r2] = test.ranges();
verify.renameLocations(r0, [r0, r1, r2]);
verify.renameLocations(r1, [r0, r1, r2]);
verify.renameLocations(r2, [r0, r1, r2]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that it works OK in the IDE as I've confirmed that by using the built/local/tsserver.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that I'm using this whole contextRangeIndex incorrectly. I've tried without it too but no luck so far.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally if find-all-refs works then goto-def and rename work too. Can you write a similar test that uses verify.baselineFindAllReferences from at least the last line, but preferably the first and second. I think usage of that function is simpler and you can just prefix the locations with /*1*/, /*2*/, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip! I've pushed out such a test and it looks correct to me. Note that this was the first time I've used this API so I'm not exactly sure how to interpret all of the information in the generated baseline but the references property for all 3 markers looks alright to me.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Ideas for another test.
  2. Performance question.

////const filtered: { [P in keyof typeof obj as P extends 'b' ? never : P]: 0; } = { a: 0 };
////filtered.[|/*ref*/a|];

verify.goToDefinition("ref", "def");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally if find-all-refs works then goto-def and rename work too. Can you write a similar test that uses verify.baselineFindAllReferences from at least the last line, but preferably the first and second. I think usage of that function is simpler and you can just prefix the locations with /*1*/, /*2*/, etc.

//// [DtsFileErrors]


tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.d.ts(24,118): error TS2526: A 'this' type is available only in a non-static member of a class or interface.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely it can be handled separately; I can't tell if it's a bug or not that this is emitted as a return type of an object literal, but it's worth investigating.

@@ -12881,6 +12881,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const typeParameter = getTypeParameterFromMappedType(type);
const constraintType = getConstraintTypeFromMappedType(type);
const nameType = getNameTypeFromMappedType(type.target as MappedType || type);
const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like more work than the rest of the function does, so I'm worried about performance problems on mapped types with a nameType. I'll run the perf tests, but I don't know that any such mapped types are in there. @weswigham do you have an idea if this isTypeAssignableTo call is likely to be (relatively) slow here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that it's the same check that got used here:
https://github.com/microsoft/TypeScript/pull/48699/files#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8R15745

That said - that other PR calls this just from within getSimplifiedIndexedAccessType and this is in the resolveMappedTypeMembers so the impact on the perf could still be different as it depends on how frequent are calls to those caller functions

@sandersn
Copy link
Member

sandersn commented Dec 5, 2022

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 5, 2022

Heya @sandersn, I've started to run the perf test suite on this PR at 7741604. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@sandersn
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..51650
Metric main 51650 Delta Best Worst
Angular - node (v18.10.0, x64)
Memory used 341,051k (± 0.02%) 341,070k (± 0.02%) +19k (+ 0.01%) 340,830k 341,164k
Parse Time 1.57s (± 0.66%) 1.57s (± 1.12%) +0.00s (+ 0.32%) 1.54s 1.61s
Bind Time 0.52s (± 1.06%) 0.52s (± 0.43%) -0.00s (- 0.19%) 0.52s 0.53s
Check Time 4.03s (± 0.86%) 4.04s (± 0.59%) +0.01s (+ 0.35%) 3.98s 4.08s
Emit Time 4.31s (± 1.36%) 4.32s (± 1.05%) +0.01s (+ 0.19%) 4.24s 4.46s
Total Time 10.43s (± 0.88%) 10.46s (± 0.62%) +0.02s (+ 0.23%) 10.33s 10.59s
Compiler-Unions - node (v18.10.0, x64)
Memory used 187,300k (± 1.10%) 188,462k (± 1.09%) +1,163k (+ 0.62%) 185,067k 190,809k
Parse Time 0.62s (± 0.48%) 0.61s (± 0.97%) -0.00s (- 0.65%) 0.60s 0.63s
Bind Time 0.33s (± 1.04%) 0.33s (± 1.45%) -0.00s (- 0.00%) 0.32s 0.34s
Check Time 5.05s (± 0.62%) 5.05s (± 0.68%) +0.00s (+ 0.00%) 4.95s 5.09s
Emit Time 1.56s (± 1.44%) 1.56s (± 1.29%) -0.01s (- 0.32%) 1.52s 1.62s
Total Time 7.55s (± 0.47%) 7.55s (± 0.67%) -0.01s (- 0.09%) 7.42s 7.66s
Monaco - node (v18.10.0, x64)
Memory used 320,491k (± 0.02%) 320,455k (± 0.02%) -36k (- 0.01%) 320,293k 320,611k
Parse Time 1.16s (± 0.92%) 1.16s (± 1.01%) +0.01s (+ 0.52%) 1.14s 1.19s
Bind Time 0.49s (± 1.36%) 0.48s (± 1.41%) -0.01s (- 1.22%) 0.47s 0.50s
Check Time 3.88s (± 0.41%) 3.86s (± 0.44%) -0.02s (- 0.39%) 3.82s 3.91s
Emit Time 2.27s (± 0.65%) 2.26s (± 1.06%) -0.01s (- 0.44%) 2.22s 2.33s
Total Time 7.79s (± 0.31%) 7.77s (± 0.52%) -0.02s (- 0.28%) 7.71s 7.88s
TFS - node (v18.10.0, x64)
Memory used 283,328k (± 0.20%) 283,558k (± 0.22%) +230k (+ 0.08%) 282,963k 284,894k
Parse Time 0.96s (± 2.67%) 0.97s (± 2.53%) +0.01s (+ 0.83%) 0.92s 1.03s
Bind Time 0.46s (± 8.41%) 0.47s (± 8.53%) +0.00s (+ 0.87%) 0.43s 0.57s
Check Time 3.81s (± 0.49%) 3.80s (± 0.32%) -0.00s (- 0.11%) 3.78s 3.83s
Emit Time 2.23s (± 0.52%) 2.21s (± 0.81%) -0.02s (- 0.90%) 2.18s 2.26s
Total Time 7.46s (± 0.51%) 7.45s (± 0.71%) -0.01s (- 0.19%) 7.36s 7.57s
material-ui - node (v18.10.0, x64)
Memory used 435,962k (± 0.01%) 435,932k (± 0.01%) -30k (- 0.01%) 435,867k 436,080k
Parse Time 1.32s (± 0.69%) 1.32s (± 0.85%) -0.00s (- 0.15%) 1.30s 1.35s
Bind Time 0.49s (± 2.57%) 0.49s (± 1.01%) +0.00s (+ 0.81%) 0.49s 0.51s
Check Time 10.41s (± 0.81%) 10.37s (± 0.69%) -0.03s (- 0.34%) 10.19s 10.51s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 12.22s (± 0.73%) 12.18s (± 0.67%) -0.03s (- 0.27%) 11.98s 12.35s
xstate - node (v18.10.0, x64)
Memory used 518,433k (± 0.01%) 518,378k (± 0.01%) -56k (- 0.01%) 518,253k 518,632k
Parse Time 1.89s (± 0.44%) 1.89s (± 0.41%) +0.01s (+ 0.32%) 1.88s 1.91s
Bind Time 0.70s (± 2.50%) 0.70s (± 1.34%) -0.00s (- 0.43%) 0.68s 0.72s
Check Time 1.05s (± 0.84%) 1.04s (± 0.72%) -0.00s (- 0.38%) 1.03s 1.06s
Emit Time 0.05s (± 0.00%) 0.05s (± 0.00%) 0.00s ( 0.00%) 0.05s 0.05s
Total Time 3.69s (± 0.75%) 3.69s (± 0.40%) -0.00s (- 0.14%) 3.67s 3.72s
Angular - node (v16.17.1, x64)
Memory used 340,516k (± 0.01%) 340,428k (± 0.03%) -88k (- 0.03%) 340,249k 340,618k
Parse Time 1.87s (± 0.59%) 1.88s (± 0.64%) +0.02s (+ 0.91%) 1.86s 1.91s
Bind Time 0.65s (± 0.56%) 0.65s (± 0.46%) +0.00s (+ 0.31%) 0.64s 0.65s
Check Time 5.15s (± 0.55%) 5.20s (± 0.37%) +0.05s (+ 0.93%) 5.17s 5.25s
Emit Time 5.12s (± 0.99%) 5.14s (± 1.04%) +0.02s (+ 0.41%) 5.01s 5.25s
Total Time 12.79s (± 0.57%) 12.87s (± 0.48%) +0.08s (+ 0.66%) 12.73s 12.99s
Compiler-Unions - node (v16.17.1, x64)
Memory used 187,686k (± 0.59%) 188,330k (± 0.66%) +645k (+ 0.34%) 186,599k 190,151k
Parse Time 0.79s (± 0.92%) 0.79s (± 0.46%) -0.01s (- 0.76%) 0.78s 0.79s
Bind Time 0.42s (± 1.07%) 0.42s (± 1.24%) +0.00s (+ 0.24%) 0.41s 0.43s
Check Time 6.11s (± 0.43%) 6.11s (± 0.51%) -0.01s (- 0.10%) 6.04s 6.19s
Emit Time 1.94s (± 0.54%) 1.93s (± 0.46%) -0.01s (- 0.41%) 1.92s 1.95s
Total Time 9.27s (± 0.40%) 9.25s (± 0.38%) -0.02s (- 0.24%) 9.16s 9.33s
Monaco - node (v16.17.1, x64)
Memory used 319,841k (± 0.05%) 319,783k (± 0.01%) -58k (- 0.02%) 319,675k 319,860k
Parse Time 1.41s (± 0.71%) 1.42s (± 0.75%) +0.00s (+ 0.07%) 1.40s 1.45s
Bind Time 0.59s (± 0.62%) 0.59s (± 0.94%) -0.00s (- 0.50%) 0.58s 0.60s
Check Time 4.89s (± 0.44%) 4.88s (± 0.44%) -0.00s (- 0.06%) 4.83s 4.93s
Emit Time 2.75s (± 1.16%) 2.74s (± 0.76%) -0.02s (- 0.62%) 2.69s 2.78s
Total Time 9.65s (± 0.51%) 9.62s (± 0.42%) -0.03s (- 0.27%) 9.56s 9.74s
TFS - node (v16.17.1, x64)
Memory used 282,522k (± 0.16%) 282,282k (± 0.01%) -240k (- 0.08%) 282,237k 282,313k
Parse Time 1.16s (± 0.81%) 1.16s (± 0.60%) +0.00s (+ 0.17%) 1.15s 1.18s
Bind Time 0.66s (± 4.58%) 0.64s (± 5.06%) -0.02s (- 2.88%) 0.58s 0.68s
Check Time 4.78s (± 0.43%) 4.77s (± 0.41%) -0.01s (- 0.23%) 4.73s 4.82s
Emit Time 2.77s (± 1.75%) 2.83s (± 1.44%) +0.06s (+ 2.02%) 2.72s 2.90s
Total Time 9.37s (± 0.70%) 9.40s (± 0.76%) +0.03s (+ 0.32%) 9.21s 9.51s
material-ui - node (v16.17.1, x64)
Memory used 435,299k (± 0.00%) 435,313k (± 0.00%) +14k (+ 0.00%) 435,266k 435,351k
Parse Time 1.63s (± 0.50%) 1.63s (± 0.79%) -0.00s (- 0.18%) 1.60s 1.65s
Bind Time 0.51s (± 0.92%) 0.51s (± 0.44%) +0.00s (+ 0.20%) 0.51s 0.52s
Check Time 11.92s (± 0.67%) 11.94s (± 0.70%) +0.02s (+ 0.17%) 11.75s 12.08s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.06s (± 0.60%) 14.07s (± 0.64%) +0.02s (+ 0.12%) 13.87s 14.23s
xstate - node (v16.17.1, x64)
Memory used 516,012k (± 0.01%) 515,979k (± 0.01%) -33k (- 0.01%) 515,925k 516,065k
Parse Time 2.26s (± 0.39%) 2.27s (± 0.22%) +0.01s (+ 0.44%) 2.26s 2.28s
Bind Time 0.84s (± 1.65%) 0.83s (± 0.57%) -0.00s (- 0.36%) 0.82s 0.84s
Check Time 1.36s (± 0.95%) 1.37s (± 0.76%) +0.01s (+ 0.59%) 1.35s 1.40s
Emit Time 0.06s (± 0.00%) 0.06s (± 0.00%) 0.00s ( 0.00%) 0.06s 0.06s
Total Time 4.52s (± 0.46%) 4.53s (± 0.26%) +0.01s (+ 0.18%) 4.51s 4.56s
Angular - node (v14.15.1, x64)
Memory used 333,994k (± 0.00%) 333,983k (± 0.01%) -11k (- 0.00%) 333,916k 334,029k
Parse Time 2.04s (± 0.81%) 2.05s (± 0.52%) +0.00s (+ 0.20%) 2.03s 2.07s
Bind Time 0.70s (± 0.74%) 0.70s (± 1.43%) -0.00s (- 0.29%) 0.68s 0.73s
Check Time 5.51s (± 0.42%) 5.51s (± 0.70%) +0.00s (+ 0.02%) 5.42s 5.57s
Emit Time 5.42s (± 0.75%) 5.38s (± 0.71%) -0.04s (- 0.77%) 5.30s 5.49s
Total Time 13.67s (± 0.47%) 13.63s (± 0.44%) -0.04s (- 0.29%) 13.55s 13.80s
Compiler-Unions - node (v14.15.1, x64)
Memory used 182,643k (± 0.64%) 182,382k (± 0.55%) -262k (- 0.14%) 181,669k 185,120k
Parse Time 0.89s (± 0.42%) 0.89s (± 0.53%) +0.01s (+ 0.90%) 0.88s 0.90s
Bind Time 0.45s (± 0.66%) 0.46s (± 1.08%) +0.00s (+ 0.88%) 0.45s 0.47s
Check Time 6.39s (± 0.75%) 6.37s (± 0.47%) -0.01s (- 0.22%) 6.27s 6.42s
Emit Time 2.05s (± 0.86%) 2.06s (± 0.69%) +0.01s (+ 0.49%) 2.03s 2.09s
Total Time 9.77s (± 0.58%) 9.78s (± 0.40%) +0.00s (+ 0.05%) 9.64s 9.83s
Monaco - node (v14.15.1, x64)
Memory used 314,566k (± 0.01%) 314,590k (± 0.01%) +24k (+ 0.01%) 314,539k 314,696k
Parse Time 1.57s (± 0.95%) 1.56s (± 0.48%) -0.01s (- 0.45%) 1.54s 1.58s
Bind Time 0.64s (± 0.94%) 0.63s (± 0.63%) -0.00s (- 0.63%) 0.62s 0.64s
Check Time 5.23s (± 0.53%) 5.21s (± 0.35%) -0.02s (- 0.36%) 5.15s 5.24s
Emit Time 2.90s (± 0.73%) 2.87s (± 0.48%) -0.03s (- 1.14%) 2.84s 2.90s
Total Time 10.33s (± 0.57%) 10.27s (± 0.23%) -0.06s (- 0.60%) 10.23s 10.34s
TFS - node (v14.15.1, x64)
Memory used 279,373k (± 0.01%) 279,354k (± 0.01%) -20k (- 0.01%) 279,309k 279,381k
Parse Time 1.34s (± 0.97%) 1.32s (± 0.67%) -0.02s (- 1.34%) 1.31s 1.35s
Bind Time 0.59s (± 0.38%) 0.59s (± 0.56%) +0.00s (+ 0.17%) 0.58s 0.60s
Check Time 5.12s (± 0.34%) 5.11s (± 0.63%) -0.01s (- 0.12%) 5.03s 5.18s
Emit Time 3.13s (± 0.74%) 3.07s (± 1.56%) -0.05s (- 1.73%) 2.93s 3.17s
Total Time 10.18s (± 0.31%) 10.10s (± 0.65%) -0.08s (- 0.75%) 9.94s 10.28s
material-ui - node (v14.15.1, x64)
Memory used 430,756k (± 0.01%) 430,774k (± 0.01%) +18k (+ 0.00%) 430,686k 430,853k
Parse Time 1.86s (± 0.47%) 1.86s (± 0.56%) +0.00s (+ 0.11%) 1.84s 1.89s
Bind Time 0.54s (± 0.93%) 0.54s (± 1.11%) +0.00s (+ 0.19%) 0.52s 0.55s
Check Time 12.35s (± 0.75%) 12.32s (± 0.53%) -0.03s (- 0.27%) 12.20s 12.52s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.75s (± 0.66%) 14.72s (± 0.46%) -0.03s (- 0.18%) 14.60s 14.93s
xstate - node (v14.15.1, x64)
Memory used 504,343k (± 0.01%) 504,341k (± 0.01%) -2k (- 0.00%) 504,210k 504,443k
Parse Time 2.55s (± 0.37%) 2.56s (± 0.75%) +0.01s (+ 0.55%) 2.54s 2.63s
Bind Time 0.84s (± 0.73%) 0.84s (± 0.56%) +0.00s (+ 0.24%) 0.84s 0.86s
Check Time 1.47s (± 0.59%) 1.48s (± 0.79%) +0.01s (+ 0.48%) 1.46s 1.50s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 4.93s (± 0.28%) 4.96s (± 0.37%) +0.02s (+ 0.51%) 4.93s 5.02s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 51650 10
Baseline main 10

TSServer

Comparison Report - main..51650
Metric main 51650 Delta Best Worst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,053ms (± 0.68%) 1,044ms (± 0.60%) -9ms (- 0.87%) 1,028ms 1,054ms
Req 2 - geterr 2,594ms (± 0.88%) 2,573ms (± 0.74%) -21ms (- 0.83%) 2,535ms 2,618ms
Req 3 - references 166ms (± 0.54%) 166ms (± 0.61%) -0ms (- 0.06%) 163ms 168ms
Req 4 - navto 139ms (± 0.59%) 138ms (± 1.24%) -1ms (- 0.36%) 136ms 144ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 60ms (± 3.02%) 60ms (± 2.85%) -0ms (- 0.66%) 55ms 62ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,114ms (± 0.58%) 1,105ms (± 0.79%) -9ms (- 0.83%) 1,089ms 1,127ms
Req 2 - geterr 1,614ms (± 0.75%) 1,607ms (± 0.87%) -7ms (- 0.43%) 1,582ms 1,641ms
Req 3 - references 169ms (± 0.68%) 169ms (± 0.66%) -1ms (- 0.41%) 167ms 172ms
Req 4 - navto 152ms (± 0.58%) 152ms (± 0.66%) -1ms (- 0.46%) 149ms 154ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 54ms (± 1.61%) 53ms (± 1.47%) -1ms (- 1.67%) 51ms 55ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,510ms (± 0.76%) 1,505ms (± 0.74%) -6ms (- 0.37%) 1,478ms 1,531ms
Req 2 - geterr 559ms (± 0.77%) 557ms (± 1.09%) -2ms (- 0.36%) 546ms 576ms
Req 3 - references 59ms (± 2.39%) 58ms (± 2.17%) -1ms (- 1.53%) 57ms 63ms
Req 4 - navto 197ms (± 1.09%) 196ms (± 0.97%) -1ms (- 0.51%) 192ms 202ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 213ms (± 0.87%) 212ms (± 1.08%) -2ms (- 0.75%) 206ms 216ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,306ms (± 0.60%) 1,310ms (± 0.65%) +4ms (+ 0.27%) 1,289ms 1,330ms
Req 2 - geterr 3,235ms (± 0.53%) 3,204ms (± 0.77%) -32ms (- 0.98%) 3,156ms 3,267ms
Req 3 - references 191ms (± 0.53%) 191ms (± 0.49%) -0ms (- 0.05%) 189ms 193ms
Req 4 - navto 151ms (± 0.83%) 151ms (± 0.91%) +0ms (+ 0.20%) 149ms 155ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 63ms (± 5.97%) 60ms (± 2.75%) 🟩-2ms (- 3.68%) 58ms 64ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,400ms (± 0.70%) 1,387ms (± 0.73%) -13ms (- 0.89%) 1,362ms 1,415ms
Req 2 - geterr 2,117ms (± 0.45%) 2,120ms (± 0.41%) +3ms (+ 0.13%) 2,100ms 2,143ms
Req 3 - references 199ms (± 0.67%) 199ms (± 0.99%) 0ms ( 0.00%) 196ms 204ms
Req 4 - navto 165ms (± 0.99%) 165ms (± 0.54%) -0ms (- 0.06%) 163ms 166ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 58ms (± 2.95%) 57ms (± 3.36%) -1ms (- 1.89%) 54ms 63ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,817ms (± 0.76%) 1,821ms (± 0.41%) +4ms (+ 0.24%) 1,807ms 1,838ms
Req 2 - geterr 723ms (± 0.88%) 725ms (± 0.43%) +2ms (+ 0.28%) 720ms 732ms
Req 3 - references 67ms (± 1.05%) 68ms (± 1.01%) +1ms (+ 1.05%) 66ms 69ms
Req 4 - navto 199ms (± 0.85%) 199ms (± 0.92%) +0ms (+ 0.10%) 194ms 202ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 256ms (± 1.32%) 257ms (± 0.72%) +1ms (+ 0.35%) 254ms 262ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,457ms (± 0.60%) 1,444ms (± 0.46%) -13ms (- 0.89%) 1,429ms 1,462ms
Req 2 - geterr 3,457ms (± 0.95%) 3,445ms (± 0.80%) -12ms (- 0.34%) 3,381ms 3,496ms
Req 3 - references 207ms (± 0.57%) 205ms (± 0.56%) -2ms (- 0.97%) 203ms 208ms
Req 4 - navto 163ms (± 1.20%) 163ms (± 0.98%) -0ms (- 0.12%) 157ms 165ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 57ms (± 0.83%) 58ms (± 2.36%) +1ms (+ 0.87%) 56ms 63ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,529ms (± 0.42%) 1,525ms (± 0.22%) -4ms (- 0.23%) 1,515ms 1,531ms
Req 2 - geterr 2,300ms (± 0.62%) 2,301ms (± 0.50%) +1ms (+ 0.05%) 2,272ms 2,324ms
Req 3 - references 217ms (± 0.88%) 218ms (± 0.80%) +1ms (+ 0.37%) 214ms 222ms
Req 4 - navto 175ms (± 0.77%) 175ms (± 0.82%) +0ms (+ 0.23%) 172ms 178ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 56ms (± 1.38%) 57ms (± 1.05%) +1ms (+ 0.89%) 55ms 58ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,015ms (± 0.94%) 1,996ms (± 0.57%) -19ms (- 0.95%) 1,970ms 2,020ms
Req 2 - geterr 746ms (± 0.45%) 747ms (± 0.63%) +1ms (+ 0.19%) 739ms 760ms
Req 3 - references 73ms (± 1.19%) 72ms (± 1.31%) -0ms (- 0.55%) 70ms 74ms
Req 4 - navto 218ms (± 0.59%) 219ms (± 0.71%) +1ms (+ 0.50%) 217ms 223ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 274ms (± 1.72%) 270ms (± 1.03%) -4ms (- 1.28%) 266ms 280ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 51650 10
Baseline main 10

Startup

Comparison Report - main..51650
Metric main 51650 Delta Best Worst
tsc-startup - node (v16.17.1, x64)
Execution time 120.92ms (± 0.46%) 118.36ms (± 0.49%) -2.55ms (- 2.11%) 115.32ms 125.58ms
tsserver-startup - node (v16.17.1, x64)
Execution time 200.96ms (± 0.46%) 199.43ms (± 0.44%) -1.53ms (- 0.76%) 194.73ms 209.71ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 195.36ms (± 0.38%) 193.71ms (± 0.43%) -1.65ms (- 0.84%) 188.65ms 201.94ms
typescript-startup - node (v16.17.1, x64)
Execution time 180.67ms (± 0.33%) 178.17ms (± 0.40%) -2.51ms (- 1.39%) 174.74ms 185.08ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-131-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 51650 10
Baseline main 10

Developer Information:

Download Benchmark

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea to me, but I want another pair of eyes before merging.

@sandersn sandersn assigned weswigham and unassigned sandersn Dec 20, 2022
@Andarist
Copy link
Contributor Author

@sandersn this would be quite a nice improvement for some libraries, is there any chance (without rushing it, of course) that this could get into the approaching 5.0?

@sandersn
Copy link
Member

ping @weswigham

@DanielRosenwasser
Copy link
Member

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 21, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite on this PR at bf58389. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 21, 2023

Heya @DanielRosenwasser, I've started to run the extended test suite on this PR at bf58389. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 21, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at bf58389. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 21, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at bf58389. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 21, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at bf58389. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/51650/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/51650/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.json

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/51650/merge:

Everything looks good!

1 similar comment
@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/51650/merge:

Everything looks good!

…s-declarations

# Conflicts:
#	tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt
@Andarist
Copy link
Contributor Author

@weswigham friendly 🏓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Key remapping breaks definition navigation for mapped type properties
5 participants