Skip to content

Migrate maps and sets - #39264

Merged
rbuckton merged 4 commits into
masterfrom
migrateMapsAndSets
Jul 13, 2020
Merged

Migrate maps and sets#39264
rbuckton merged 4 commits into
masterfrom
migrateMapsAndSets

Conversation

@rbuckton

Copy link
Copy Markdown
Contributor

This builds on #33771 by migrating more cases where we are using Map where a Set would do, replaces the NodeMap and NodeSet classes in utilities.ts, and deprecates a number of methods that should no longer be used (though I've left them in for now to help anyone used to writing createMap or createUnderscoreEscapedMap transition to just using Map).

@rbuckton

Copy link
Copy Markdown
ContributorAuthor

@typescript-bot perf test

@typescript-bot

typescript-bot commented Jun 25, 2020

Copy link
Copy Markdown
Contributor

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

Update: The results are in!

@typescript-bot

Copy link
Copy Markdown
Contributor

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

Here they are:

Comparison Report - master..39264

Metricmaster39264DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used343,978k (± 0.02%)343,168k (± 0.03%)-810k (- 0.24%)342,896k343,361k
Parse Time2.00s (± 0.62%)2.00s (± 0.54%)-0.00s (- 0.25%)1.98s2.03s
Bind Time0.82s (± 0.85%)0.82s (± 1.47%)+0.00s (+ 0.49%)0.81s0.87s
Check Time4.71s (± 0.73%)4.74s (± 0.54%)+0.03s (+ 0.55%)4.68s4.80s
Emit Time5.16s (± 0.56%)5.16s (± 0.58%)-0.00s (- 0.04%)5.12s5.25s
Total Time12.70s (± 0.41%)12.72s (± 0.45%)+0.02s (+ 0.14%)12.61s12.88s
Monaco - node (v10.16.3, x64)
Memory used339,003k (± 0.02%)338,794k (± 0.02%)-209k (- 0.06%)338,639k338,912k
Parse Time1.58s (± 0.70%)1.59s (± 0.70%)+0.01s (+ 0.51%)1.56s1.60s
Bind Time0.71s (± 0.42%)0.71s (± 0.56%)-0.00s (- 0.14%)0.70s0.72s
Check Time4.86s (± 0.57%)4.85s (± 0.44%)-0.01s (- 0.16%)4.79s4.90s
Emit Time2.73s (± 0.46%)2.73s (± 0.53%)0.00s ( 0.00%)2.71s2.77s
Total Time9.88s (± 0.35%)9.88s (± 0.39%)-0.00s (- 0.02%)9.79s9.98s
TFS - node (v10.16.3, x64)
Memory used301,957k (± 0.02%)301,808k (± 0.03%)-149k (- 0.05%)301,618k302,119k
Parse Time1.22s (± 0.43%)1.22s (± 0.30%)-0.01s (- 0.41%)1.21s1.22s
Bind Time0.67s (± 0.50%)0.67s (± 0.87%)-0.00s (- 0.45%)0.65s0.68s
Check Time4.37s (± 0.55%)4.34s (± 0.31%)-0.03s (- 0.66%)4.31s4.37s
Emit Time2.91s (± 0.94%)2.90s (± 0.96%)-0.01s (- 0.21%)2.84s2.95s
Total Time9.17s (± 0.43%)9.12s (± 0.44%)-0.04s (- 0.47%)9.04s9.22s
material-ui - node (v10.16.3, x64)
Memory used459,384k (± 0.02%)458,640k (± 0.01%)-744k (- 0.16%)458,538k458,708k
Parse Time2.04s (± 0.40%)2.04s (± 0.37%)0.00s ( 0.00%)2.03s2.06s
Bind Time0.66s (± 1.22%)0.65s (± 0.85%)-0.01s (- 0.91%)0.64s0.66s
Check Time12.92s (± 0.50%)12.89s (± 0.76%)-0.03s (- 0.22%)12.72s13.12s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time15.62s (± 0.46%)15.59s (± 0.64%)-0.04s (- 0.23%)15.41s15.80s
Angular - node (v12.1.0, x64)
Memory used321,148k (± 0.03%)320,193k (± 0.10%)-955k (- 0.30%)318,922k320,459k
Parse Time1.98s (± 0.69%)1.97s (± 0.61%)-0.00s (- 0.15%)1.95s2.00s
Bind Time0.80s (± 0.69%)0.81s (± 0.62%)+0.00s (+ 0.37%)0.79s0.81s
Check Time4.60s (± 0.41%)4.61s (± 0.56%)+0.01s (+ 0.24%)4.55s4.67s
Emit Time5.36s (± 1.00%)5.35s (± 0.71%)-0.01s (- 0.17%)5.26s5.43s
Total Time12.74s (± 0.51%)12.74s (± 0.40%)+0.00s (+ 0.03%)12.63s12.85s
Monaco - node (v12.1.0, x64)
Memory used321,447k (± 0.02%)321,313k (± 0.01%)-134k (- 0.04%)321,230k321,392k
Parse Time1.55s (± 1.19%)1.55s (± 1.02%)-0.00s (- 0.13%)1.51s1.59s
Bind Time0.69s (± 0.84%)0.70s (± 1.15%)+0.01s (+ 1.60%)0.68s0.71s
Check Time4.66s (± 0.43%)4.65s (± 0.48%)-0.01s (- 0.19%)4.60s4.70s
Emit Time2.80s (± 0.87%)2.80s (± 0.73%)+0.00s (+ 0.11%)2.76s2.84s
Total Time9.69s (± 0.55%)9.70s (± 0.52%)+0.00s (+ 0.04%)9.61s9.80s
TFS - node (v12.1.0, x64)
Memory used286,465k (± 0.01%)286,292k (± 0.02%)-173k (- 0.06%)286,158k286,407k
Parse Time1.24s (± 0.56%)1.23s (± 0.72%)-0.01s (- 0.56%)1.22s1.26s
Bind Time0.64s (± 0.57%)0.63s (± 0.75%)-0.00s (- 0.47%)0.62s0.64s
Check Time4.27s (± 0.57%)4.27s (± 0.68%)-0.00s (- 0.00%)4.21s4.35s
Emit Time2.91s (± 0.88%)2.92s (± 0.66%)+0.01s (+ 0.34%)2.87s2.95s
Total Time9.05s (± 0.34%)9.05s (± 0.49%)+0.00s (+ 0.01%)8.97s9.17s
material-ui - node (v12.1.0, x64)
Memory used437,604k (± 0.07%)437,001k (± 0.08%)-603k (- 0.14%)436,091k437,283k
Parse Time2.02s (± 0.55%)2.02s (± 0.64%)+0.01s (+ 0.35%)1.99s2.05s
Bind Time0.63s (± 0.91%)0.63s (± 1.18%)0.00s ( 0.00%)0.61s0.64s
Check Time11.62s (± 1.01%)11.58s (± 1.03%)-0.04s (- 0.32%)11.43s12.00s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.26s (± 0.83%)14.24s (± 0.84%)-0.03s (- 0.20%)14.06s14.66s
Angular - node (v8.9.0, x64)
Memory used340,411k (± 0.02%)339,584k (± 0.02%)-827k (- 0.24%)339,409k339,720k
Parse Time2.54s (± 0.45%)2.53s (± 0.47%)-0.01s (- 0.24%)2.51s2.57s
Bind Time0.86s (± 0.58%)0.85s (± 0.78%)-0.00s (- 0.23%)0.84s0.87s
Check Time5.35s (± 0.54%)5.36s (± 0.58%)+0.02s (+ 0.30%)5.28s5.42s
Emit Time5.99s (± 1.20%)5.96s (± 1.44%)-0.03s (- 0.48%)5.85s6.24s
Total Time14.72s (± 0.53%)14.71s (± 0.51%)-0.02s (- 0.11%)14.58s14.90s
Monaco - node (v8.9.0, x64)
Memory used340,394k (± 0.01%)340,223k (± 0.01%)-172k (- 0.05%)340,120k340,326k
Parse Time1.87s (± 0.60%)1.87s (± 0.33%)+0.00s (+ 0.00%)1.86s1.89s
Bind Time0.88s (± 0.56%)0.88s (± 0.73%)-0.00s (- 0.23%)0.87s0.90s
Check Time5.40s (± 0.72%)5.38s (± 0.65%)-0.03s (- 0.50%)5.28s5.46s
Emit Time3.23s (± 0.62%)3.21s (± 0.49%)-0.02s (- 0.53%)3.17s3.24s
Total Time11.38s (± 0.48%)11.34s (± 0.27%)-0.05s (- 0.42%)11.26s11.40s
TFS - node (v8.9.0, x64)
Memory used303,730k (± 0.02%)303,607k (± 0.01%)-123k (- 0.04%)303,512k303,705k
Parse Time1.54s (± 0.36%)1.55s (± 0.57%)+0.00s (+ 0.32%)1.53s1.56s
Bind Time0.67s (± 0.87%)0.67s (± 0.77%)+0.00s (+ 0.60%)0.66s0.68s
Check Time5.03s (± 1.97%)5.04s (± 1.72%)+0.01s (+ 0.28%)4.87s5.20s
Emit Time3.01s (± 2.73%)3.02s (± 2.63%)+0.01s (+ 0.27%)2.90s3.18s
Total Time10.25s (± 0.30%)10.28s (± 0.43%)+0.03s (+ 0.28%)10.15s10.38s
material-ui - node (v8.9.0, x64)
Memory used463,549k (± 0.01%)462,959k (± 0.01%)-590k (- 0.13%)462,816k463,097k
Parse Time2.38s (± 0.77%)2.38s (± 0.34%)+0.00s (+ 0.13%)2.36s2.40s
Bind Time0.78s (± 1.28%)0.78s (± 1.64%)-0.01s (- 0.77%)0.76s0.82s
Check Time17.14s (± 0.99%)16.99s (± 0.79%)-0.15s (- 0.88%)16.73s17.37s
Emit Time0.00s (± 0.00%)0.00s (±222.80%)🔻+0.00s (+ ∞%)0.00s0.01s
Total Time20.30s (± 0.84%)20.15s (± 0.70%)-0.15s (- 0.75%)19.90s20.56s
Angular - node (v8.9.0, x86)
Memory used195,248k (± 0.02%)194,823k (± 0.02%)-425k (- 0.22%)194,733k194,954k
Parse Time2.45s (± 0.52%)2.47s (± 1.18%)+0.02s (+ 0.82%)2.44s2.56s
Bind Time1.00s (± 0.44%)0.99s (± 1.56%)-0.01s (- 1.30%)0.96s1.04s
Check Time4.83s (± 0.53%)4.79s (± 0.51%)-0.04s (- 0.81%)4.72s4.84s
Emit Time5.95s (± 0.81%)5.92s (± 1.02%)-0.03s (- 0.42%)5.75s6.06s
Total Time14.23s (± 0.39%)14.17s (± 0.39%)-0.05s (- 0.39%)14.00s14.26s
Monaco - node (v8.9.0, x86)
Memory used193,422k (± 0.02%)193,307k (± 0.02%)-115k (- 0.06%)193,232k193,419k
Parse Time1.90s (± 0.41%)1.91s (± 0.40%)+0.01s (+ 0.37%)1.89s1.93s
Bind Time0.70s (± 0.88%)0.70s (± 1.26%)+0.00s (+ 0.14%)0.69s0.73s
Check Time5.49s (± 0.69%)5.51s (± 0.89%)+0.01s (+ 0.25%)5.42s5.65s
Emit Time2.68s (± 0.66%)2.69s (± 1.28%)+0.01s (+ 0.45%)2.65s2.77s
Total Time10.77s (± 0.41%)10.80s (± 0.60%)+0.03s (+ 0.31%)10.71s10.92s
TFS - node (v8.9.0, x86)
Memory used173,631k (± 0.02%)173,554k (± 0.01%)-77k (- 0.04%)173,499k173,605k
Parse Time1.58s (± 0.69%)1.60s (± 0.83%)+0.02s (+ 1.14%)1.58s1.64s
Bind Time0.64s (± 0.47%)0.64s (± 0.81%)+0.00s (+ 0.16%)0.63s0.65s
Check Time4.62s (± 0.50%)4.65s (± 0.98%)+0.03s (+ 0.56%)4.56s4.76s
Emit Time2.79s (± 0.86%)2.79s (± 1.16%)+0.00s (+ 0.18%)2.73s2.87s
Total Time9.63s (± 0.38%)9.68s (± 0.64%)+0.04s (+ 0.47%)9.55s9.87s
material-ui - node (v8.9.0, x86)
Memory used262,472k (± 0.01%)262,183k (± 0.02%)-290k (- 0.11%)262,095k262,308k
Parse Time2.45s (± 0.81%)2.43s (± 0.58%)-0.02s (- 0.90%)2.41s2.47s
Bind Time0.66s (± 1.59%)0.67s (± 0.97%)+0.01s (+ 0.75%)0.66s0.68s
Check Time15.62s (± 0.53%)15.55s (± 0.57%)-0.07s (- 0.44%)15.36s15.82s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time18.74s (± 0.48%)18.65s (± 0.52%)-0.09s (- 0.47%)18.45s18.93s
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
Current3926410
Baselinemaster10

