Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add __spreadArrays helper#31166

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rbuckton merged 2 commits intomasterfromspreadArraysES5
Jun 11, 2019
Merged

Add __spreadArrays helper#31166

rbuckton merged 2 commits intomasterfromspreadArraysES5
Jun 11, 2019

Conversation

@rbuckton
Copy link
Contributor

@rbucktonrbuckton commentedApr 29, 2019
edited
Loading

Adds a__spreadArrays helper for a more accurate spread behavior whennot using--downlevelIteration.

Fixes#8856

@rbuckton
Copy link
ContributorAuthor

@typescript-bot perf test

@typescript-bot
Copy link
Collaborator

typescript-bot commentedApr 29, 2019
edited
Loading

Heya@rbuckton, I've started to run the perf test suite on this PR at528601f. You can monitor the buildhere. It should now contribute to this PR's status checks.

Update:The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..31166

Metricmaster31166DeltaBestWorst
Angular - node (v12.1.0, x64)
Memory used313,388k (± 0.02%)313,430k (± 0.02%)+42k (+ 0.01%)313,303k313,531k
Parse Time1.38s (± 0.68%)1.42s (± 0.94%)+0.04s (+ 2.83%)1.40s1.45s
Bind Time0.73s (± 0.65%)0.74s (± 1.13%)+0.00s (+ 0.27%)0.72s0.75s
Check Time3.96s (± 0.59%)3.98s (± 0.40%)+0.02s (+ 0.40%)3.94s4.00s
Emit Time5.14s (± 0.82%)5.14s (± 0.51%)+0.00s (+ 0.06%)5.08s5.19s
Total Time11.21s (± 0.54%)11.27s (± 0.40%)+0.06s (+ 0.51%)11.15s11.34s
Monaco - node (v12.1.0, x64)
Memory used341,959k (± 0.02%)342,000k (± 0.02%)+41k (+ 0.01%)341,868k342,106k
Parse Time1.17s (± 0.66%)1.19s (± 0.52%)+0.02s (+ 1.71%)1.18s1.20s
Bind Time0.67s (± 0.97%)0.67s (± 1.41%)+0.01s (+ 0.90%)0.66s0.70s
Check Time4.06s (± 0.51%)4.04s (± 0.43%)-0.02s (- 0.42%)4.00s4.09s
Emit Time2.77s (± 0.59%)2.76s (± 0.58%)-0.00s (- 0.14%)2.74s2.80s
Total Time8.66s (± 0.30%)8.67s (± 0.32%)+0.01s (+ 0.12%)8.62s8.74s
TFS - node (v12.1.0, x64)
Memory used298,947k (± 0.01%)298,897k (± 0.03%)-51k (- 0.02%)298,743k299,064k
Parse Time0.92s (± 0.74%)0.92s (± 0.96%)+0.01s (+ 0.87%)0.90s0.95s
Bind Time0.62s (± 0.93%)0.62s (± 0.60%)-0.00s (- 0.81%)0.61s0.62s
Check Time3.62s (± 0.41%)3.64s (± 0.55%)+0.02s (+ 0.58%)3.58s3.67s
Emit Time2.86s (± 0.85%)2.85s (± 0.86%)-0.00s (- 0.14%)2.78s2.91s
Total Time8.01s (± 0.41%)8.03s (± 0.43%)+0.02s (+ 0.27%)7.94s8.10s
Angular - node (v8.9.0, x64)
Memory used330,848k (± 0.02%)330,894k (± 0.02%)+46k (+ 0.01%)330,786k331,042k
Parse Time1.78s (± 0.47%)1.79s (± 0.27%)+0.02s (+ 1.01%)1.78s1.80s
Bind Time0.79s (± 0.98%)0.80s (± 0.86%)+0.01s (+ 0.63%)0.78s0.81s
Check Time4.66s (± 1.58%)4.62s (± 1.42%)-0.04s (- 0.90%)4.48s4.75s
Emit Time5.88s (± 2.75%)5.88s (± 2.64%)+0.00s (+ 0.03%)5.60s6.18s
Total Time13.11s (± 0.98%)13.09s (± 0.98%)-0.02s (- 0.16%)12.85s13.33s
Monaco - node (v8.9.0, x64)
Memory used358,630k (± 0.02%)358,689k (± 0.02%)+59k (+ 0.02%)358,503k358,904k
Parse Time1.43s (± 0.34%)1.45s (± 0.54%)+0.01s (+ 1.05%)1.42s1.46s
Bind Time0.92s (± 0.67%)0.90s (± 1.40%)-0.03s (- 2.82%)0.87s0.91s
Check Time4.73s (± 0.45%)4.86s (± 1.76%)+0.13s (+ 2.72%)4.73s5.04s
Emit Time3.40s (± 0.54%)3.15s (± 6.58%)-0.25s (- 7.38%)2.80s3.40s
Total Time10.49s (± 0.32%)10.36s (± 1.36%)-0.13s (- 1.23%)10.10s10.56s
TFS - node (v8.9.0, x64)
Memory used314,046k (± 0.01%)314,055k (± 0.01%)+9k (+ 0.00%)313,962k314,165k
Parse Time1.14s (± 0.54%)1.14s (± 0.77%)+0.00s (+ 0.35%)1.13s1.17s
Bind Time0.66s (± 0.61%)0.67s (± 1.12%)+0.01s (+ 0.91%)0.65s0.69s
Check Time4.19s (± 0.40%)4.22s (± 0.63%)+0.03s (+ 0.62%)4.17s4.26s
Emit Time3.13s (± 0.61%)3.12s (± 0.51%)-0.00s (- 0.13%)3.09s3.17s
Total Time9.12s (± 0.35%)9.15s (± 0.37%)+0.03s (+ 0.35%)9.08s9.21s
Angular - node (v8.9.0, x86)
Memory used187,343k (± 0.02%)187,360k (± 0.02%)+17k (+ 0.01%)187,282k187,438k
Parse Time1.72s (± 0.80%)1.75s (± 0.58%)+0.04s (+ 2.04%)1.73s1.77s
Bind Time0.93s (± 0.74%)0.93s (± 1.97%)-0.00s (- 0.11%)0.89s0.98s
Check Time4.30s (± 0.50%)4.30s (± 0.31%)-0.01s (- 0.19%)4.27s4.33s
Emit Time5.64s (± 1.17%)5.64s (± 1.19%)+0.00s (+ 0.02%)5.51s5.77s
Total Time12.59s (± 0.73%)12.61s (± 0.62%)+0.03s (+ 0.21%)12.44s12.78s
Monaco - node (v8.9.0, x86)
Memory used200,012k (± 0.01%)200,027k (± 0.02%)+14k (+ 0.01%)199,920k200,088k
Parse Time1.48s (± 0.55%)1.51s (± 0.84%)+0.03s (+ 1.96%)1.48s1.54s
Bind Time0.72s (± 2.43%)0.71s (± 0.73%)-0.01s (- 1.80%)0.70s0.72s
Check Time4.62s (± 0.60%)4.62s (± 0.51%)+0.00s (+ 0.02%)4.55s4.65s
Emit Time3.09s (± 0.57%)3.07s (± 0.45%)-0.01s (- 0.39%)3.05s3.12s
Total Time9.90s (± 0.37%)9.91s (± 0.29%)+0.01s (+ 0.09%)9.85s9.97s
TFS - node (v8.9.0, x86)
Memory used176,085k (± 0.03%)176,092k (± 0.02%)+8k (+ 0.00%)176,007k176,198k
Parse Time1.18s (± 1.01%)1.21s (± 1.00%)+0.02s (+ 2.03%)1.19s1.24s
Bind Time0.63s (± 0.94%)0.63s (± 0.75%)-0.00s (- 0.63%)0.62s0.64s
Check Time4.04s (± 0.52%)4.06s (± 0.89%)+0.02s (+ 0.45%)3.99s4.12s
Emit Time2.75s (± 1.24%)2.73s (± 1.22%)-0.02s (- 0.76%)2.68s2.83s
Total Time8.61s (± 0.64%)8.63s (± 0.76%)+0.02s (+ 0.20%)8.48s8.73s
Angular - node (v9.0.0, x64)
Memory used330,616k (± 0.02%)330,548k (± 0.02%)-69k (- 0.02%)330,446k330,693k
Parse Time1.62s (± 0.50%)1.63s (± 0.29%)+0.01s (+ 0.43%)1.62s1.64s
Bind Time0.74s (± 1.11%)0.74s (± 0.90%)-0.01s (- 0.67%)0.73s0.75s
Check Time4.34s (± 0.48%)4.31s (± 0.53%)-0.03s (- 0.67%)4.25s4.38s
Emit Time5.73s (± 1.77%)5.71s (± 1.77%)-0.02s (- 0.40%)5.51s5.91s
Total Time12.44s (± 1.01%)12.39s (± 0.82%)-0.05s (- 0.36%)12.19s12.60s
Monaco - node (v9.0.0, x64)
Memory used358,518k (± 0.02%)358,607k (± 0.02%)+89k (+ 0.02%)358,411k358,736k
Parse Time1.28s (± 0.71%)1.29s (± 0.53%)+0.01s (+ 1.01%)1.28s1.31s
Bind Time0.85s (± 0.40%)0.85s (± 0.70%)-0.01s (- 0.82%)0.84s0.86s
Check Time4.68s (± 0.47%)4.71s (± 0.37%)+0.02s (+ 0.49%)4.68s4.75s
Emit Time3.27s (± 1.63%)3.28s (± 0.51%)+0.01s (+ 0.40%)3.23s3.30s
Total Time10.09s (± 0.73%)10.13s (± 0.30%)+0.04s (+ 0.39%)10.03s10.18s
TFS - node (v9.0.0, x64)
Memory used313,931k (± 0.02%)313,909k (± 0.02%)-22k (- 0.01%)313,799k314,070k
Parse Time1.00s (± 0.33%)1.01s (± 0.37%)+0.01s (+ 1.50%)1.01s1.02s
Bind Time0.62s (± 0.77%)0.61s (± 0.95%)-0.00s (- 0.65%)0.60s0.63s
Check Time4.23s (± 2.06%)4.24s (± 2.17%)+0.01s (+ 0.19%)4.12s4.45s
Emit Time2.97s (± 3.30%)2.98s (± 3.20%)+0.02s (+ 0.54%)2.82s3.14s
Total Time8.81s (± 0.47%)8.85s (± 0.39%)+0.04s (+ 0.44%)8.76s8.91s
Angular - node (v9.0.0, x86)
Memory used187,522k (± 0.03%)187,512k (± 0.03%)-10k (- 0.01%)187,396k187,658k
Parse Time1.54s (± 0.58%)1.57s (± 0.86%)+0.04s (+ 2.35%)1.55s1.61s
Bind Time0.86s (± 0.55%)0.89s (± 0.77%)+0.03s (+ 2.91%)0.87s0.90s
Check Time4.01s (± 0.54%)4.05s (± 0.65%)+0.04s (+ 0.95%)4.00s4.13s
Emit Time5.33s (± 0.79%)5.39s (± 0.76%)+0.06s (+ 1.20%)5.32s5.53s
Total Time11.73s (± 0.40%)11.89s (± 0.65%)+0.16s (+ 1.36%)11.79s12.16s
Monaco - node (v9.0.0, x86)
Memory used200,072k (± 0.03%)200,057k (± 0.02%)-14k (- 0.01%)199,996k200,211k
Parse Time1.31s (± 0.58%)1.33s (± 0.60%)+0.02s (+ 1.76%)1.31s1.35s
Bind Time0.64s (± 0.90%)0.64s (± 1.41%)+0.00s (+ 0.16%)0.63s0.67s
Check Time4.48s (± 0.29%)4.48s (± 0.40%)-0.00s (- 0.04%)4.43s4.50s
Emit Time2.99s (± 0.37%)3.00s (± 0.69%)+0.01s (+ 0.20%)2.96s3.06s
Total Time9.41s (± 0.20%)9.44s (± 0.31%)+0.02s (+ 0.27%)9.39s9.52s
TFS - node (v9.0.0, x86)
Memory used176,172k (± 0.02%)176,236k (± 0.02%)+64k (+ 0.04%)176,139k176,319k
Parse Time1.03s (± 1.53%)1.04s (± 0.66%)+0.01s (+ 0.68%)1.02s1.05s
Bind Time0.57s (± 1.43%)0.58s (± 0.77%)+0.01s (+ 0.87%)0.57s0.59s
Check Time3.89s (± 0.69%)3.92s (± 0.63%)+0.03s (+ 0.77%)3.88s4.00s
Emit Time2.69s (± 0.71%)2.71s (± 0.89%)+0.02s (+ 0.63%)2.66s2.76s
Total Time8.18s (± 0.62%)8.24s (± 0.38%)+0.06s (+ 0.76%)8.17s8.30s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-142-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
  • node (v9.0.0, x64)
  • node (v9.0.0, x86)
