Skip to content
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

Consider all union types matching discriminator for excess property checks #51884

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nebkat
Copy link

@nebkat nebkat commented Dec 14, 2022

Discriminating unions provide a means for type narrowing based on a discriminator property. The first property common to all union constituents is taken as the discriminator property.

If object literals provide a discriminator value, their expected shape gets narrowed to the corresponding union constituent. Excess properties from other constituents (or completely unrelated properties) raise an excess property check (EPC) error.

Previously this only worked if there was a single matching candidate constituent for the object literal being tested. If two or more types within the union matched the provided discriminator value, EPC accepted properties from the entire union - even though only a subset actually matched.

This PR improves on this behavior to correctly consider only the matching subset.

Fixes #51873

@microsoft-github-policy-service

@nebkat please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your
contributions to Microsoft open source projects. This Agreement is effective as of the latest signature
date below.

  1. Definitions.
    “Code” means the computer software code, whether in human-readable or machine-executable form,
    that is delivered by You to Microsoft under this Agreement.
    “Project” means any of the projects owned or managed by Microsoft and offered under a license
    approved by the Open Source Initiative (www.opensource.org).
    “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
    Project, including but not limited to communication on electronic mailing lists, source code control
    systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
    discussing and improving that Project, but excluding communication that is conspicuously marked or
    otherwise designated in writing by You as “Not a Submission.”
    “Submission” means the Code and any other copyrightable material Submitted by You, including any
    associated comments and documentation.
  2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
    Project. This Agreement covers any and all Submissions that You, now or in the future (except as
    described in Section 4 below), Submit to any Project.
  3. Originality of Work. You represent that each of Your Submissions is entirely Your original work.
    Should You wish to Submit materials that are not Your original work, You may Submit them separately
    to the Project if You (a) retain all copyright and license information that was in the materials as You
    received them, (b) in the description accompanying Your Submission, include the phrase “Submission
    containing materials of a third party:” followed by the names of the third party and any licenses or other
    restrictions of which You are aware, and (c) follow any other instructions in the Project’s written
    guidelines concerning Submissions.
  4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
    for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
    Submission is made in the course of Your work for an employer or Your employer has intellectual
    property rights in Your Submission by contract or applicable law, You must secure permission from Your
    employer to make the Submission before signing this Agreement. In that case, the term “You” in this
    Agreement will refer to You and the employer collectively. If You change employers in the future and
    desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
    and secure permission from the new employer before Submitting those Submissions.
  5. Licenses.
  • Copyright License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the
    Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute
    the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third
    parties.
  • Patent License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under
    Your patent claims that are necessarily infringed by the Submission or the combination of the
    Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
    import or otherwise dispose of the Submission alone or with the Project.
  • Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
    No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
    granted by implication, exhaustion, estoppel or otherwise.
  1. Representations and Warranties. You represent that You are legally entitled to grant the above
    licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
    have disclosed under Section 3). You represent that You have secured permission from Your employer to
    make the Submission in cases where Your Submission is made in the course of Your work for Your
    employer or Your employer has intellectual property rights in Your Submission by contract or applicable
    law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
    have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
    You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
    REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
    EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
    PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
    NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  2. Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which
    You later become aware that would make Your representations in this Agreement inaccurate in any
    respect.
  3. Information about Submissions. You agree that contributions to Projects and information about
    contributions may be maintained indefinitely and disclosed publicly, including Your name and other
    information that You submit with Your Submission.
  4. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
    the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
    Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
    exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
    defenses of lack of personal jurisdiction and forum non-conveniens.
  5. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
    supersedes any and all prior agreements, understandings or communications, written or oral, between
    the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 14, 2022
@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

The TypeScript team hasn't accepted the linked issue #51873. If you can get it accepted, this PR will have a better chance of being reviewed.

@nebkat
Copy link
Author

nebkat commented Dec 14, 2022

@microsoft-github-policy-service agree

@jakebailey
Copy link
Member

jakebailey commented Dec 14, 2022

@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 run dt
@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

