Skip to content

Always create optional properties when spreading objects conditionally - #40778

Merged
Wesley Wigham (weswigham) merged 6 commits into
microsoft:masterfrom
weswigham:spread-compact-literals
Oct 12, 2020
Merged

Always create optional properties when spreading objects conditionally#40778
Wesley Wigham (weswigham) merged 6 commits into
microsoft:masterfrom
weswigham:spread-compact-literals

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes#40754

@weswigham

Copy link
Copy Markdown
MemberAuthor

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 4156662. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 4156662. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 4156662. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 4156662. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 4156662. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), 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/86538/artifacts?artifactName=tgz&fileId=909B0605B6A1C79D492FD1089766D5E2731694154481EA36B033363558CFA19002&fileName=/typescript-4.1.0-insiders.20200925.tgz"
}
}

and then running npm install.


There is also a playground for this build.

@typescript-bot

Copy link
Copy Markdown
Contributor

Wesley Wigham (@weswigham)
The results of the perf run you requested are in!

Here they are:

Comparison Report - master..40778

Metricmaster40778DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used349,605k (± 0.02%)349,567k (± 0.02%)-38k (- 0.01%)349,383k349,754k
Parse Time2.02s (± 0.65%)2.01s (± 0.72%)-0.01s (- 0.40%)1.98s2.04s
Bind Time0.83s (± 0.74%)0.83s (± 0.96%)+0.00s (+ 0.12%)0.82s0.85s
Check Time4.93s (± 0.54%)4.92s (± 0.48%)-0.01s (- 0.22%)4.88s4.98s
Emit Time5.23s (± 1.04%)5.21s (± 0.91%)-0.02s (- 0.36%)5.13s5.35s
Total Time13.01s (± 0.52%)12.98s (± 0.52%)-0.04s (- 0.27%)12.87s13.20s
Monaco - node (v10.16.3, x64)
Memory used354,382k (± 0.02%)354,322k (± 0.02%)-60k (- 0.02%)354,201k354,466k
Parse Time1.58s (± 0.57%)1.56s (± 0.73%)-0.02s (- 1.14%)1.53s1.58s
Bind Time0.71s (± 0.83%)0.71s (± 0.42%)-0.00s (- 0.28%)0.71s0.72s
Check Time5.07s (± 0.49%)5.05s (± 0.44%)-0.02s (- 0.47%)5.00s5.08s
Emit Time2.76s (± 0.38%)2.75s (± 0.51%)-0.01s (- 0.43%)2.72s2.78s
Total Time10.13s (± 0.34%)10.07s (± 0.36%)-0.05s (- 0.50%)9.99s10.14s
TFS - node (v10.16.3, x64)
Memory used307,583k (± 0.02%)307,568k (± 0.02%)-15k (- 0.00%)307,458k307,672k
Parse Time1.23s (± 0.73%)1.22s (± 0.46%)-0.01s (- 0.65%)1.21s1.23s
Bind Time0.68s (± 0.54%)0.67s (± 1.12%)-0.01s (- 1.33%)0.65s0.68s
Check Time4.52s (± 0.51%)4.53s (± 0.59%)+0.00s (+ 0.09%)4.48s4.59s
Emit Time2.90s (± 1.21%)2.92s (± 0.88%)+0.02s (+ 0.83%)2.84s2.96s
Total Time9.32s (± 0.62%)9.33s (± 0.39%)+0.01s (+ 0.10%)9.26s9.42s
material-ui - node (v10.16.3, x64)
Memory used488,920k (± 0.02%)488,907k (± 0.01%)-12k (- 0.00%)488,784k489,007k
Parse Time1.99s (± 0.46%)1.98s (± 0.56%)-0.01s (- 0.55%)1.96s2.01s
Bind Time0.65s (± 0.61%)0.65s (± 0.80%)-0.00s (- 0.31%)0.64s0.66s
Check Time13.64s (± 0.93%)13.50s (± 0.65%)-0.14s (- 1.00%)13.32s13.66s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.28s (± 0.79%)16.12s (± 0.55%)-0.15s (- 0.95%)15.94s16.31s
Angular - node (v12.1.0, x64)
Memory used326,821k (± 0.02%)326,808k (± 0.02%)-13k (- 0.00%)326,664k326,938k
Parse Time1.99s (± 0.68%)2.00s (± 0.63%)+0.01s (+ 0.40%)1.97s2.04s
Bind Time0.81s (± 0.42%)0.81s (± 0.42%)+0.01s (+ 0.74%)0.81s0.82s
Check Time4.79s (± 0.46%)4.83s (± 0.56%)+0.03s (+ 0.67%)4.78s4.90s
Emit Time5.36s (± 0.57%)5.37s (± 0.62%)+0.00s (+ 0.07%)5.28s5.43s
Total Time12.95s (± 0.41%)13.00s (± 0.48%)+0.05s (+ 0.37%)12.86s13.15s
Monaco - node (v12.1.0, x64)
Memory used336,542k (± 0.02%)336,534k (± 0.02%)-8k (- 0.00%)336,421k336,733k
Parse Time1.55s (± 0.57%)1.54s (± 0.65%)-0.01s (- 0.52%)1.52s1.57s
Bind Time0.69s (± 0.43%)0.69s (± 0.72%)+0.00s (+ 0.43%)0.69s0.71s
Check Time4.87s (± 0.36%)4.86s (± 0.48%)-0.01s (- 0.23%)4.81s4.93s
Emit Time2.81s (± 1.06%)2.82s (± 0.49%)+0.01s (+ 0.18%)2.78s2.84s
Total Time9.93s (± 0.47%)9.92s (± 0.23%)-0.01s (- 0.12%)9.87s9.97s
TFS - node (v12.1.0, x64)
Memory used291,803k (± 0.02%)291,836k (± 0.02%)+34k (+ 0.01%)291,710k291,973k
Parse Time1.23s (± 0.67%)1.24s (± 1.15%)+0.01s (+ 0.41%)1.21s1.27s
Bind Time0.64s (± 0.53%)0.64s (± 0.73%)-0.00s (- 0.47%)0.63s0.65s
Check Time4.45s (± 0.40%)4.43s (± 0.44%)-0.01s (- 0.29%)4.38s4.48s
Emit Time2.93s (± 1.63%)2.93s (± 1.17%)+0.00s (+ 0.03%)2.87s3.03s
Total Time9.25s (± 0.60%)9.24s (± 0.48%)-0.01s (- 0.08%)9.19s9.37s
material-ui - node (v12.1.0, x64)
Memory used466,836k (± 0.08%)466,862k (± 0.07%)+26k (+ 0.01%)465,962k467,204k
Parse Time2.01s (± 0.57%)2.02s (± 0.54%)+0.01s (+ 0.40%)2.00s2.04s
Bind Time0.64s (± 1.38%)0.64s (± 0.87%)-0.00s (- 0.31%)0.63s0.65s
Check Time12.19s (± 1.06%)12.16s (± 1.18%)-0.03s (- 0.25%)11.95s12.57s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.85s (± 0.91%)14.82s (± 1.01%)-0.03s (- 0.17%)14.59s15.24s
Angular - node (v8.9.0, x64)
Memory used346,275k (± 0.03%)346,308k (± 0.03%)+33k (+ 0.01%)346,051k346,506k
Parse Time2.55s (± 0.54%)2.54s (± 0.41%)-0.00s (- 0.12%)2.52s2.57s
Bind Time0.87s (± 0.94%)0.86s (± 0.75%)-0.01s (- 0.92%)0.85s0.88s
Check Time5.56s (± 0.81%)5.55s (± 0.73%)-0.01s (- 0.22%)5.46s5.62s
Emit Time6.04s (± 1.55%)6.11s (± 1.95%)+0.07s (+ 1.21%)5.88s6.37s
Total Time15.01s (± 0.34%)15.06s (± 0.81%)+0.05s (+ 0.33%)14.78s15.30s
Monaco - node (v8.9.0, x64)
Memory used355,603k (± 0.01%)355,641k (± 0.02%)+38k (+ 0.01%)355,425k355,753k
Parse Time1.88s (± 0.45%)1.88s (± 0.47%)+0.00s (+ 0.05%)1.86s1.90s
Bind Time0.90s (± 0.98%)0.89s (± 0.55%)-0.00s (- 0.33%)0.88s0.90s
Check Time5.62s (± 0.39%)5.60s (± 0.44%)-0.02s (- 0.37%)5.54s5.66s
Emit Time3.29s (± 1.37%)3.30s (± 1.19%)+0.01s (+ 0.27%)3.20s3.37s
Total Time11.69s (± 0.57%)11.68s (± 0.36%)-0.01s (- 0.13%)11.54s11.73s
TFS - node (v8.9.0, x64)
Memory used309,293k (± 0.01%)309,285k (± 0.02%)-7k (- 0.00%)309,131k309,379k
Parse Time1.55s (± 0.43%)1.55s (± 0.50%)-0.00s (- 0.26%)1.53s1.56s
Bind Time0.68s (± 0.77%)0.68s (± 1.07%)-0.00s (- 0.15%)0.66s0.69s
Check Time5.31s (± 0.64%)5.29s (± 0.37%)-0.02s (- 0.36%)5.24s5.32s
Emit Time2.95s (± 0.81%)2.95s (± 0.63%)-0.00s (- 0.03%)2.91s2.99s
Total Time10.48s (± 0.42%)10.46s (± 0.34%)-0.03s (- 0.25%)10.37s10.51s
material-ui - node (v8.9.0, x64)
Memory used493,358k (± 0.01%)493,364k (± 0.03%)+6k (+ 0.00%)493,162k493,810k
Parse Time2.41s (± 0.54%)2.41s (± 0.52%)-0.00s (- 0.12%)2.38s2.43s
Bind Time0.82s (± 1.22%)0.81s (± 1.26%)-0.01s (- 0.73%)0.79s0.84s
Check Time17.89s (± 1.22%)17.93s (± 0.87%)+0.05s (+ 0.25%)17.50s18.19s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time21.11s (± 1.01%)21.15s (± 0.77%)+0.04s (+ 0.18%)20.69s21.38s
Angular - node (v8.9.0, x86)
Memory used198,607k (± 0.03%)198,602k (± 0.03%)-5k (- 0.00%)198,420k198,750k
Parse Time2.48s (± 0.58%)2.47s (± 1.13%)-0.01s (- 0.44%)2.44s2.56s
Bind Time1.00s (± 0.89%)1.01s (± 0.72%)+0.00s (+ 0.40%)0.99s1.02s
Check Time5.01s (± 0.43%)5.01s (± 0.72%)+0.01s (+ 0.14%)4.93s5.08s
Emit Time5.96s (± 0.90%)5.91s (± 0.84%)-0.05s (- 0.77%)5.81s6.02s
Total Time14.45s (± 0.36%)14.41s (± 0.61%)-0.04s (- 0.30%)14.24s14.59s
Monaco - node (v8.9.0, x86)
Memory used201,440k (± 0.03%)201,419k (± 0.01%)-20k (- 0.01%)201,347k201,483k
Parse Time1.93s (± 0.75%)1.92s (± 0.51%)-0.02s (- 0.83%)1.90s1.95s
Bind Time0.70s (± 0.85%)0.71s (± 0.67%)+0.00s (+ 0.28%)0.70s0.72s
Check Time5.49s (± 1.46%)5.46s (± 1.37%)-0.03s (- 0.47%)5.36s5.68s
Emit Time2.98s (± 4.01%)2.99s (± 3.87%)+0.00s (+ 0.10%)2.65s3.10s
Total Time11.11s (± 0.84%)11.08s (± 0.53%)-0.03s (- 0.31%)10.90s11.20s
TFS - node (v8.9.0, x86)
Memory used176,778k (± 0.03%)176,801k (± 0.03%)+24k (+ 0.01%)176,677k176,885k
Parse Time1.58s (± 0.85%)1.59s (± 0.84%)+0.01s (+ 0.51%)1.57s1.63s
Bind Time0.64s (± 0.53%)0.65s (± 1.47%)+0.00s (+ 0.47%)0.63s0.67s
Check Time4.80s (± 0.53%)4.80s (± 0.50%)+0.01s (+ 0.13%)4.76s4.85s
Emit Time2.78s (± 0.59%)2.79s (± 1.17%)+0.02s (+ 0.54%)2.73s2.89s
Total Time9.80s (± 0.31%)9.83s (± 0.45%)+0.03s (+ 0.31%)9.73s9.94s
material-ui - node (v8.9.0, x86)
Memory used277,760k (± 0.02%)277,735k (± 0.02%)-25k (- 0.01%)277,569k277,821k
Parse Time2.47s (± 0.66%)2.46s (± 0.49%)-0.01s (- 0.28%)2.44s2.49s
Bind Time0.72s (± 5.52%)0.70s (± 3.59%)-0.02s (- 2.77%)0.68s0.80s
Check Time16.44s (± 0.63%)16.39s (± 0.63%)-0.05s (- 0.32%)16.28s16.78s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time19.63s (± 0.53%)19.55s (± 0.49%)-0.08s (- 0.39%)19.43s19.91s
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)
BenchmarkNameIterations
Current4077810
Baselinemaster10