Scenarios
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Angular - node (v9.0.0, x64)
  • Angular - node (v9.0.0, x86)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • Monaco - node (v9.0.0, x64)
  • Monaco - node (v9.0.0, x86)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • TFS - node (v9.0.0, x64)
  • TFS - node (v9.0.0, x86)
BenchmarkNameIterations
Current3116610
Baselinemaster10

@rbucktonrbuckton marked this pull request as ready for reviewApril 30, 2019 00:10
@MaxGraey
Copy link

MaxGraey commentedMay 1, 2019
edited
Loading

What about speedup__spreadArrays?

var__spreadArrays=function(){for(vari=0,l=0,al=arguments.length;i<al;++i)l+=arguments[i].length;for(varar=newArray(l),i=0,k=0;i<al;++i)for(varj=0,a=arguments[i],jl=a.length;j<jl;++j,++k)ar[k]=a[j];returnar;};

On V8 7.4 this faster by ~3x-6x for large (> 1k) arrays.

ben

Bench link:
https://esbench.com/bench/5cc9a0f14cd7e6009ef62323

rifler reacted with thumbs up emoji

}

functionisPackedElement(node:Expression){
return!isOmittedExpression(node);
Copy link
Member

@weswighamweswighamJun 10, 2019
edited
Loading

Choose a reason for hiding this comment

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

constinnerSpreadEmpty=[1,2, ...[...[,,,]]]

?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Works just fine.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It basically catches[...[1, 2]] and turns it into[1, 2] rather than calling the helper.

@rbuckton

This comment has been minimized.

@typescript-bot

This comment has been minimized.

@rbuckton
Copy link
ContributorAuthor

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJun 11, 2019
edited
Loading

Heya@rbuckton, I've started to run the extended test suite on this PR atd6b3a11. You can monitor the buildhere. It should now contribute to this PR's status checks.

@rbuckton
Copy link
ContributorAuthor

Verified that the only differences in our RWC suite are expected.

@rbucktonrbuckton merged commit375487e intomasterJun 11, 2019
@rbucktonrbuckton deleted the spreadArraysES5 branchJune 11, 2019 21:16
@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@sheetalkamatsheetalkamatsheetalkamat left review comments

@weswighamweswighamweswigham approved these changes

Assignees

@rbucktonrbuckton

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spread operator is not correctly translated into JS

7 participants

@rbuckton@typescript-bot@MaxGraey@weswigham@sheetalkamat@DanielRosenwasser

[8]ページ先頭

©2009-2025 Movatter.jp