Skip to content

Optimize external source maps without full cache #40130

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

Merged

Conversation

JoostK
Copy link
Contributor

@JoostK JoostK commented Aug 19, 2020

Alternative to #40055, which already landed but #40126 shows a minor regression, so this switches to a single MRU cache instead of a full cache.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 19, 2020
@ghost
Copy link

ghost commented Aug 19, 2020

CLA assistant check
All CLA requirements met.

@JoostK JoostK force-pushed the optimize-external-source-maps-2 branch 2 times, most recently from 9b0caea to d5925cc Compare August 19, 2020 09:40
@DanielRosenwasser
Copy link
Member

@typescript-bot test this
@typescript-bot user test this
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 19, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 19, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 19, 2020

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

Update: The results are in!

@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.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..40130

Metric master 40130 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 343,670k (± 0.02%) 343,182k (± 0.02%) -488k (- 0.14%) 342,997k 343,291k
Parse Time 2.00s (± 0.73%) 1.99s (± 0.34%) -0.01s (- 0.55%) 1.97s 2.00s
Bind Time 0.82s (± 0.60%) 0.81s (± 0.68%) -0.00s (- 0.49%) 0.80s 0.83s
Check Time 4.77s (± 0.67%) 4.77s (± 0.37%) -0.00s (- 0.06%) 4.74s 4.80s
Emit Time 5.17s (± 0.35%) 5.17s (± 0.57%) +0.00s (+ 0.02%) 5.13s 5.27s
Total Time 12.75s (± 0.35%) 12.74s (± 0.23%) -0.02s (- 0.14%) 12.67s 12.80s
Monaco - node (v10.16.3, x64)
Memory used 339,292k (± 0.03%) 339,337k (± 0.04%) +46k (+ 0.01%) 339,107k 339,650k
Parse Time 1.55s (± 0.49%) 1.55s (± 0.37%) -0.00s (- 0.26%) 1.54s 1.56s
Bind Time 0.71s (± 0.78%) 0.71s (± 0.47%) +0.00s (+ 0.28%) 0.70s 0.72s
Check Time 4.93s (± 0.40%) 4.94s (± 0.63%) +0.00s (+ 0.08%) 4.88s 5.01s
Emit Time 2.75s (± 0.84%) 2.74s (± 0.53%) -0.01s (- 0.33%) 2.71s 2.77s
Total Time 9.94s (± 0.36%) 9.93s (± 0.39%) -0.01s (- 0.07%) 9.85s 10.01s
TFS - node (v10.16.3, x64)
Memory used 302,023k (± 0.03%) 302,007k (± 0.02%) -17k (- 0.01%) 301,859k 302,161k
Parse Time 1.21s (± 0.56%) 1.20s (± 0.41%) -0.00s (- 0.17%) 1.19s 1.21s
Bind Time 0.67s (± 0.60%) 0.67s (± 0.92%) 0.00s ( 0.00%) 0.66s 0.68s
Check Time 4.44s (± 0.43%) 4.44s (± 0.38%) +0.00s (+ 0.02%) 4.41s 4.48s
Emit Time 2.91s (± 0.90%) 2.88s (± 0.63%) -0.03s (- 0.96%) 2.84s 2.92s
Total Time 9.22s (± 0.36%) 9.19s (± 0.33%) -0.03s (- 0.35%) 9.12s 9.27s
material-ui - node (v10.16.3, x64)
Memory used 460,551k (± 0.01%) 460,222k (± 0.02%) -329k (- 0.07%) 460,019k 460,456k
Parse Time 1.95s (± 0.61%) 1.95s (± 0.72%) +0.00s (+ 0.21%) 1.93s 1.98s
Bind Time 0.66s (± 1.06%) 0.65s (± 1.02%) -0.01s (- 0.91%) 0.64s 0.67s
Check Time 13.33s (± 0.33%) 13.33s (± 0.48%) +0.01s (+ 0.05%) 13.21s 13.46s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.93s (± 0.27%) 15.94s (± 0.40%) +0.01s (+ 0.03%) 15.81s 16.07s
Angular - node (v12.1.0, x64)
Memory used 320,778k (± 0.10%) 320,153k (± 0.12%) -625k (- 0.19%) 319,128k 320,516k
Parse Time 1.98s (± 0.62%) 1.98s (± 0.57%) -0.00s (- 0.15%) 1.95s 2.01s
Bind Time 0.81s (± 0.74%) 0.80s (± 0.37%) -0.00s (- 0.37%) 0.80s 0.81s
Check Time 4.66s (± 0.55%) 4.66s (± 0.63%) +0.00s (+ 0.06%) 4.60s 4.74s
Emit Time 5.36s (± 1.07%) 5.36s (± 0.93%) 0.00s ( 0.00%) 5.29s 5.48s
Total Time 12.80s (± 0.62%) 12.79s (± 0.55%) -0.00s (- 0.04%) 12.69s 12.98s
Monaco - node (v12.1.0, x64)
Memory used 321,594k (± 0.01%) 321,610k (± 0.02%) +16k (+ 0.01%) 321,466k 321,717k
Parse Time 1.53s (± 0.80%) 1.52s (± 0.45%) -0.00s (- 0.26%) 1.50s 1.53s
Bind Time 0.68s (± 0.73%) 0.69s (± 0.64%) +0.01s (+ 1.02%) 0.68s 0.70s
Check Time 4.71s (± 0.49%) 4.72s (± 0.40%) +0.01s (+ 0.25%) 4.68s 4.76s
Emit Time 2.80s (± 0.70%) 2.80s (± 0.52%) +0.00s (+ 0.07%) 2.77s 2.83s
Total Time 9.73s (± 0.29%) 9.74s (± 0.25%) +0.01s (+ 0.12%) 9.70s 9.78s
TFS - node (v12.1.0, x64)
Memory used 286,573k (± 0.03%) 286,582k (± 0.02%) +9k (+ 0.00%) 286,437k 286,781k
Parse Time 1.22s (± 0.86%) 1.22s (± 0.74%) -0.00s (- 0.16%) 1.20s 1.24s
Bind Time 0.64s (± 0.73%) 0.64s (± 1.42%) -0.00s (- 0.16%) 0.63s 0.67s
Check Time 4.34s (± 0.54%) 4.35s (± 0.58%) +0.01s (+ 0.16%) 4.29s 4.39s
Emit Time 2.92s (± 1.04%) 2.91s (± 0.84%) -0.01s (- 0.27%) 2.85s 2.96s
Total Time 9.13s (± 0.50%) 9.12s (± 0.53%) -0.00s (- 0.03%) 9.00s 9.21s
material-ui - node (v12.1.0, x64)
Memory used 438,591k (± 0.08%) 438,352k (± 0.08%) -239k (- 0.05%) 437,320k 438,762k
Parse Time 1.98s (± 0.80%) 1.97s (± 0.54%) -0.01s (- 0.40%) 1.94s 1.99s
Bind Time 0.63s (± 1.09%) 0.63s (± 0.79%) 0.00s ( 0.00%) 0.62s 0.64s
Check Time 11.98s (± 0.91%) 12.03s (± 0.98%) +0.05s (+ 0.39%) 11.79s 12.27s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.59s (± 0.87%) 14.63s (± 0.83%) +0.04s (+ 0.29%) 14.39s 14.87s
Angular - node (v8.9.0, x64)
Memory used 340,233k (± 0.02%) 339,825k (± 0.01%) -408k (- 0.12%) 339,727k 339,911k
Parse Time 2.54s (± 0.37%) 2.53s (± 0.30%) -0.01s (- 0.24%) 2.51s 2.55s
Bind Time 0.85s (± 0.40%) 0.84s (± 0.56%) -0.00s (- 0.47%) 0.83s 0.85s
Check Time 5.39s (± 0.48%) 5.38s (± 0.54%) -0.01s (- 0.20%) 5.32s 5.46s
Emit Time 5.90s (± 1.18%) 5.90s (± 0.40%) +0.00s (+ 0.08%) 5.84s 5.96s
Total Time 14.68s (± 0.53%) 14.66s (± 0.27%) -0.02s (- 0.13%) 14.56s 14.72s
Monaco - node (v8.9.0, x64)
Memory used 340,576k (± 0.02%) 340,566k (± 0.02%) -10k (- 0.00%) 340,443k 340,678k
Parse Time 1.88s (± 0.62%) 1.87s (± 0.37%) -0.01s (- 0.32%) 1.86s 1.89s
Bind Time 0.88s (± 0.63%) 0.89s (± 0.86%) +0.00s (+ 0.34%) 0.87s 0.91s
Check Time 5.47s (± 0.40%) 5.47s (± 0.40%) +0.01s (+ 0.11%) 5.42s 5.52s
Emit Time 3.23s (± 0.70%) 3.23s (± 0.67%) +0.01s (+ 0.19%) 3.20s 3.31s
Total Time 11.45s (± 0.40%) 11.46s (± 0.37%) +0.01s (+ 0.07%) 11.39s 11.61s
TFS - node (v8.9.0, x64)
Memory used 303,883k (± 0.02%) 303,867k (± 0.02%) -16k (- 0.01%) 303,716k 303,986k
Parse Time 1.55s (± 0.69%) 1.55s (± 0.67%) +0.00s (+ 0.19%) 1.54s 1.59s
Bind Time 0.67s (± 0.70%) 0.67s (± 0.71%) +0.00s (+ 0.45%) 0.66s 0.68s
Check Time 5.18s (± 0.59%) 5.15s (± 0.35%) -0.03s (- 0.58%) 5.10s 5.19s
Emit Time 2.93s (± 0.84%) 2.92s (± 0.76%) -0.01s (- 0.37%) 2.86s 2.97s
Total Time 10.34s (± 0.45%) 10.30s (± 0.34%) -0.04s (- 0.36%) 10.21s 10.37s
material-ui - node (v8.9.0, x64)
Memory used 464,809k (± 0.01%) 464,597k (± 0.01%) -212k (- 0.05%) 464,488k 464,723k
Parse Time 2.38s (± 0.22%) 2.38s (± 0.32%) -0.00s (- 0.13%) 2.36s 2.40s
Bind Time 0.78s (± 0.90%) 0.78s (± 1.21%) -0.00s (- 0.26%) 0.75s 0.80s
Check Time 18.02s (± 0.90%) 17.74s (± 0.66%) -0.28s (- 1.56%) 17.40s 17.97s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 21.18s (± 0.78%) 20.89s (± 0.55%) -0.29s (- 1.35%) 20.58s 21.11s
Angular - node (v8.9.0, x86)
Memory used 195,241k (± 0.02%) 195,014k (± 0.03%) -227k (- 0.12%) 194,917k 195,147k
Parse Time 2.46s (± 1.07%) 2.46s (± 0.38%) -0.01s (- 0.32%) 2.44s 2.48s
Bind Time 0.99s (± 0.87%) 0.98s (± 1.03%) -0.01s (- 0.71%) 0.96s 1.01s
Check Time 4.85s (± 0.72%) 4.85s (± 0.42%) -0.00s (- 0.02%) 4.80s 4.88s
Emit Time 5.97s (± 1.00%) 5.91s (± 0.77%) -0.06s (- 0.96%) 5.80s 6.00s
Total Time 14.28s (± 0.70%) 14.20s (± 0.35%) -0.07s (- 0.53%) 14.09s 14.31s
Monaco - node (v8.9.0, x86)
Memory used 193,600k (± 0.01%) 193,621k (± 0.02%) +22k (+ 0.01%) 193,518k 193,701k
Parse Time 1.91s (± 0.92%) 1.91s (± 0.85%) -0.00s (- 0.05%) 1.88s 1.95s
Bind Time 0.70s (± 0.43%) 0.70s (± 0.67%) +0.00s (+ 0.29%) 0.69s 0.71s
Check Time 5.54s (± 0.37%) 5.55s (± 0.30%) +0.01s (+ 0.14%) 5.52s 5.59s
Emit Time 2.67s (± 1.50%) 2.67s (± 0.85%) +0.00s (+ 0.04%) 2.62s 2.73s
Total Time 10.82s (± 0.36%) 10.83s (± 0.28%) +0.01s (+ 0.06%) 10.76s 10.89s
TFS - node (v8.9.0, x86)
Memory used 173,827k (± 0.03%) 173,834k (± 0.02%) +7k (+ 0.00%) 173,749k 173,907k
Parse Time 1.59s (± 1.25%) 1.58s (± 0.70%) -0.01s (- 0.57%) 1.55s 1.60s
Bind Time 0.65s (± 0.58%) 0.64s (± 1.13%) -0.00s (- 0.47%) 0.63s 0.67s
Check Time 4.71s (± 0.46%) 4.69s (± 0.70%) -0.01s (- 0.32%) 4.63s 4.79s
Emit Time 2.80s (± 0.82%) 2.81s (± 0.75%) +0.01s (+ 0.46%) 2.76s 2.84s
Total Time 9.74s (± 0.42%) 9.72s (± 0.45%) -0.02s (- 0.16%) 9.62s 9.85s
material-ui - node (v8.9.0, x86)
Memory used 263,224k (± 0.01%) 263,011k (± 0.02%) -212k (- 0.08%) 262,921k 263,118k
Parse Time 2.44s (± 0.43%) 2.45s (± 0.63%) +0.01s (+ 0.25%) 2.42s 2.49s
Bind Time 0.69s (± 1.96%) 0.69s (± 1.02%) 0.00s ( 0.00%) 0.67s 0.70s
Check Time 16.43s (± 0.78%) 16.44s (± 0.63%) +0.02s (+ 0.10%) 16.26s 16.71s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 19.56s (± 0.64%) 19.59s (± 0.49%) +0.02s (+ 0.13%) 19.41s 19.84s
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 40130 10
Baseline master 10