@rbuckton
rbucktonforce-pushed the migrateMapsAndSets branch from 9e34d17 to 611b77fCompareJune 26, 2020 17:17
@rbuckton
rbuckton marked this pull request as ready for review June 26, 2020 17:17
@ElianCordoba

Copy link
Copy Markdown

Have you seen this javascript hast-table implementation? Claims to be faster than the native approach. Maybe is worth checking out

# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/commandLineParser.ts
#	src/compiler/core.ts
#	src/compiler/moduleNameResolver.ts
#	src/compiler/transformers/declarations.ts
#	src/compiler/tsbuildPublic.ts
#	src/compiler/types.ts
#	src/compiler/utilities.ts
#	src/harness/client.ts
#	src/server/editorServices.ts
#	src/server/typingsCache.ts
#	src/server/utilities.ts
#	src/services/codefixes/convertToAsyncFunction.ts
#	src/services/documentRegistry.ts
#	src/services/importTracker.ts
#	src/services/refactorProvider.ts
#	src/services/refactors/extractSymbol.ts
#	src/testRunner/unittests/programApi.ts
#	src/typingsInstallerCore/typingsInstaller.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
@rbuckton
rbuckton merged commit 2c08aff into masterJul 13, 2020
@rbuckton
rbuckton deleted the migrateMapsAndSets branch July 13, 2020 17:39
@microsoftmicrosoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rbuckton@typescript-bot@ElianCordoba@andrewbranch