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

feat(31388): Destructuring array, ability to explicitly tell the variable is unused #41378

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #31388

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Nov 3, 2020
@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Backlog Bug PRs that fix a backlog bug labels Nov 17, 2020
@DanielRosenwasser
Copy link
Member

@typescript-bot pack this
@typescript-bot test this
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

Heya @DanielRosenwasser, I've started to run the parallelized community code test suite on this PR at 406f130. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 17, 2020

Hey @DanielRosenwasser, 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/89437/artifacts?artifactName=tgz&fileId=6C5096523B0AFE7CF6CA4405CE5704A749697EEE3FE271FA4FE8BD5A92FE435002&fileName=/typescript-4.2.0-insiders.20201117.tgz"
    }
}

and then running npm install.


There is also a playground for this build.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..41378

Metric master 41378 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,516k (± 0.03%) 344,474k (± 0.03%) -42k (- 0.01%) 344,275k 344,727k
Parse Time 1.99s (± 0.69%) 1.98s (± 0.53%) -0.01s (- 0.30%) 1.95s 2.00s
Bind Time 0.84s (± 0.69%) 0.83s (± 0.87%) -0.00s (- 0.60%) 0.82s 0.85s
Check Time 4.97s (± 0.47%) 4.98s (± 0.41%) +0.01s (+ 0.24%) 4.92s 5.01s
Emit Time 5.37s (± 0.79%) 5.37s (± 0.47%) -0.00s (- 0.06%) 5.31s 5.41s
Total Time 13.17s (± 0.54%) 13.16s (± 0.28%) -0.00s (- 0.02%) 13.06s 13.23s
Monaco - node (v10.16.3, x64)
Memory used 354,726k (± 0.02%) 354,750k (± 0.03%) +24k (+ 0.01%) 354,505k 355,106k
Parse Time 1.61s (± 0.44%) 1.60s (± 0.59%) -0.01s (- 0.31%) 1.59s 1.63s
Bind Time 0.73s (± 0.76%) 0.73s (± 0.71%) +0.00s (+ 0.14%) 0.72s 0.74s
Check Time 5.16s (± 0.49%) 5.12s (± 0.50%) -0.04s (- 0.70%) 5.07s 5.19s
Emit Time 2.82s (± 0.51%) 2.81s (± 0.66%) -0.01s (- 0.28%) 2.78s 2.86s
Total Time 10.32s (± 0.40%) 10.27s (± 0.42%) -0.05s (- 0.48%) 10.18s 10.36s
TFS - node (v10.16.3, x64)
Memory used 307,839k (± 0.02%) 307,870k (± 0.02%) +31k (+ 0.01%) 307,719k 307,967k
Parse Time 1.24s (± 0.81%) 1.24s (± 0.50%) +0.00s (+ 0.32%) 1.23s 1.25s
Bind Time 0.69s (± 0.87%) 0.68s (± 0.91%) -0.01s (- 1.02%) 0.67s 0.69s
Check Time 4.59s (± 0.58%) 4.59s (± 0.42%) -0.00s (- 0.07%) 4.54s 4.63s
Emit Time 2.96s (± 0.94%) 2.93s (± 0.88%) -0.03s (- 0.95%) 2.87s 2.98s
Total Time 9.47s (± 0.47%) 9.44s (± 0.34%) -0.04s (- 0.39%) 9.36s 9.51s
material-ui - node (v10.16.3, x64)
Memory used 489,230k (± 0.01%) 489,296k (± 0.02%) +66k (+ 0.01%) 489,157k 489,515k
Parse Time 2.06s (± 0.40%) 2.06s (± 0.44%) -0.00s (- 0.19%) 2.05s 2.09s
Bind Time 0.66s (± 0.57%) 0.65s (± 1.04%) -0.00s (- 0.15%) 0.64s 0.67s
Check Time 13.68s (± 0.62%) 13.59s (± 0.85%) -0.10s (- 0.71%) 13.38s 13.82s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.40s (± 0.53%) 16.30s (± 0.73%) -0.10s (- 0.62%) 16.08s 16.53s
Angular - node (v12.1.0, x64)
Memory used 322,336k (± 0.01%) 322,365k (± 0.02%) +30k (+ 0.01%) 322,225k 322,599k
Parse Time 1.96s (± 0.24%) 1.96s (± 0.59%) +0.00s (+ 0.20%) 1.94s 1.99s
Bind Time 0.81s (± 0.45%) 0.82s (± 0.71%) +0.00s (+ 0.37%) 0.80s 0.83s
Check Time 4.91s (± 0.41%) 4.92s (± 1.04%) +0.01s (+ 0.29%) 4.86s 5.11s
Emit Time 5.49s (± 0.53%) 5.50s (± 0.71%) +0.02s (+ 0.31%) 5.43s 5.59s
Total Time 13.16s (± 0.31%) 13.20s (± 0.51%) +0.04s (+ 0.30%) 13.05s 13.34s
Monaco - node (v12.1.0, x64)
Memory used 336,824k (± 0.02%) 336,895k (± 0.02%) +71k (+ 0.02%) 336,767k 337,064k
Parse Time 1.59s (± 0.90%) 1.59s (± 0.86%) +0.00s (+ 0.13%) 1.57s 1.63s
Bind Time 0.71s (± 0.56%) 0.71s (± 0.81%) +0.00s (+ 0.14%) 0.70s 0.72s
Check Time 4.93s (± 0.60%) 4.93s (± 0.57%) -0.00s (- 0.04%) 4.87s 4.98s
Emit Time 2.86s (± 0.50%) 2.89s (± 0.63%) +0.04s (+ 1.26%) 2.86s 2.95s
Total Time 10.09s (± 0.48%) 10.13s (± 0.32%) +0.04s (+ 0.40%) 10.05s 10.20s
TFS - node (v12.1.0, x64)
Memory used 292,077k (± 0.01%) 292,095k (± 0.02%) +18k (+ 0.01%) 291,937k 292,264k
Parse Time 1.25s (± 0.49%) 1.25s (± 0.74%) -0.00s (- 0.08%) 1.23s 1.27s
Bind Time 0.65s (± 1.16%) 0.66s (± 1.06%) +0.01s (+ 1.07%) 0.65s 0.68s
Check Time 4.52s (± 0.66%) 4.51s (± 0.49%) -0.01s (- 0.15%) 4.48s 4.58s
Emit Time 2.96s (± 0.97%) 2.95s (± 0.90%) -0.01s (- 0.34%) 2.90s 3.01s
Total Time 9.38s (± 0.54%) 9.38s (± 0.46%) -0.01s (- 0.09%) 9.27s 9.48s
material-ui - node (v12.1.0, x64)
Memory used 467,084k (± 0.07%) 466,861k (± 0.08%) -223k (- 0.05%) 466,113k 467,361k
Parse Time 2.08s (± 0.48%) 2.08s (± 0.45%) -0.01s (- 0.29%) 2.06s 2.10s
Bind Time 0.65s (± 1.06%) 0.65s (± 1.12%) +0.00s (+ 0.47%) 0.64s 0.67s
Check Time 12.14s (± 0.94%) 12.21s (± 1.13%) +0.07s (+ 0.54%) 11.81s 12.50s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.87s (± 0.80%) 14.94s (± 0.93%) +0.07s (+ 0.46%) 14.52s 15.22s
Angular - node (v8.9.0, x64)
Memory used 346,997k (± 0.02%) 347,020k (± 0.02%) +24k (+ 0.01%) 346,762k 347,176k
Parse Time 2.52s (± 0.35%) 2.52s (± 0.44%) -0.00s (- 0.12%) 2.50s 2.55s
Bind Time 0.87s (± 0.92%) 0.87s (± 0.42%) +0.00s (+ 0.23%) 0.87s 0.88s
Check Time 5.65s (± 0.74%) 5.63s (± 0.85%) -0.02s (- 0.34%) 5.54s 5.74s
Emit Time 6.38s (± 0.61%) 6.35s (± 1.13%) -0.03s (- 0.52%) 6.23s 6.51s
Total Time 15.43s (± 0.46%) 15.37s (± 0.71%) -0.06s (- 0.36%) 15.18s 15.66s
Monaco - node (v8.9.0, x64)
Memory used 358,515k (± 0.01%) 358,533k (± 0.02%) +18k (+ 0.01%) 358,392k 358,730k
Parse Time 1.94s (± 0.49%) 1.94s (± 0.57%) -0.00s (- 0.05%) 1.91s 1.96s
Bind Time 0.91s (± 0.73%) 0.92s (± 0.71%) +0.00s (+ 0.55%) 0.90s 0.93s
Check Time 5.67s (± 0.56%) 5.69s (± 0.42%) +0.02s (+ 0.41%) 5.64s 5.73s
Emit Time 3.43s (± 0.79%) 3.41s (± 0.93%) -0.02s (- 0.61%) 3.29s 3.45s
Total Time 11.94s (± 0.39%) 11.94s (± 0.36%) +0.00s (+ 0.03%) 11.86s 12.03s
TFS - node (v8.9.0, x64)
Memory used 310,383k (± 0.01%) 310,404k (± 0.02%) +22k (+ 0.01%) 310,309k 310,540k
Parse Time 1.57s (± 0.63%) 1.57s (± 0.65%) -0.00s (- 0.06%) 1.56s 1.61s
Bind Time 0.69s (± 0.72%) 0.69s (± 0.49%) +0.01s (+ 1.02%) 0.69s 0.70s
Check Time 5.33s (± 0.67%) 5.35s (± 0.63%) +0.03s (+ 0.49%) 5.29s 5.44s
Emit Time 2.96s (± 1.04%) 2.98s (± 0.98%) +0.02s (+ 0.81%) 2.91s 3.04s
Total Time 10.54s (± 0.59%) 10.60s (± 0.50%) +0.06s (+ 0.53%) 10.48s 10.71s
material-ui - node (v8.9.0, x64)
Memory used 496,276k (± 0.01%) 496,308k (± 0.01%) +32k (+ 0.01%) 496,138k 496,366k
Parse Time 2.50s (± 0.46%) 2.49s (± 0.61%) -0.01s (- 0.24%) 2.47s 2.54s
Bind Time 0.81s (± 1.30%) 0.82s (± 1.18%) +0.01s (+ 0.61%) 0.80s 0.84s
Check Time 18.26s (± 0.53%) 18.05s (± 0.86%) -0.21s (- 1.15%) 17.74s 18.43s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 21.58s (± 0.43%) 21.37s (± 0.78%) -0.20s (- 0.95%) 21.08s 21.80s
Angular - node (v8.9.0, x86)
Memory used 199,009k (± 0.02%) 198,981k (± 0.02%) -28k (- 0.01%) 198,849k 199,046k
Parse Time 2.43s (± 0.93%) 2.43s (± 0.80%) -0.01s (- 0.25%) 2.39s 2.49s
Bind Time 1.02s (± 1.04%) 1.02s (± 0.89%) -0.01s (- 0.59%) 1.00s 1.04s
Check Time 5.05s (± 0.66%) 5.07s (± 0.73%) +0.02s (+ 0.36%) 5.00s 5.17s
Emit Time 6.13s (± 0.57%) 6.11s (± 0.73%) -0.02s (- 0.31%) 6.04s 6.23s
Total Time 14.64s (± 0.49%) 14.62s (± 0.45%) -0.02s (- 0.11%) 14.51s 14.74s
Monaco - node (v8.9.0, x86)
Memory used 203,074k (± 0.02%) 203,052k (± 0.02%) -22k (- 0.01%) 202,937k 203,117k
Parse Time 1.99s (± 1.23%) 1.96s (± 0.54%) -0.02s (- 1.11%) 1.94s 1.98s
Bind Time 0.72s (± 1.22%) 0.72s (± 0.62%) -0.01s (- 0.69%) 0.71s 0.73s
Check Time 5.78s (± 0.52%) 5.75s (± 1.14%) -0.03s (- 0.54%) 5.50s 5.82s
Emit Time 2.77s (± 1.28%) 2.80s (± 2.98%) +0.03s (+ 0.94%) 2.71s 3.13s
Total Time 11.26s (± 0.47%) 11.23s (± 0.34%) -0.03s (- 0.28%) 11.15s 11.32s
TFS - node (v8.9.0, x86)
Memory used 177,512k (± 0.02%) 177,495k (± 0.03%) -17k (- 0.01%) 177,395k 177,639k
Parse Time 1.62s (± 1.53%) 1.60s (± 0.59%) -0.01s (- 0.68%) 1.59s 1.63s
Bind Time 0.66s (± 1.37%) 0.66s (± 1.32%) +0.00s (+ 0.46%) 0.65s 0.69s
Check Time 4.85s (± 1.04%) 4.88s (± 0.87%) +0.04s (+ 0.72%) 4.82s 5.03s
Emit Time 2.89s (± 2.68%) 2.85s (± 1.26%) -0.04s (- 1.39%) 2.74s 2.93s
Total Time 10.00s (± 1.30%) 9.99s (± 0.75%) -0.01s (- 0.14%) 9.84s 10.23s
material-ui - node (v8.9.0, x86)
Memory used 279,361k (± 0.01%) 279,368k (± 0.02%) +6k (+ 0.00%) 279,208k 279,463k
Parse Time 2.56s (± 0.60%) 2.55s (± 0.54%) -0.01s (- 0.20%) 2.52s 2.59s
Bind Time 0.76s (± 6.65%) 0.76s (± 5.27%) +0.00s (+ 0.13%) 0.69s 0.86s
Check Time 16.60s (± 1.16%) 16.48s (± 1.21%) -0.12s (- 0.73%) 16.17s 16.95s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 19.91s (± 0.86%) 19.79s (± 0.98%) -0.13s (- 0.63%) 19.49s 20.26s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
Benchmark Name Iterations
Current 41378 10
Baseline master 10

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

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.

Personally, I agree with the ensuing discussion in the originating bug, and think you should simplify down to (2).

src/compiler/checker.ts Show resolved Hide resolved
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.

Still need to test object binding elements -- we must not have test coverage for them, or they're being handled some other way (in which case I'd like to know what it is).

src/compiler/checker.ts Show resolved Hide resolved
@sandersn sandersn merged commit a276a6d into microsoft:master Jan 12, 2021
Zzzen pushed a commit to Zzzen/TypeScript that referenced this pull request Jan 16, 2021
@mangkoran
Copy link

Sorry for asking here, but is there any documentation of the usage of _ prefix in this context yet? I have not found it in TypeScript's documentation

@markeissler
Copy link

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

Successfully merging this pull request may close these issues.

Destructuring array, ability to explicitly tell the variable is unused
7 participants