Heya @jakebailey, I've started to run the tarball bundle task on this PR at ca945a2. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at ca945a2. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/140430/artifacts?artifactName=tgz&fileId=88A1075270F74A2CB919F42AED50F0A06A696993987A13B5FFBE18D175AE7B4602&fileName=/typescript-5.0.0-insiders.20221214.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-51884-12".;

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Everything looks good!

1 similar comment
@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Here they are:

Compiler

Comparison Report - main..51884
Metric main 51884 Delta Best Worst
Angular - node (v18.10.0, x64)
Memory used 364,558k (± 0.02%) 364,644k (± 0.01%) +86k (+ 0.02%) 364,577k 364,731k
Parse Time 1.57s (± 1.10%) 1.57s (± 1.10%) -0.01s (- 0.44%) 1.54s 1.62s
Bind Time 0.55s (± 1.08%) 0.55s (± 0.89%) -0.00s (- 0.18%) 0.54s 0.56s
Check Time 3.89s (± 0.78%) 3.91s (± 1.03%) +0.02s (+ 0.44%) 3.84s 4.00s
Emit Time 3.93s (± 0.68%) 3.92s (± 0.92%) -0.01s (- 0.23%) 3.87s 4.03s
Total Time 9.96s (± 0.50%) 9.95s (± 0.77%) -0.00s (- 0.03%) 9.82s 10.10s
Compiler-Unions - node (v18.10.0, x64)
Memory used 199,638k (± 1.04%) 197,357k (± 0.65%) -2,281k (- 1.14%) 196,599k 202,516k
Parse Time 0.62s (± 0.89%) 0.62s (± 1.08%) -0.01s (- 0.80%) 0.60s 0.63s
Bind Time 0.36s (± 2.47%) 0.35s (± 0.96%) -0.00s (- 1.12%) 0.35s 0.36s
Check Time 4.96s (± 0.77%) 4.95s (± 0.81%) -0.01s (- 0.16%) 4.82s 5.02s
Emit Time 1.46s (± 1.21%) 1.46s (± 0.79%) +0.00s (+ 0.21%) 1.43s 1.48s
Total Time 7.39s (± 0.67%) 7.38s (± 0.61%) -0.01s (- 0.15%) 7.25s 7.45s
Monaco - node (v18.10.0, x64)
Memory used 347,257k (± 0.01%) 347,332k (± 0.01%) +76k (+ 0.02%) 347,192k 347,393k
Parse Time 1.18s (± 0.90%) 1.17s (± 1.00%) -0.00s (- 0.43%) 1.15s 1.20s
Bind Time 0.50s (± 0.72%) 0.51s (± 1.17%) +0.00s (+ 0.40%) 0.50s 0.52s
Check Time 3.66s (± 0.78%) 3.64s (± 0.63%) -0.02s (- 0.46%) 3.61s 3.71s
Emit Time 2.05s (± 1.11%) 2.04s (± 0.94%) -0.01s (- 0.24%) 2.01s 2.11s
Total Time 7.40s (± 0.73%) 7.37s (± 0.53%) -0.03s (- 0.41%) 7.28s 7.45s
TFS - node (v18.10.0, x64)
Memory used 305,916k (± 0.24%) 306,218k (± 0.24%) +302k (+ 0.10%) 304,959k 307,108k
Parse Time 0.94s (± 0.77%) 0.95s (± 1.74%) +0.01s (+ 1.17%) 0.93s 1.00s
Bind Time 0.57s (± 1.55%) 0.53s (± 7.83%) 🟩-0.05s (- 8.01%) 0.46s 0.58s
Check Time 3.39s (± 0.51%) 3.39s (± 0.85%) -0.00s (- 0.00%) 3.33s 3.45s
Emit Time 2.04s (± 0.75%) 2.02s (± 1.41%) -0.01s (- 0.59%) 1.97s 2.11s
Total Time 6.94s (± 0.49%) 6.89s (± 0.92%) -0.05s (- 0.75%) 6.72s 7.02s
material-ui - node (v18.10.0, x64)
Memory used 451,690k (± 0.01%) 451,755k (± 0.01%) +65k (+ 0.01%) 451,650k 451,916k
Parse Time 1.35s (± 0.86%) 1.36s (± 0.62%) +0.01s (+ 0.97%) 1.34s 1.37s
Bind Time 0.42s (± 3.39%) 0.41s (± 0.73%) 🟩-0.01s (- 3.09%) 0.40s 0.41s
Check Time 10.25s (± 1.05%) 10.11s (± 0.70%) -0.13s (- 1.27%) 9.99s 10.29s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 12.01s (± 0.89%) 11.89s (± 0.63%) -0.13s (- 1.05%) 11.74s 12.06s
xstate - node (v18.10.0, x64)
Memory used 553,591k (± 0.01%) 553,542k (± 0.01%) -49k (- 0.01%) 553,436k 553,704k
Parse Time 1.91s (± 0.52%) 1.89s (± 0.43%) -0.01s (- 0.73%) 1.88s 1.91s
Bind Time 0.72s (± 3.35%) 0.71s (± 3.83%) -0.01s (- 1.40%) 0.67s 0.79s
Check Time 1.02s (± 0.93%) 1.01s (± 1.05%) -0.01s (- 0.98%) 1.00s 1.04s
Emit Time 0.05s (± 0.00%) 0.05s (± 0.00%) 0.00s ( 0.00%) 0.05s 0.05s
Total Time 3.71s (± 0.88%) 3.67s (± 0.75%) -0.03s (- 0.86%) 3.62s 3.75s
Angular - node (v16.17.1, x64)
Memory used 363,903k (± 0.01%) 363,928k (± 0.02%) +25k (+ 0.01%) 363,802k 364,111k
Parse Time 1.93s (± 0.65%) 1.91s (± 0.97%) -0.02s (- 1.09%) 1.88s 1.95s
Bind Time 0.66s (± 0.75%) 0.66s (± 0.76%) -0.01s (- 1.50%) 0.65s 0.67s
Check Time 5.01s (± 0.41%) 5.01s (± 0.70%) -0.01s (- 0.12%) 4.95s 5.07s
Emit Time 4.68s (± 0.63%) 4.68s (± 0.80%) +0.00s (+ 0.02%) 4.61s 4.76s
Total Time 12.29s (± 0.30%) 12.26s (± 0.58%) -0.03s (- 0.24%) 12.11s 12.42s
Compiler-Unions - node (v16.17.1, x64)
Memory used 200,204k (± 0.63%) 199,558k (± 0.58%) -647k (- 0.32%) 198,437k 202,100k
Parse Time 0.80s (± 0.62%) 0.80s (± 0.73%) +0.00s (+ 0.13%) 0.79s 0.81s
Bind Time 0.44s (± 0.77%) 0.44s (± 1.11%) +0.00s (+ 0.23%) 0.43s 0.45s
Check Time 5.93s (± 0.62%) 5.87s (± 0.54%) -0.06s (- 0.96%) 5.80s 5.94s
Emit Time 1.80s (± 0.91%) 1.81s (± 0.96%) +0.01s (+ 0.39%) 1.77s 1.84s
Total Time 8.97s (± 0.54%) 8.92s (± 0.53%) -0.05s (- 0.58%) 8.83s 9.04s
Monaco - node (v16.17.1, x64)
Memory used 346,567k (± 0.01%) 346,587k (± 0.01%) +20k (+ 0.01%) 346,511k 346,672k
Parse Time 1.43s (± 0.56%) 1.44s (± 0.58%) +0.01s (+ 0.49%) 1.42s 1.45s
Bind Time 0.61s (± 0.91%) 0.61s (± 0.56%) +0.01s (+ 0.82%) 0.61s 0.62s
Check Time 4.62s (± 0.33%) 4.62s (± 0.45%) -0.00s (- 0.02%) 4.56s 4.65s
Emit Time 2.48s (± 0.88%) 2.48s (± 0.78%) -0.00s (- 0.12%) 2.43s 2.52s
Total Time 9.15s (± 0.33%) 9.15s (± 0.32%) +0.00s (+ 0.05%) 9.06s 9.20s
TFS - node (v16.17.1, x64)
Memory used 304,219k (± 0.02%) 304,242k (± 0.02%) +23k (+ 0.01%) 304,076k 304,308k
Parse Time 1.19s (± 1.26%) 1.18s (± 1.73%) -0.01s (- 0.50%) 1.16s 1.25s
Bind Time 0.58s (± 1.34%) 0.57s (± 0.86%) -0.00s (- 0.86%) 0.57s 0.59s
Check Time 4.33s (± 0.27%) 4.32s (± 0.60%) -0.02s (- 0.42%) 4.24s 4.36s
Emit Time 2.49s (± 1.06%) 2.50s (± 1.17%) +0.01s (+ 0.28%) 2.44s 2.58s
Total Time 8.60s (± 0.52%) 8.57s (± 0.71%) -0.02s (- 0.27%) 8.42s 8.72s
material-ui - node (v16.17.1, x64)
Memory used 451,078k (± 0.01%) 451,020k (± 0.01%) -58k (- 0.01%) 450,962k 451,105k
Parse Time 1.68s (± 0.79%) 1.66s (± 0.52%) -0.01s (- 0.89%) 1.64s 1.68s
Bind Time 0.50s (± 1.12%) 0.50s (± 1.23%) +0.00s (+ 0.60%) 0.49s 0.51s
Check Time 11.73s (± 0.79%) 11.58s (± 0.49%) -0.15s (- 1.27%) 11.47s 11.73s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 13.91s (± 0.70%) 13.74s (± 0.41%) -0.16s (- 1.17%) 13.64s 13.88s
xstate - node (v16.17.1, x64)
Memory used 551,130k (± 0.01%) 551,105k (± 0.01%) -25k (- 0.00%) 551,040k 551,193k
Parse Time 2.32s (± 0.56%) 2.29s (± 0.42%) -0.03s (- 1.25%) 2.27s 2.31s
Bind Time 0.82s (± 1.50%) 0.84s (± 1.91%) +0.02s (+ 2.31%) 0.81s 0.87s
Check Time 1.35s (± 0.37%) 1.33s (± 0.56%) -0.02s (- 1.19%) 1.32s 1.35s
Emit Time 0.06s (± 0.00%) 0.06s (± 0.00%) 0.00s ( 0.00%) 0.06s 0.06s
Total Time 4.56s (± 0.46%) 4.53s (± 0.42%) -0.02s (- 0.46%) 4.50s 4.59s
Angular - node (v14.15.1, x64)
Memory used 357,745k (± 0.01%) 357,648k (± 0.01%) -96k (- 0.03%) 357,579k 357,727k
Parse Time 2.05s (± 0.73%) 2.06s (± 0.72%) +0.01s (+ 0.59%) 2.04s 2.11s
Bind Time 0.71s (± 0.56%) 0.71s (± 0.83%) +0.00s (+ 0.42%) 0.70s 0.73s
Check Time 5.33s (± 0.79%) 5.34s (± 0.29%) +0.01s (+ 0.15%) 5.30s 5.38s
Emit Time 4.82s (± 0.73%) 4.78s (± 0.56%) -0.03s (- 0.64%) 4.74s 4.86s
Total Time 12.90s (± 0.62%) 12.90s (± 0.26%) -0.01s (- 0.05%) 12.83s 12.98s
Compiler-Unions - node (v14.15.1, x64)
Memory used 195,900k (± 0.59%) 196,483k (± 0.38%) +583k (+ 0.30%) 193,553k 196,940k
Parse Time 0.90s (± 0.68%) 0.90s (± 0.83%) -0.00s (- 0.11%) 0.89s 0.92s
Bind Time 0.47s (± 0.77%) 0.47s (± 0.72%) -0.00s (- 0.21%) 0.47s 0.48s
Check Time 6.14s (± 0.43%) 6.15s (± 0.52%) +0.00s (+ 0.08%) 6.08s 6.25s
Emit Time 1.91s (± 1.22%) 1.92s (± 1.77%) +0.01s (+ 0.42%) 1.89s 2.05s
Total Time 9.43s (± 0.50%) 9.44s (± 0.51%) +0.01s (+ 0.08%) 9.36s 9.56s
Monaco - node (v14.15.1, x64)
Memory used 341,563k (± 0.01%) 341,567k (± 0.01%) +5k (+ 0.00%) 341,514k 341,622k
Parse Time 1.59s (± 0.50%) 1.58s (± 0.52%) -0.01s (- 0.31%) 1.57s 1.60s
Bind Time 0.65s (± 0.89%) 0.65s (± 0.90%) -0.00s (- 0.46%) 0.64s 0.66s
Check Time 4.92s (± 0.48%) 4.92s (± 0.49%) -0.00s (- 0.04%) 4.87s 4.99s
Emit Time 2.59s (± 1.18%) 2.57s (± 1.00%) -0.02s (- 0.85%) 2.53s 2.64s
Total Time 9.75s (± 0.40%) 9.72s (± 0.39%) -0.03s (- 0.34%) 9.66s 9.80s
TFS - node (v14.15.1, x64)
Memory used 301,315k (± 0.01%) 301,362k (± 0.01%) +47k (+ 0.02%) 301,323k 301,417k
Parse Time 1.33s (± 0.87%) 1.32s (± 0.73%) -0.01s (- 0.83%) 1.30s 1.35s
Bind Time 0.61s (± 0.56%) 0.60s (± 0.74%) -0.01s (- 0.82%) 0.59s 0.61s
Check Time 4.61s (± 0.32%) 4.59s (± 0.35%) -0.02s (- 0.50%) 4.56s 4.63s
Emit Time 2.79s (± 0.69%) 2.78s (± 1.18%) -0.01s (- 0.43%) 2.71s 2.85s
Total Time 9.34s (± 0.30%) 9.29s (± 0.41%) -0.05s (- 0.51%) 9.19s 9.36s
material-ui - node (v14.15.1, x64)
Memory used 446,781k (± 0.00%) 446,824k (± 0.01%) +43k (+ 0.01%) 446,749k 447,020k
Parse Time 1.90s (± 0.61%) 1.88s (± 0.48%) -0.02s (- 1.11%) 1.87s 1.91s
Bind Time 0.54s (± 0.74%) 0.54s (± 0.89%) -0.00s (- 0.74%) 0.53s 0.55s
Check Time 12.00s (± 0.66%) 12.04s (± 0.61%) +0.03s (+ 0.28%) 11.85s 12.18s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.44s (± 0.56%) 14.45s (± 0.54%) +0.01s (+ 0.05%) 14.26s 14.61s
xstate - node (v14.15.1, x64)
Memory used 539,737k (± 0.01%) 539,712k (± 0.01%) -25k (- 0.00%) 539,559k 539,880k
Parse Time 2.65s (± 0.93%) 2.62s (± 0.87%) -0.02s (- 0.79%) 2.59s 2.68s
Bind Time 0.82s (± 0.49%) 0.81s (± 1.00%) -0.01s (- 0.97%) 0.80s 0.83s
Check Time 1.44s (± 0.94%) 1.43s (± 0.31%) -0.01s (- 0.69%) 1.42s 1.44s
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) 0.00s ( 0.00%) 0.07s 0.07s
Total Time 4.98s (± 0.65%) 4.95s (± 0.55%) -0.04s (- 0.72%) 4.90s 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 51884 10
Baseline main 10