@JoostK JoostK force-pushed the optimize-external-source-maps-2 branch from d5925cc to 729830a Compare August 19, 2020 20:07
@JoostK
Copy link
Contributor Author

JoostK commented Aug 19, 2020

Alright, those results look good to me. I'm not entirely sure if it is really faster or if it was variance, but where #40055 was mostly slower compared to master (I'm looking at "emit time"), this is mostly faster compared to master (which I can't really explain, hence the possibility that it was just variance).

I rebased this on top of master, so it no longer contains the revert of #40055. Please let me know if there's anything else that needs to be done.

Also, could this also go into a 4.0.x patch release as well?

@sheetalkamat
Copy link
Member

Yes this is improvement but i dont think this warrants the criteria for patch release.. So it should be targetted for 4.1 instead in my opinion.

@JoostK
Copy link
Contributor Author

JoostK commented Aug 19, 2020

@sheetalkamat are you referring to the perf test results in #40130 (comment), or the table I posted in #40055 (comment)? The automated perf tests unfortunately won't show any improvements, as it's only external source map sources that take the slow path which is not something that tsc itself does, only external tooling.

Thanks for the quick turnarounds btw, hugely appreciated!

@DanielRosenwasser DanielRosenwasser merged commit 2f2b679 into microsoft:master Aug 19, 2020
@sheetalkamat
Copy link
Member

Yes i meant the improvement for tooling. The reason for perf test was to ensure normal scenario does not regress. And even though this is imporvement(for tooling) this doesnt warrant patch release in my opinion.

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.

4 participants