@typescript-bot

Copy link
Copy Markdown
Contributor

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

@amcasey

Copy link
Copy Markdown
Member

Looks good in the project that inspired the bug.

@ahejlsberg

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 10, 2020

Copy link
Copy Markdown
Contributor

Heya Anders Hejlsberg (@ahejlsberg), I've started to run the tarball bundle task on this PR at 4156662. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Oct 10, 2020

Copy link
Copy Markdown
Contributor

Hey Anders Hejlsberg (@ahejlsberg), 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/87440/artifacts?artifactName=tgz&fileId=10CFBA909154FC3A3E00AF7B6BF5732CA0642D32E0BA4C34B51C92475AC34DC802&fileName=/typescript-4.1.0-insiders.20201010.tgz"
}
}

and then running npm install.


There is also a playground for this build.

@weswigham

Copy link
Copy Markdown
MemberAuthor

Do we want this in 4.1 or in 4.2?

@ahejlsberg

Copy link
Copy Markdown
Member

I vote 4.1.

@amcasey

Copy link
Copy Markdown
Member

FWIW, the design notes suggested we settled on 4.2.

@weswigham

Wesley Wigham (weswigham) commented Oct 12, 2020

Copy link
Copy Markdown
MemberAuthor

Nobody seemed to object to moving this to 4.1 in today's standup, so I'm assuming I should do so.

@typescript-botTypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 12, 2020
@Roboticsense00

Copy link
Copy Markdown

31
708 kansas
Gb
Bktxh

@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Nov 18, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Repeated conditional spreading of object literals results in OOM

6 participants

@weswigham@typescript-bot@amcasey@ahejlsberg@Roboticsense00@sandersn