TSServer

Comparison Report - main..51884
Metric main 51884 Delta Best Worst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,067ms (± 0.58%) 1,065ms (± 0.70%) -2ms (- 0.20%) 1,051ms 1,081ms
Req 2 - geterr 2,563ms (± 1.01%) 2,547ms (± 0.59%) -16ms (- 0.62%) 2,513ms 2,575ms
Req 3 - references 165ms (± 1.03%) 164ms (± 0.78%) -1ms (- 0.48%) 161ms 168ms
Req 4 - navto 142ms (± 0.73%) 142ms (± 0.93%) -0ms (- 0.28%) 139ms 145ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 56ms (± 7.59%) 53ms (± 7.58%) 🟩-3ms (- 4.48%) 48ms 63ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,140ms (± 0.29%) 1,139ms (± 0.74%) -2ms (- 0.15%) 1,123ms 1,158ms
Req 2 - geterr 1,574ms (± 0.55%) 1,570ms (± 0.99%) -5ms (- 0.29%) 1,546ms 1,612ms
Req 3 - references 172ms (± 0.91%) 172ms (± 0.65%) -0ms (- 0.06%) 170ms 175ms
Req 4 - navto 153ms (± 0.89%) 153ms (± 0.93%) -0ms (- 0.13%) 149ms 155ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 53ms (± 1.14%) 54ms (± 0.68%) +1ms (+ 2.10%) 53ms 54ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,537ms (± 0.69%) 1,546ms (± 0.96%) +9ms (+ 0.57%) 1,510ms 1,572ms
Req 2 - geterr 543ms (± 1.34%) 545ms (± 1.07%) +1ms (+ 0.26%) 533ms 559ms
Req 3 - references 58ms (± 3.72%) 58ms (± 2.09%) -0ms (- 0.35%) 56ms 61ms
Req 4 - navto 194ms (± 0.78%) 195ms (± 0.60%) +1ms (+ 0.41%) 192ms 197ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 216ms (± 1.25%) 215ms (± 1.27%) -1ms (- 0.51%) 211ms 222ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,329ms (± 0.69%) 1,334ms (± 0.50%) +5ms (+ 0.38%) 1,311ms 1,344ms
Req 2 - geterr 3,167ms (± 1.01%) 3,178ms (± 0.92%) +12ms (+ 0.37%) 3,107ms 3,228ms
Req 3 - references 194ms (± 0.68%) 193ms (± 0.69%) -0ms (- 0.21%) 190ms 196ms
Req 4 - navto 155ms (± 1.15%) 156ms (± 1.35%) +1ms (+ 0.52%) 150ms 159ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 58ms (± 2.04%) 58ms (± 1.31%) -1ms (- 1.03%) 56ms 59ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,414ms (± 0.80%) 1,430ms (± 0.81%) +16ms (+ 1.12%) 1,396ms 1,446ms
Req 2 - geterr 2,072ms (± 0.53%) 2,076ms (± 0.55%) +5ms (+ 0.22%) 2,045ms 2,100ms
Req 3 - references 201ms (± 0.62%) 203ms (± 0.62%) +2ms (+ 0.80%) 201ms 207ms
Req 4 - navto 167ms (± 0.87%) 168ms (± 0.69%) +1ms (+ 0.36%) 165ms 171ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 57ms (± 1.57%) 57ms (± 1.36%) +0ms (+ 0.53%) 55ms 59ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,865ms (± 0.63%) 1,860ms (± 0.43%) -5ms (- 0.28%) 1,845ms 1,880ms
Req 2 - geterr 691ms (± 0.45%) 689ms (± 0.43%) -3ms (- 0.39%) 682ms 694ms
Req 3 - references 65ms (± 1.08%) 66ms (± 1.43%) +1ms (+ 1.23%) 64ms 68ms
Req 4 - navto 196ms (± 0.85%) 196ms (± 0.86%) -1ms (- 0.31%) 191ms 199ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 255ms (± 0.42%) 256ms (± 1.05%) +2ms (+ 0.71%) 250ms 265ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,480ms (± 0.41%) 1,479ms (± 0.66%) -1ms (- 0.09%) 1,460ms 1,498ms
Req 2 - geterr 3,367ms (± 0.93%) 3,369ms (± 0.88%) +3ms (+ 0.07%) 3,315ms 3,415ms
Req 3 - references 209ms (± 0.70%) 208ms (± 0.49%) -1ms (- 0.67%) 205ms 210ms
Req 4 - navto 170ms (± 0.66%) 169ms (± 1.14%) -0ms (- 0.18%) 164ms 174ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 59ms (± 5.40%) 58ms (± 1.40%) -1ms (- 1.52%) 57ms 61ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,577ms (± 0.44%) 1,583ms (± 0.62%) +6ms (+ 0.37%) 1,566ms 1,610ms
Req 2 - geterr 2,219ms (± 0.43%) 2,213ms (± 0.55%) -6ms (- 0.25%) 2,191ms 2,247ms
Req 3 - references 221ms (± 0.86%) 221ms (± 1.17%) -1ms (- 0.32%) 215ms 228ms
Req 4 - navto 180ms (± 0.53%) 177ms (± 0.50%) -2ms (- 1.28%) 175ms 179ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 59ms (± 1.68%) 60ms (± 2.92%) +2ms (+ 2.55%) 57ms 64ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,986ms (± 0.44%) 2,001ms (± 0.63%) +15ms (+ 0.74%) 1,980ms 2,039ms
Req 2 - geterr 738ms (± 0.56%) 742ms (± 0.49%) +4ms (+ 0.58%) 735ms 749ms
Req 3 - references 73ms (± 1.24%) 71ms (± 0.99%) -2ms (- 2.47%) 70ms 73ms
Req 4 - navto 215ms (± 1.35%) 219ms (± 0.87%) +4ms (+ 1.95%) 216ms 224ms
Req 5 - completionInfo count 3,154 (± 0.00%) 3,154 (± 0.00%) 0 ( 0.00%) 3,154 3,154
Req 5 - completionInfo 281ms (± 1.50%) 276ms (± 0.60%) -6ms (- 1.96%) 273ms 281ms
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 51884 10
Baseline main 10

Startup

Comparison Report - main..51884
Metric main 51884 Delta Best Worst
tsc-startup - node (v16.17.1, x64)
Execution time 118.57ms (± 0.40%) 119.10ms (± 0.56%) +0.53ms (+ 0.45%) 116.00ms 125.12ms
tsserver-startup - node (v16.17.1, x64)
Execution time 198.29ms (± 0.30%) 197.66ms (± 0.27%) -0.62ms (- 0.31%) 194.79ms 203.83ms
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 192.53ms (± 0.29%) 192.58ms (± 0.31%) +0.05ms (+ 0.02%) 189.57ms 200.06ms
typescript-startup - node (v16.17.1, x64)
Execution time 178.59ms (± 0.37%) 178.09ms (± 0.32%) -0.50ms (- 0.28%) 175.50ms 185.25ms
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 51884 10
Baseline main 10

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Dec 14, 2022

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

Something interesting changed - please have a look.

Details

felixrieseberg/windows95

⚠️ Note that built also had errors ⚠️
Req #334 - references
    at formatMessage2 (/typescript-main/built/local/tsserver.js:159171:21)
    at IOSession.writeMessage (/typescript-main/built/local/tsserver.js:160178:21)
    at IOSession.send (/typescript-main/built/local/tsserver.js:160175:10)
    at IOSession.doOutput (/typescript-main/built/local/tsserver.js:160222:10)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:161833:14)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:163219:14)
Req #334 - references
    at formatMessage2 (/typescript-51884/built/local/tsserver.js:159164:21)
    at IOSession.writeMessage (/typescript-51884/built/local/tsserver.js:160171:21)
    at IOSession.send (/typescript-51884/built/local/tsserver.js:160168:10)
    at IOSession.doOutput (/typescript-51884/built/local/tsserver.js:160215:10)
    at IOSession.onMessage (/typescript-51884/built/local/tsserver.js:161826:14)
    at Interface.<anonymous> (/typescript-51884/built/local/tsserver.js:163212:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults4/felixrieseberg.windows95.rawError.txt in the artifact folder

Last few requests

{"seq":331,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":38065}}
{"seq":332,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":38126,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":333,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":38126,"entryNames":["_"]}}
{"seq":334,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/src/renderer/lib/_libwabt.js","line":13,"offset":39064}}

Repro Steps

  1. git clone https://github.com/felixrieseberg/windows95 --recurse-submodules
  2. In dir windows95, run git reset --hard 17a81393467e2668eb2eea291ab4b6a749756dad
  3. Back in the initial folder, download RepoResults4/felixrieseberg.windows95.replay.txt from the artifact folder
  4. npm install --no-save @typescript/server-replay
  5. npx tsreplay ./windows95 ./felixrieseberg.windows95.replay.txt path/to/tsserver.js
  6. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

palantir/blueprint

⚠️ Note that built also had errors ⚠️
Req #12864 - references
    at formatMessage2 (/typescript-main/built/local/tsserver.js:159171:21)
    at IOSession.writeMessage (/typescript-main/built/local/tsserver.js:160178:21)
    at IOSession.send (/typescript-main/built/local/tsserver.js:160175:10)
    at IOSession.doOutput (/typescript-main/built/local/tsserver.js:160222:10)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:161833:14)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:163219:14)
Req #12864 - references
    at formatMessage2 (/typescript-51884/built/local/tsserver.js:159164:21)
    at IOSession.writeMessage (/typescript-51884/built/local/tsserver.js:160171:21)
    at IOSession.send (/typescript-51884/built/local/tsserver.js:160168:10)
    at IOSession.doOutput (/typescript-51884/built/local/tsserver.js:160215:10)
    at IOSession.onMessage (/typescript-51884/built/local/tsserver.js:161826:14)
    at Interface.<anonymous> (/typescript-51884/built/local/tsserver.js:163212:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults4/palantir.blueprint.rawError.txt in the artifact folder

Last few requests

{"seq":12861,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":436816}}
{"seq":12862,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":437059,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":2,"triggerCharacter":"."}}
{"seq":12863,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":438662}}
{"seq":12864,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/site/docs/versions/1/docs-app.js","line":1,"offset":438837}}

Repro Steps

  1. git clone https://github.com/palantir/blueprint --recurse-submodules
  2. In dir blueprint, run git reset --hard b6c1518ea2f524accfba8045ce6f22cac7c5b56e
  3. In dir blueprint, run yarn install --ignore-engines --ignore-scripts --silent
  4. Back in the initial folder, download RepoResults4/palantir.blueprint.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./blueprint ./palantir.blueprint.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

vercel/hyper

⚠️ Note that built also had errors ⚠️
Req #4776 - references
    at formatMessage2 (/typescript-main/built/local/tsserver.js:159171:21)
    at IOSession.writeMessage (/typescript-main/built/local/tsserver.js:160178:21)
    at IOSession.send (/typescript-main/built/local/tsserver.js:160175:10)
    at IOSession.doOutput (/typescript-main/built/local/tsserver.js:160222:10)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:161833:14)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:163219:14)
Req #4776 - references
    at formatMessage2 (/typescript-51884/built/local/tsserver.js:159164:21)
    at IOSession.writeMessage (/typescript-51884/built/local/tsserver.js:160171:21)
    at IOSession.send (/typescript-51884/built/local/tsserver.js:160168:10)
    at IOSession.doOutput (/typescript-51884/built/local/tsserver.js:160215:10)
    at IOSession.onMessage (/typescript-51884/built/local/tsserver.js:161826:14)
    at Interface.<anonymous> (/typescript-51884/built/local/tsserver.js:163212:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults2/vercel.hyper.rawError.txt in the artifact folder

Last few requests

{"seq":4773,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/bin/yarn-standalone.js","line":16440,"offset":8}}
{"seq":4774,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/bin/yarn-standalone.js","line":16441,"offset":8,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":4775,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/bin/yarn-standalone.js","line":16441,"offset":8,"entryNames":["@abstract"]}}
{"seq":4776,"type":"request","command":"references","arguments":{"file":"@PROJECT_ROOT@/bin/yarn-standalone.js","line":16461,"offset":30}}

Repro Steps

  1. git clone https://github.com/vercel/hyper --recurse-submodules
  2. In dir hyper, run git reset --hard 6afd137455a8a466ec0d13283aa864ab375b9620
  3. Install packages (exact steps are below, but it might be easier to follow the repo readme)
    1. In dir hyper/app, run yarn install --ignore-engines --ignore-scripts --silent
    2. In dir hyper, run yarn install --ignore-engines --ignore-scripts --silent
  4. Back in the initial folder, download RepoResults2/vercel.hyper.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./hyper ./vercel.hyper.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unions with overlapping discriminator property do not perform internal excess property checks
3 participants