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

Experiment with Uint8Array to reduce memory consumption of sourcemap generation. #43987

Closed
wants to merge 11 commits into from

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented May 6, 2021

I was playing around with pprof the other day, and took a heap profile of the compiler while compiling itself:

node ./lib/tsc.js -p ./src/compiler

Something that I noticed was a function called addMapping causing a lot of allocations.

image

Type: space
Time: May 6, 2021 at 11:01pm (UTC)
Showing nodes accounting for 489.77MB, 90.22% of 542.88MB total
Dropped 483 nodes (cum <= 2.71MB)
      flat  flat%   sum%        cum   cum%
  120.01MB 22.11% 22.11%   125.01MB 23.03%  addMapping
   38.50MB  7.09% 29.20%    38.50MB  7.09%  createBaseNode
      36MB  6.63% 35.83%       36MB  6.63%  write
   24.39MB  4.49% 40.32%    24.39MB  4.49%  set

I realized the allocations might be coming from a combination of repeated string concatenations and allocations of individual mappings. One approach to use an array and join the results seemed to have mixed results.

I then realized that since every mapping falls within the ASCII range, we can just throw every calculated character code into a byte array and decode it at the end.

One downside of this is that the current implementation requires a TextDecoder which isn't available on all runtimes - Node.js 10 supports it, but it's under the util module. Any farther back than that, and you're hosed.

My approach is pretty naïve, but it already shows a sizable improvement on the emit time for compiler-with-unions - probably since we're generating a single massive file.

I think there's still room for more wins such as:

  • Using a smarter allocation strategy (both initially and for growing)
  • Reusing the same buffer across sourcemap generation to avoid many allocations per-file.
  • Providing a fall-back for older environments

Fixes #43999.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 6, 2021
@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 6, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,723k (± 0.02%) 0k 🟩-344,723k (-100.00%) 0k 0k
Parse Time 1.92s (± 0.53%) 0.00s 🟩-1.92s (-100.00%) 0.00s 0.00s
Bind Time 0.84s (± 0.62%) 0.00s 🟩-0.84s (-100.00%) 0.00s 0.00s
Check Time 5.24s (± 0.33%) 0.00s 🟩-5.24s (-100.00%) 0.00s 0.00s
Emit Time 5.90s (± 0.65%) 0.00s 🟩-5.90s (-100.00%) 0.00s 0.00s
Total Time 13.90s (± 0.34%) 0.00s 🟩-13.90s (-100.00%) 0.00s 0.00s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,826k (± 0.03%) 0k 🟩-200,826k (-100.00%) 0k 0k
Parse Time 0.78s (± 0.60%) 0.00s 🟩-0.78s (-100.00%) 0.00s 0.00s
Bind Time 0.53s (± 1.04%) 0.00s 🟩-0.53s (-100.00%) 0.00s 0.00s
Check Time 7.58s (± 0.67%) 0.00s 🟩-7.58s (-100.00%) 0.00s 0.00s
Emit Time 2.49s (± 0.69%) 0.00s 🟩-2.49s (-100.00%) 0.00s 0.00s
Total Time 11.38s (± 0.54%) 0.00s 🟩-11.38s (-100.00%) 0.00s 0.00s
Monaco - node (v10.16.3, x64)
Memory used 341,710k (± 0.01%) 0k 🟩-341,710k (-100.00%) 0k 0k
Parse Time 1.55s (± 0.72%) 0.00s 🟩-1.55s (-100.00%) 0.00s 0.00s
Bind Time 0.74s (± 1.17%) 0.00s 🟩-0.74s (-100.00%) 0.00s 0.00s
Check Time 5.38s (± 0.47%) 0.00s 🟩-5.38s (-100.00%) 0.00s 0.00s
Emit Time 3.02s (± 0.49%) 0.00s 🟩-3.02s (-100.00%) 0.00s 0.00s
Total Time 10.69s (± 0.32%) 0.00s 🟩-10.69s (-100.00%) 0.00s 0.00s
TFS - node (v10.16.3, x64)
Memory used 304,224k (± 0.02%) 0k 🟩-304,224k (-100.00%) 0k 0k
Parse Time 1.22s (± 1.47%) 0.00s 🟩-1.22s (-100.00%) 0.00s 0.00s
Bind Time 0.71s (± 0.73%) 0.00s 🟩-0.71s (-100.00%) 0.00s 0.00s
Check Time 4.82s (± 1.15%) 0.00s 🟩-4.82s (-100.00%) 0.00s 0.00s
Emit Time 3.16s (± 1.43%) 0.00s 🟩-3.16s (-100.00%) 0.00s 0.00s
Total Time 9.90s (± 0.87%) 0.00s 🟩-9.90s (-100.00%) 0.00s 0.00s
material-ui - node (v10.16.3, x64)
Memory used 474,590k (± 0.01%) 0k 🟩-474,590k (-100.00%) 0k 0k
Parse Time 1.94s (± 0.41%) 0.00s 🟩-1.94s (-100.00%) 0.00s 0.00s
Bind Time 0.65s (± 0.80%) 0.00s 🟩-0.65s (-100.00%) 0.00s 0.00s
Check Time 14.69s (± 0.45%) 0.00s 🟩-14.69s (-100.00%) 0.00s 0.00s
Emit Time 0.00s (± 0.00%) 0.00s 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.28s (± 0.37%) 0.00s 🟩-17.28s (-100.00%) 0.00s 0.00s
Angular - node (v12.1.0, x64)
Memory used 322,330k (± 0.03%) 322,340k (± 0.03%) +10k (+ 0.00%) 322,185k 322,548k
Parse Time 1.91s (± 0.38%) 1.91s (± 0.78%) -0.00s (- 0.26%) 1.87s 1.93s
Bind Time 0.82s (± 0.75%) 0.83s (± 1.36%) +0.01s (+ 0.97%) 0.81s 0.86s
Check Time 5.14s (± 0.51%) 5.17s (± 0.74%) +0.03s (+ 0.64%) 5.10s 5.26s
Emit Time 6.12s (± 0.63%) 6.12s (± 0.74%) +0.00s (+ 0.00%) 6.03s 6.24s
Total Time 14.00s (± 0.38%) 14.03s (± 0.50%) +0.03s (+ 0.23%) 13.83s 14.20s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,971k (± 0.21%) 188,188k (± 0.10%) +217k (+ 0.12%) 187,645k 188,434k
Parse Time 0.77s (± 0.72%) 0.77s (± 0.75%) +0.00s (+ 0.13%) 0.76s 0.79s
Bind Time 0.53s (± 0.84%) 0.53s (± 0.64%) +0.01s (+ 0.95%) 0.53s 0.54s
Check Time 7.00s (± 0.49%) 7.06s (± 0.94%) +0.06s (+ 0.83%) 6.91s 7.24s
Emit Time 2.49s (± 1.54%) 2.28s (± 0.96%) 🟩-0.21s (- 8.33%) 2.25s 2.35s
Total Time 10.79s (± 0.48%) 10.64s (± 0.72%) -0.14s (- 1.33%) 10.49s 10.86s
Monaco - node (v12.1.0, x64)
Memory used 323,822k (± 0.09%) 324,086k (± 0.02%) +264k (+ 0.08%) 323,975k 324,193k
Parse Time 1.55s (± 0.62%) 1.54s (± 0.47%) -0.01s (- 0.84%) 1.53s 1.56s
Bind Time 0.72s (± 0.80%) 0.72s (± 0.80%) +0.00s (+ 0.00%) 0.71s 0.73s
Check Time 5.22s (± 0.59%) 5.22s (± 0.40%) +0.00s (+ 0.08%) 5.18s 5.27s
Emit Time 3.08s (± 0.87%) 3.07s (± 0.80%) -0.01s (- 0.19%) 3.02s 3.14s
Total Time 10.57s (± 0.44%) 10.56s (± 0.45%) -0.01s (- 0.13%) 10.46s 10.69s
TFS - node (v12.1.0, x64)
Memory used 288,712k (± 0.02%) 288,825k (± 0.03%) +112k (+ 0.04%) 288,680k 289,087k
Parse Time 1.21s (± 0.55%) 1.22s (± 0.88%) +0.01s (+ 0.91%) 1.20s 1.25s
Bind Time 0.70s (± 0.99%) 0.70s (± 0.93%) +0.00s (+ 0.43%) 0.68s 0.71s
Check Time 4.70s (± 0.59%) 4.70s (± 0.50%) +0.00s (+ 0.04%) 4.66s 4.74s
Emit Time 3.19s (± 1.18%) 3.18s (± 1.22%) -0.01s (- 0.44%) 3.08s 3.28s
Total Time 9.80s (± 0.57%) 9.80s (± 0.52%) +0.00s (+ 0.00%) 9.69s 9.93s
material-ui - node (v12.1.0, x64)
Memory used 452,188k (± 0.08%) 452,418k (± 0.07%) +229k (+ 0.05%) 451,185k 452,649k
Parse Time 1.95s (± 0.57%) 1.95s (± 0.42%) +0.00s (+ 0.21%) 1.94s 1.97s
Bind Time 0.64s (± 0.73%) 0.65s (± 0.77%) +0.01s (+ 0.78%) 0.64s 0.66s
Check Time 13.43s (± 0.81%) 13.38s (± 0.64%) -0.05s (- 0.39%) 13.21s 13.53s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.01s (± 0.68%) 15.97s (± 0.54%) -0.04s (- 0.28%) 15.81s 16.13s
Angular - node (v14.15.1, x64)
Memory used 321,031k (± 0.01%) 321,031k (± 0.00%) +1k (+ 0.00%) 321,005k 321,067k
Parse Time 1.91s (± 0.53%) 1.91s (± 0.53%) -0.00s (- 0.21%) 1.89s 1.93s
Bind Time 0.87s (± 0.89%) 0.87s (± 0.51%) +0.00s (+ 0.11%) 0.86s 0.88s
Check Time 5.17s (± 0.47%) 5.15s (± 0.54%) -0.02s (- 0.35%) 5.10s 5.21s
Emit Time 6.23s (± 0.67%) 6.23s (± 1.07%) +0.00s (+ 0.03%) 6.14s 6.46s
Total Time 14.17s (± 0.35%) 14.15s (± 0.58%) -0.02s (- 0.13%) 14.03s 14.42s
Compiler-Unions - node (v14.15.1, x64)
Memory used 188,830k (± 0.62%) 187,656k (± 0.20%) -1,174k (- 0.62%) 186,790k 188,020k
Parse Time 0.81s (± 1.33%) 0.80s (± 0.74%) -0.00s (- 0.62%) 0.79s 0.82s
Bind Time 0.55s (± 0.89%) 0.55s (± 0.66%) 0.00s ( 0.00%) 0.55s 0.56s
Check Time 7.15s (± 0.99%) 7.15s (± 0.67%) -0.00s (- 0.06%) 7.02s 7.22s
Emit Time 2.48s (± 0.59%) 2.27s (± 0.93%) 🟩-0.20s (- 8.16%) 2.24s 2.34s
Total Time 11.00s (± 0.73%) 10.78s (± 0.51%) -0.21s (- 1.94%) 10.65s 10.88s
Monaco - node (v14.15.1, x64)
Memory used 323,140k (± 0.01%) 323,145k (± 0.01%) +6k (+ 0.00%) 323,100k 323,194k
Parse Time 1.57s (± 0.66%) 1.57s (± 0.56%) +0.00s (+ 0.13%) 1.55s 1.59s
Bind Time 0.75s (± 1.08%) 0.75s (± 0.86%) +0.00s (+ 0.27%) 0.74s 0.76s
Check Time 5.19s (± 0.38%) 5.21s (± 0.40%) +0.02s (+ 0.35%) 5.16s 5.25s
Emit Time 3.10s (± 0.45%) 3.13s (± 0.78%) +0.03s (+ 0.87%) 3.08s 3.19s
Total Time 10.61s (± 0.23%) 10.66s (± 0.30%) +0.05s (+ 0.43%) 10.61s 10.74s
TFS - node (v14.15.1, x64)
Memory used 287,662k (± 0.01%) 287,662k (± 0.00%) -0k (- 0.00%) 287,641k 287,672k
Parse Time 1.27s (± 1.15%) 1.26s (± 1.21%) -0.01s (- 0.47%) 1.24s 1.31s
Bind Time 0.71s (± 0.70%) 0.71s (± 0.81%) -0.00s (- 0.28%) 0.70s 0.73s
Check Time 4.71s (± 0.51%) 4.74s (± 0.54%) +0.02s (+ 0.45%) 4.65s 4.77s
Emit Time 3.30s (± 0.70%) 3.30s (± 0.48%) -0.00s (- 0.12%) 3.26s 3.33s
Total Time 10.00s (± 0.34%) 10.01s (± 0.33%) +0.01s (+ 0.11%) 9.93s 10.08s
material-ui - node (v14.15.1, x64)
Memory used 450,707k (± 0.01%) 450,508k (± 0.07%) -199k (- 0.04%) 449,671k 450,794k
Parse Time 1.98s (± 0.79%) 1.98s (± 0.75%) +0.00s (+ 0.05%) 1.95s 2.01s
Bind Time 0.69s (± 0.72%) 0.70s (± 0.74%) +0.00s (+ 0.58%) 0.69s 0.71s
Check Time 13.51s (± 0.67%) 13.65s (± 0.71%) +0.13s (+ 0.98%) 13.49s 13.90s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.19s (± 0.58%) 16.33s (± 0.62%) +0.14s (+ 0.86%) 16.13s 16.57s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory7 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 7, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,726k (± 0.03%) 344,715k (± 0.02%) -11k (- 0.00%) 344,496k 344,837k
Parse Time 1.91s (± 0.54%) 1.91s (± 0.32%) +0.00s (+ 0.16%) 1.90s 1.93s
Bind Time 0.84s (± 0.40%) 0.84s (± 0.77%) +0.00s (+ 0.24%) 0.83s 0.86s
Check Time 5.24s (± 0.49%) 5.25s (± 0.60%) +0.02s (+ 0.31%) 5.19s 5.33s
Emit Time 5.88s (± 0.46%) 5.82s (± 0.65%) -0.06s (- 1.07%) 5.76s 5.90s
Total Time 13.87s (± 0.31%) 13.83s (± 0.38%) -0.04s (- 0.30%) 13.72s 13.94s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,712k (± 0.10%) 200,849k (± 0.04%) +137k (+ 0.07%) 200,627k 201,026k
Parse Time 0.78s (± 0.48%) 0.78s (± 0.43%) +0.01s (+ 1.03%) 0.78s 0.79s
Bind Time 0.53s (± 0.84%) 0.52s (± 1.06%) -0.01s (- 1.88%) 0.51s 0.53s
Check Time 7.53s (± 0.48%) 7.53s (± 0.35%) -0.00s (- 0.04%) 7.47s 7.61s
Emit Time 2.51s (± 1.08%) 2.26s (± 0.63%) 🟩-0.25s (-10.01%) 2.23s 2.30s
Total Time 11.35s (± 0.35%) 11.09s (± 0.32%) -0.26s (- 2.27%) 11.02s 11.17s
Monaco - node (v10.16.3, x64)
Memory used 341,676k (± 0.02%) 341,684k (± 0.01%) +8k (+ 0.00%) 341,607k 341,774k
Parse Time 1.56s (± 0.32%) 1.56s (± 0.31%) +0.00s (+ 0.13%) 1.55s 1.57s
Bind Time 0.74s (± 1.00%) 0.74s (± 0.90%) +0.00s (+ 0.00%) 0.73s 0.76s
Check Time 5.36s (± 0.36%) 5.37s (± 0.51%) +0.01s (+ 0.11%) 5.32s 5.45s
Emit Time 3.02s (± 0.65%) 3.02s (± 0.48%) -0.01s (- 0.23%) 2.99s 3.06s
Total Time 10.69s (± 0.26%) 10.68s (± 0.35%) -0.01s (- 0.05%) 10.62s 10.78s
TFS - node (v10.16.3, x64)
Memory used 304,216k (± 0.02%) 304,278k (± 0.02%) +63k (+ 0.02%) 304,123k 304,443k
Parse Time 1.21s (± 0.41%) 1.21s (± 0.18%) -0.00s (- 0.25%) 1.21s 1.22s
Bind Time 0.71s (± 0.70%) 0.71s (± 0.78%) +0.00s (+ 0.28%) 0.70s 0.72s
Check Time 4.78s (± 0.53%) 4.80s (± 0.49%) +0.02s (+ 0.46%) 4.75s 4.85s
Emit Time 3.15s (± 1.78%) 3.20s (± 1.26%) +0.06s (+ 1.78%) 3.10s 3.26s
Total Time 9.85s (± 0.60%) 9.92s (± 0.45%) +0.08s (+ 0.78%) 9.84s 10.01s
material-ui - node (v10.16.3, x64)
Memory used 473,823k (± 0.01%) 473,832k (± 0.02%) +9k (+ 0.00%) 473,712k 474,042k
Parse Time 1.94s (± 0.47%) 1.94s (± 0.42%) -0.00s (- 0.21%) 1.91s 1.95s
Bind Time 0.65s (± 0.86%) 0.65s (± 0.73%) -0.00s (- 0.15%) 0.63s 0.65s
Check Time 14.71s (± 0.28%) 14.75s (± 0.51%) +0.03s (+ 0.24%) 14.58s 14.93s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.30s (± 0.24%) 17.33s (± 0.42%) +0.03s (+ 0.17%) 17.18s 17.53s
Angular - node (v12.1.0, x64)
Memory used 322,274k (± 0.01%) 322,314k (± 0.04%) +40k (+ 0.01%) 322,030k 322,575k
Parse Time 1.90s (± 0.53%) 1.90s (± 0.80%) -0.00s (- 0.11%) 1.88s 1.94s
Bind Time 0.82s (± 0.54%) 0.82s (± 0.58%) +0.00s (+ 0.61%) 0.82s 0.84s
Check Time 5.13s (± 0.24%) 5.15s (± 0.55%) +0.02s (+ 0.37%) 5.09s 5.22s
Emit Time 6.12s (± 0.75%) 6.10s (± 0.68%) -0.02s (- 0.29%) 6.01s 6.22s
Total Time 13.97s (± 0.38%) 13.98s (± 0.42%) +0.01s (+ 0.04%) 13.86s 14.09s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,804k (± 0.17%) 188,140k (± 0.15%) +335k (+ 0.18%) 187,205k 188,507k
Parse Time 0.77s (± 0.72%) 0.77s (± 0.97%) +0.00s (+ 0.13%) 0.76s 0.79s
Bind Time 0.53s (± 1.05%) 0.53s (± 0.69%) -0.00s (- 0.38%) 0.52s 0.53s
Check Time 6.99s (± 0.40%) 7.01s (± 0.87%) +0.02s (+ 0.29%) 6.93s 7.23s
Emit Time 2.48s (± 0.80%) 2.29s (± 1.41%) 🟩-0.20s (- 7.86%) 2.23s 2.37s
Total Time 10.77s (± 0.41%) 10.59s (± 0.86%) -0.18s (- 1.65%) 10.48s 10.91s
Monaco - node (v12.1.0, x64)
Memory used 324,054k (± 0.02%) 324,068k (± 0.02%) +14k (+ 0.00%) 323,925k 324,192k
Parse Time 1.54s (± 0.52%) 1.54s (± 0.66%) -0.01s (- 0.39%) 1.51s 1.56s
Bind Time 0.72s (± 0.65%) 0.72s (± 1.01%) -0.00s (- 0.28%) 0.71s 0.74s
Check Time 5.19s (± 0.52%) 5.19s (± 0.42%) +0.00s (+ 0.10%) 5.14s 5.24s
Emit Time 3.06s (± 0.50%) 3.05s (± 0.62%) -0.01s (- 0.29%) 3.01s 3.11s
Total Time 10.51s (± 0.36%) 10.50s (± 0.18%) -0.02s (- 0.15%) 10.45s 10.53s
TFS - node (v12.1.0, x64)
Memory used 288,695k (± 0.02%) 288,712k (± 0.03%) +18k (+ 0.01%) 288,481k 288,863k
Parse Time 1.21s (± 0.89%) 1.21s (± 0.67%) +0.00s (+ 0.17%) 1.20s 1.24s
Bind Time 0.69s (± 1.01%) 0.70s (± 1.04%) +0.01s (+ 1.01%) 0.69s 0.72s
Check Time 4.70s (± 0.33%) 4.69s (± 0.53%) -0.00s (- 0.02%) 4.65s 4.75s
Emit Time 3.19s (± 1.19%) 3.17s (± 0.97%) -0.02s (- 0.72%) 3.10s 3.23s
Total Time 9.79s (± 0.40%) 9.77s (± 0.49%) -0.01s (- 0.12%) 9.67s 9.86s
material-ui - node (v12.1.0, x64)
Memory used 451,584k (± 0.07%) 451,665k (± 0.05%) +82k (+ 0.02%) 450,718k 451,842k
Parse Time 1.94s (± 0.48%) 1.95s (± 0.65%) +0.01s (+ 0.31%) 1.92s 1.98s
Bind Time 0.64s (± 0.35%) 0.64s (± 0.63%) -0.00s (- 0.31%) 0.63s 0.65s
Check Time 13.29s (± 0.61%) 13.27s (± 0.56%) -0.02s (- 0.12%) 13.13s 13.47s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.87s (± 0.56%) 15.86s (± 0.48%) -0.01s (- 0.09%) 15.71s 16.07s
Angular - node (v14.15.1, x64)
Memory used 321,043k (± 0.01%) 321,048k (± 0.01%) +5k (+ 0.00%) 320,993k 321,078k
Parse Time 1.90s (± 0.51%) 1.89s (± 0.44%) -0.01s (- 0.37%) 1.88s 1.91s
Bind Time 0.86s (± 0.69%) 0.87s (± 0.64%) +0.00s (+ 0.46%) 0.86s 0.88s
Check Time 5.15s (± 0.26%) 5.15s (± 0.50%) +0.00s (+ 0.06%) 5.09s 5.19s
Emit Time 6.20s (± 0.46%) 6.16s (± 0.51%) -0.04s (- 0.61%) 6.12s 6.27s
Total Time 14.11s (± 0.28%) 14.07s (± 0.33%) -0.04s (- 0.29%) 13.97s 14.19s
Compiler-Unions - node (v14.15.1, x64)
Memory used 189,804k (± 0.37%) 187,458k (± 0.21%) -2,346k (- 1.24%) 186,878k 188,017k
Parse Time 0.81s (± 0.74%) 0.80s (± 0.65%) -0.00s (- 0.62%) 0.79s 0.81s
Bind Time 0.55s (± 0.54%) 0.56s (± 0.61%) +0.01s (+ 0.91%) 0.55s 0.56s
Check Time 7.14s (± 0.33%) 7.09s (± 0.55%) -0.04s (- 0.63%) 7.01s 7.23s
Emit Time 2.49s (± 0.79%) 2.29s (± 1.21%) 🟩-0.20s (- 8.02%) 2.25s 2.39s
Total Time 10.99s (± 0.30%) 10.74s (± 0.40%) -0.25s (- 2.27%) 10.67s 10.86s
Monaco - node (v14.15.1, x64)
Memory used 323,163k (± 0.01%) 323,163k (± 0.00%) -1k (- 0.00%) 323,132k 323,205k
Parse Time 1.57s (± 0.58%) 1.57s (± 0.48%) -0.00s (- 0.19%) 1.55s 1.58s
Bind Time 0.75s (± 0.49%) 0.75s (± 0.50%) -0.00s (- 0.13%) 0.74s 0.75s
Check Time 5.17s (± 0.42%) 5.18s (± 0.55%) +0.01s (+ 0.19%) 5.12s 5.24s
Emit Time 3.10s (± 0.88%) 3.13s (± 0.71%) +0.02s (+ 0.68%) 3.06s 3.16s
Total Time 10.59s (± 0.37%) 10.62s (± 0.25%) +0.03s (+ 0.27%) 10.54s 10.67s
TFS - node (v14.15.1, x64)
Memory used 287,670k (± 0.01%) 287,677k (± 0.01%) +7k (+ 0.00%) 287,616k 287,740k
Parse Time 1.26s (± 0.81%) 1.27s (± 1.59%) +0.01s (+ 0.95%) 1.25s 1.33s
Bind Time 0.71s (± 0.95%) 0.71s (± 0.96%) +0.00s (+ 0.14%) 0.70s 0.73s
Check Time 4.72s (± 0.43%) 4.73s (± 0.43%) +0.01s (+ 0.11%) 4.68s 4.78s
Emit Time 3.30s (± 1.21%) 3.29s (± 0.58%) -0.00s (- 0.12%) 3.24s 3.33s
Total Time 9.99s (± 0.58%) 10.01s (± 0.39%) +0.02s (+ 0.20%) 9.94s 10.13s
material-ui - node (v14.15.1, x64)
Memory used 450,000k (± 0.01%) 449,901k (± 0.06%) -99k (- 0.02%) 448,842k 450,075k
Parse Time 1.99s (± 0.56%) 1.99s (± 0.64%) +0.00s (+ 0.10%) 1.95s 2.01s
Bind Time 0.70s (± 0.47%) 0.69s (± 0.72%) -0.01s (- 0.71%) 0.69s 0.71s
Check Time 13.46s (± 0.83%) 13.47s (± 0.69%) +0.02s (+ 0.12%) 13.34s 13.74s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.14s (± 0.72%) 16.16s (± 0.56%) +0.02s (+ 0.10%) 16.03s 16.44s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@DanielRosenwasser
Copy link
Member Author

Looks like this around an 8% win in emit time for compiling the old compiler-with-unions codebase.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 7, 2021

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

@typescript-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 May 7, 2021
@typescript-bot
Copy link
Collaborator

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/102607/artifacts?artifactName=tgz&fileId=0CA24DF3B3D09B2D09150A0349578342B8E5FD0C5D78391EACF1A4C9DB2C66F402&fileName=/typescript-4.3.0-insiders.20210507.tgz"
    }
}

and then running npm install.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 7, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,711k (± 0.02%) 344,688k (± 0.01%) -22k (- 0.01%) 344,568k 344,775k
Parse Time 1.91s (± 0.58%) 1.91s (± 0.56%) +0.00s (+ 0.10%) 1.90s 1.94s
Bind Time 0.83s (± 0.48%) 0.84s (± 0.66%) +0.01s (+ 0.84%) 0.83s 0.85s
Check Time 5.24s (± 0.43%) 5.24s (± 0.41%) -0.00s (- 0.04%) 5.20s 5.28s
Emit Time 5.59s (± 0.66%) 5.52s (± 0.63%) -0.07s (- 1.23%) 5.45s 5.61s
Total Time 13.58s (± 0.45%) 13.52s (± 0.34%) -0.06s (- 0.46%) 13.44s 13.64s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,246k (± 0.06%) 200,175k (± 0.06%) -70k (- 0.04%) 199,708k 200,353k
Parse Time 0.78s (± 0.46%) 0.78s (± 0.97%) +0.00s (+ 0.00%) 0.77s 0.80s
Bind Time 0.53s (± 0.63%) 0.53s (± 0.75%) +0.00s (+ 0.19%) 0.52s 0.54s
Check Time 7.55s (± 0.54%) 7.57s (± 0.65%) +0.01s (+ 0.19%) 7.47s 7.72s
Emit Time 2.43s (± 0.66%) 2.23s (± 0.71%) 🟩-0.20s (- 8.19%) 2.20s 2.27s
Total Time 11.30s (± 0.44%) 11.12s (± 0.44%) -0.18s (- 1.62%) 11.04s 11.26s
Monaco - node (v10.16.3, x64)
Memory used 341,718k (± 0.03%) 341,658k (± 0.02%) -60k (- 0.02%) 341,539k 341,802k
Parse Time 1.55s (± 0.59%) 1.55s (± 0.56%) +0.00s (+ 0.19%) 1.53s 1.57s
Bind Time 0.74s (± 0.80%) 0.74s (± 0.99%) -0.01s (- 0.81%) 0.73s 0.76s
Check Time 5.37s (± 0.62%) 5.40s (± 0.52%) +0.03s (+ 0.50%) 5.35s 5.50s
Emit Time 2.98s (± 0.76%) 2.97s (± 0.83%) -0.00s (- 0.17%) 2.91s 3.03s
Total Time 10.64s (± 0.42%) 10.66s (± 0.44%) +0.02s (+ 0.20%) 10.60s 10.83s
TFS - node (v10.16.3, x64)
Memory used 304,222k (± 0.02%) 304,259k (± 0.03%) +37k (+ 0.01%) 304,056k 304,396k
Parse Time 1.22s (± 0.60%) 1.21s (± 0.84%) -0.01s (- 0.57%) 1.19s 1.24s
Bind Time 0.71s (± 0.70%) 0.70s (± 0.84%) -0.00s (- 0.28%) 0.69s 0.72s
Check Time 4.80s (± 0.51%) 4.81s (± 0.60%) +0.01s (+ 0.15%) 4.77s 4.92s
Emit Time 3.10s (± 1.34%) 3.17s (± 1.21%) +0.07s (+ 2.26%) 3.10s 3.25s
Total Time 9.83s (± 0.32%) 9.90s (± 0.56%) +0.07s (+ 0.70%) 9.78s 10.04s
material-ui - node (v10.16.3, x64)
Memory used 473,751k (± 0.01%) 473,766k (± 0.02%) +15k (+ 0.00%) 473,621k 473,927k
Parse Time 1.93s (± 0.56%) 1.94s (± 0.69%) +0.01s (+ 0.62%) 1.91s 1.97s
Bind Time 0.65s (± 1.30%) 0.65s (± 0.99%) +0.00s (+ 0.46%) 0.64s 0.67s
Check Time 14.69s (± 0.34%) 14.81s (± 0.64%) +0.12s (+ 0.81%) 14.64s 15.08s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.28s (± 0.28%) 17.41s (± 0.58%) +0.13s (+ 0.76%) 17.24s 17.71s
Angular - node (v12.1.0, x64)
Memory used 322,258k (± 0.03%) 322,318k (± 0.02%) +60k (+ 0.02%) 322,136k 322,481k
Parse Time 1.91s (± 0.53%) 1.92s (± 0.40%) +0.01s (+ 0.37%) 1.90s 1.94s
Bind Time 0.82s (± 1.22%) 0.83s (± 1.12%) +0.00s (+ 0.36%) 0.81s 0.85s
Check Time 5.15s (± 0.53%) 5.17s (± 0.51%) +0.02s (+ 0.39%) 5.11s 5.22s
Emit Time 5.80s (± 0.42%) 5.76s (± 0.61%) -0.04s (- 0.60%) 5.69s 5.84s
Total Time 13.68s (± 0.27%) 13.67s (± 0.47%) -0.00s (- 0.03%) 13.54s 13.80s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,543k (± 0.11%) 187,485k (± 0.14%) -57k (- 0.03%) 186,755k 187,782k
Parse Time 0.77s (± 0.62%) 0.77s (± 0.44%) +0.01s (+ 0.78%) 0.77s 0.78s
Bind Time 0.53s (± 0.76%) 0.53s (± 0.84%) -0.00s (- 0.19%) 0.52s 0.54s
Check Time 7.01s (± 0.51%) 7.03s (± 0.97%) +0.02s (+ 0.30%) 6.94s 7.22s
Emit Time 2.43s (± 0.99%) 2.24s (± 1.18%) 🟩-0.19s (- 7.69%) 2.20s 2.31s
Total Time 10.74s (± 0.24%) 10.58s (± 0.81%) -0.16s (- 1.53%) 10.44s 10.79s
Monaco - node (v12.1.0, x64)
Memory used 324,066k (± 0.02%) 324,023k (± 0.05%) -43k (- 0.01%) 323,382k 324,225k
Parse Time 1.54s (± 0.42%) 1.53s (± 0.51%) -0.01s (- 0.46%) 1.51s 1.55s
Bind Time 0.72s (± 0.69%) 0.72s (± 0.66%) +0.00s (+ 0.14%) 0.71s 0.73s
Check Time 5.19s (± 0.62%) 5.20s (± 0.34%) +0.01s (+ 0.17%) 5.17s 5.25s
Emit Time 3.03s (± 1.18%) 3.03s (± 0.75%) +0.00s (+ 0.17%) 3.00s 3.10s
Total Time 10.47s (± 0.53%) 10.48s (± 0.40%) +0.01s (+ 0.07%) 10.40s 10.59s
TFS - node (v12.1.0, x64)
Memory used 288,663k (± 0.02%) 288,708k (± 0.02%) +45k (+ 0.02%) 288,623k 288,824k
Parse Time 1.20s (± 0.49%) 1.21s (± 0.61%) +0.01s (+ 0.50%) 1.20s 1.23s
Bind Time 0.69s (± 0.80%) 0.70s (± 0.86%) +0.00s (+ 0.43%) 0.68s 0.71s
Check Time 4.69s (± 0.45%) 4.69s (± 0.56%) -0.00s (- 0.11%) 4.62s 4.74s
Emit Time 3.12s (± 1.02%) 3.12s (± 0.87%) 0.00s ( 0.00%) 3.06s 3.19s
Total Time 9.71s (± 0.47%) 9.71s (± 0.49%) -0.00s (- 0.02%) 9.61s 9.80s
material-ui - node (v12.1.0, x64)
Memory used 451,489k (± 0.07%) 451,573k (± 0.06%) +84k (+ 0.02%) 450,579k 451,799k
Parse Time 1.94s (± 0.35%) 1.95s (± 0.50%) +0.00s (+ 0.21%) 1.92s 1.96s
Bind Time 0.64s (± 1.04%) 0.64s (± 1.09%) -0.00s (- 0.31%) 0.62s 0.65s
Check Time 13.35s (± 1.05%) 13.36s (± 0.66%) +0.02s (+ 0.11%) 13.23s 13.59s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.93s (± 0.89%) 15.95s (± 0.58%) +0.02s (+ 0.13%) 15.82s 16.19s
Angular - node (v14.15.1, x64)
Memory used 320,891k (± 0.08%) 320,779k (± 0.10%) -113k (- 0.04%) 319,884k 321,051k
Parse Time 1.90s (± 0.64%) 1.91s (± 0.56%) +0.01s (+ 0.53%) 1.89s 1.94s
Bind Time 0.87s (± 0.42%) 0.87s (± 0.71%) +0.01s (+ 0.58%) 0.86s 0.89s
Check Time 5.18s (± 0.40%) 5.18s (± 0.51%) -0.00s (- 0.04%) 5.13s 5.25s
Emit Time 5.87s (± 0.99%) 5.85s (± 1.14%) -0.01s (- 0.22%) 5.72s 6.00s
Total Time 13.81s (± 0.51%) 13.81s (± 0.55%) 0.00s ( 0.00%) 13.67s 13.99s
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,697k (± 0.61%) 186,979k (± 0.21%) -718k (- 0.38%) 186,363k 187,525k
Parse Time 0.80s (± 0.65%) 0.81s (± 0.61%) +0.01s (+ 0.88%) 0.80s 0.82s
Bind Time 0.56s (± 1.16%) 0.56s (± 1.22%) -0.00s (- 0.36%) 0.55s 0.58s
Check Time 7.10s (± 0.36%) 7.19s (± 0.55%) +0.09s (+ 1.24%) 7.07s 7.26s
Emit Time 2.45s (± 1.06%) 2.24s (± 0.74%) 🟩-0.21s (- 8.57%) 2.21s 2.29s
Total Time 10.91s (± 0.27%) 10.79s (± 0.41%) -0.12s (- 1.05%) 10.67s 10.87s
Monaco - node (v14.15.1, x64)
Memory used 323,115k (± 0.01%) 323,124k (± 0.00%) +9k (+ 0.00%) 323,096k 323,159k
Parse Time 1.58s (± 0.78%) 1.57s (± 0.66%) -0.01s (- 0.63%) 1.55s 1.59s
Bind Time 0.75s (± 1.38%) 0.75s (± 0.53%) -0.00s (- 0.40%) 0.74s 0.76s
Check Time 5.18s (± 0.41%) 5.19s (± 0.41%) +0.01s (+ 0.29%) 5.14s 5.24s
Emit Time 3.08s (± 0.79%) 3.08s (± 0.49%) -0.00s (- 0.13%) 3.06s 3.12s
Total Time 10.59s (± 0.34%) 10.59s (± 0.34%) -0.00s (- 0.05%) 10.51s 10.65s
TFS - node (v14.15.1, x64)
Memory used 287,664k (± 0.01%) 287,649k (± 0.00%) -15k (- 0.01%) 287,610k 287,673k
Parse Time 1.27s (± 1.30%) 1.28s (± 0.91%) +0.01s (+ 0.55%) 1.26s 1.30s
Bind Time 0.72s (± 0.69%) 0.72s (± 0.65%) +0.00s (+ 0.56%) 0.71s 0.73s
Check Time 4.73s (± 0.40%) 4.73s (± 0.59%) +0.01s (+ 0.13%) 4.67s 4.78s
Emit Time 3.21s (± 0.72%) 3.21s (± 0.50%) +0.00s (+ 0.09%) 3.19s 3.26s
Total Time 9.92s (± 0.40%) 9.94s (± 0.39%) +0.02s (+ 0.16%) 9.87s 10.06s
material-ui - node (v14.15.1, x64)
Memory used 449,875k (± 0.05%) 449,854k (± 0.06%) -22k (- 0.00%) 448,972k 450,116k
Parse Time 1.98s (± 0.29%) 1.99s (± 0.84%) +0.00s (+ 0.20%) 1.95s 2.03s
Bind Time 0.70s (± 0.88%) 0.70s (± 0.64%) -0.00s (- 0.14%) 0.69s 0.71s
Check Time 13.52s (± 0.68%) 13.54s (± 0.65%) +0.01s (+ 0.10%) 13.38s 13.79s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.20s (± 0.55%) 16.22s (± 0.58%) +0.02s (+ 0.13%) 16.07s 16.50s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@Kingwl
Copy link
Contributor

Kingwl commented May 8, 2021

Ahhhh.... Doesn't look like a lot of reduction (-718k (- 0.38%)), but at the sacrifice of readability.

The main change I noticed was to reduce the allocation on mapping. May we just set mapping as a array and join it when we need the value?

@rbuckton
Copy link
Member

rbuckton commented May 9, 2021

A few notes: The Monaco and TFS scenarios do not emit source maps by default, and the material-ui test does not emit anything, which is why we're not seeing changes for those scenarios.

Compiler-Unions has source maps enabled by default, and Angular has inline source maps enabled, so those are the only scenarios that will really show any differences.

This leads me to a few thoughts about emit performance:

  1. Our current minimum runtime for TypeScript is ES5, which does not guarantee that Uint8Array exists. Most ES5 environments supported it, but it wasn't standardized until ES2015. We may need to be able to fall back to string emit in those cases.
  2. Would it be advantageous for us to use a Uint8Array for the entire source map? We would obviously have to use multiple arrays to encode the result, since sources and sourcesContent can be added to at any time, but we could possibly avoid the entire "encode to string" step during emit as long as you haven't specified --inlineSourceMaps, and just write the Uint8Array to disk.
  3. In the long term, should we adopt an approach of using a Uint8Array for regular emit as well (i.e., swap out the internals of createTextWriter?
  4. Between GitHub and npm there's a large enough corpus of TypeScript sources and JavaScript emit that we might be able to make a good estimate on the average size of a source map compared to input to help us better ascertain initial size and growth factor.
  5. We'll have to see if resizable ArrayBuffer can be of use as well, once there's a host implementation we can try.

@dmichon-msft
Copy link
Contributor

@rbuckton It is possible to get some of the gains by appending character codes to an ordinary array, and running it through String.fromCharCode >=1024 characters at a time and concatenating the results. That approach works on ES5, but will retain some of the allocation overhead. Probably worth a separate perf test.

I know that keeping data UTF-8 encoded throughout the entire pipeline was one of the tricks that ESBuild uses to help with its performance; it'd be interesting to see what effect it has in ECMAScript.

@dmichon-msft
Copy link
Contributor

@DanielRosenwasser , would be useful to run the allocator tracking tool you ran on the baseline again to have a comparison

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 11, 2021

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

Update: The results are in!

@DanielRosenwasser
Copy link
Member Author

@dmichon-msft @amcasey I've tried integrating the same batching trick, though not the "commit on every 1024 characters generated" approach, so let's see how this works out.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,737k (± 0.02%) 344,708k (± 0.02%) -28k (- 0.01%) 344,554k 344,868k
Parse Time 1.93s (± 0.39%) 1.91s (± 0.34%) -0.02s (- 0.78%) 1.90s 1.92s
Bind Time 0.84s (± 0.44%) 0.84s (± 0.57%) -0.01s (- 0.95%) 0.83s 0.85s
Check Time 5.26s (± 0.51%) 5.24s (± 0.47%) -0.02s (- 0.36%) 5.18s 5.30s
Emit Time 5.60s (± 0.49%) 5.50s (± 0.60%) -0.09s (- 1.64%) 5.44s 5.61s
Total Time 13.63s (± 0.33%) 13.49s (± 0.32%) -0.14s (- 1.01%) 13.41s 13.60s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,315k (± 0.05%) 200,225k (± 0.06%) -90k (- 0.04%) 199,786k 200,385k
Parse Time 0.79s (± 1.01%) 0.79s (± 1.05%) -0.01s (- 0.76%) 0.77s 0.81s
Bind Time 0.53s (± 1.87%) 0.53s (± 1.57%) -0.01s (- 1.31%) 0.51s 0.55s
Check Time 7.63s (± 0.53%) 7.53s (± 0.40%) -0.10s (- 1.28%) 7.46s 7.60s
Emit Time 2.47s (± 0.87%) 2.24s (± 0.41%) 🟩-0.23s (- 9.43%) 2.22s 2.26s
Total Time 11.43s (± 0.42%) 11.09s (± 0.31%) 🟩-0.34s (- 3.02%) 11.01s 11.17s
Monaco - node (v10.16.3, x64)
Memory used 341,714k (± 0.02%) 341,749k (± 0.02%) +36k (+ 0.01%) 341,581k 341,944k
Parse Time 1.57s (± 0.88%) 1.56s (± 0.56%) -0.01s (- 0.57%) 1.54s 1.57s
Bind Time 0.74s (± 0.75%) 0.74s (± 0.83%) -0.00s (- 0.40%) 0.73s 0.75s
Check Time 5.41s (± 0.51%) 5.38s (± 0.43%) -0.03s (- 0.55%) 5.33s 5.43s
Emit Time 2.98s (± 1.12%) 2.98s (± 0.65%) +0.00s (+ 0.03%) 2.94s 3.02s
Total Time 10.70s (± 0.43%) 10.66s (± 0.22%) -0.04s (- 0.39%) 10.62s 10.71s
TFS - node (v10.16.3, x64)
Memory used 304,233k (± 0.02%) 304,244k (± 0.02%) +11k (+ 0.00%) 304,113k 304,478k
Parse Time 1.22s (± 0.67%) 1.21s (± 0.62%) -0.01s (- 0.82%) 1.19s 1.23s
Bind Time 0.70s (± 0.71%) 0.70s (± 0.74%) -0.00s (- 0.57%) 0.69s 0.71s
Check Time 4.80s (± 0.58%) 4.77s (± 0.53%) -0.03s (- 0.67%) 4.71s 4.82s
Emit Time 3.13s (± 0.96%) 3.08s (± 0.92%) -0.05s (- 1.57%) 3.03s 3.15s
Total Time 9.85s (± 0.47%) 9.75s (± 0.35%) -0.10s (- 0.99%) 9.66s 9.82s
material-ui - node (v10.16.3, x64)
Memory used 473,753k (± 0.01%) 473,834k (± 0.02%) +81k (+ 0.02%) 473,666k 474,055k
Parse Time 1.96s (± 0.67%) 1.94s (± 0.39%) -0.03s (- 1.33%) 1.92s 1.95s
Bind Time 0.66s (± 0.91%) 0.65s (± 0.95%) -0.01s (- 1.07%) 0.63s 0.66s
Check Time 14.85s (± 0.62%) 14.74s (± 0.54%) -0.11s (- 0.73%) 14.59s 15.01s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.47s (± 0.59%) 17.33s (± 0.50%) -0.14s (- 0.80%) 17.17s 17.62s
Angular - node (v12.1.0, x64)
Memory used 322,362k (± 0.04%) 322,289k (± 0.03%) -73k (- 0.02%) 322,059k 322,432k
Parse Time 1.91s (± 0.58%) 1.90s (± 0.55%) -0.00s (- 0.21%) 1.88s 1.92s
Bind Time 0.83s (± 0.85%) 0.82s (± 0.45%) -0.00s (- 0.48%) 0.82s 0.83s
Check Time 5.16s (± 0.47%) 5.15s (± 0.32%) -0.01s (- 0.25%) 5.12s 5.18s
Emit Time 5.82s (± 0.68%) 5.74s (± 0.56%) -0.08s (- 1.32%) 5.69s 5.83s
Total Time 13.71s (± 0.35%) 13.62s (± 0.36%) -0.10s (- 0.70%) 13.53s 13.74s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,395k (± 0.14%) 187,673k (± 0.05%) +277k (+ 0.15%) 187,303k 187,813k
Parse Time 0.78s (± 0.79%) 0.77s (± 0.96%) -0.01s (- 1.41%) 0.75s 0.78s
Bind Time 0.53s (± 1.25%) 0.53s (± 0.69%) -0.01s (- 1.31%) 0.52s 0.53s
Check Time 7.07s (± 0.83%) 7.00s (± 0.53%) -0.08s (- 1.09%) 6.92s 7.10s
Emit Time 2.47s (± 2.08%) 2.24s (± 1.14%) 🟩-0.23s (- 9.40%) 2.19s 2.32s
Total Time 10.85s (± 0.72%) 10.53s (± 0.40%) -0.32s (- 2.98%) 10.44s 10.65s
Monaco - node (v12.1.0, x64)
Memory used 324,020k (± 0.02%) 324,062k (± 0.02%) +42k (+ 0.01%) 323,948k 324,159k
Parse Time 1.56s (± 0.44%) 1.54s (± 0.67%) -0.01s (- 0.84%) 1.52s 1.57s
Bind Time 0.72s (± 0.66%) 0.72s (± 0.72%) +0.00s (+ 0.28%) 0.71s 0.73s
Check Time 5.21s (± 0.41%) 5.21s (± 0.52%) +0.00s (+ 0.04%) 5.15s 5.29s
Emit Time 3.03s (± 0.44%) 3.02s (± 0.49%) -0.01s (- 0.46%) 3.00s 3.07s
Total Time 10.52s (± 0.18%) 10.49s (± 0.43%) -0.02s (- 0.21%) 10.41s 10.59s
TFS - node (v12.1.0, x64)
Memory used 288,749k (± 0.03%) 288,710k (± 0.03%) -40k (- 0.01%) 288,577k 288,878k
Parse Time 1.22s (± 0.84%) 1.21s (± 0.82%) -0.01s (- 0.74%) 1.19s 1.23s
Bind Time 0.69s (± 0.80%) 0.69s (± 1.09%) +0.00s (+ 0.29%) 0.68s 0.71s
Check Time 4.71s (± 0.58%) 4.70s (± 0.47%) -0.02s (- 0.32%) 4.64s 4.76s
Emit Time 3.12s (± 1.21%) 3.13s (± 0.69%) +0.01s (+ 0.35%) 3.09s 3.19s
Total Time 9.74s (± 0.52%) 9.73s (± 0.38%) -0.02s (- 0.16%) 9.65s 9.81s
material-ui - node (v12.1.0, x64)
Memory used 451,578k (± 0.06%) 451,765k (± 0.01%) +187k (+ 0.04%) 451,657k 451,929k
Parse Time 1.95s (± 0.46%) 1.95s (± 0.57%) -0.01s (- 0.41%) 1.92s 1.97s
Bind Time 0.65s (± 0.58%) 0.64s (± 0.63%) -0.01s (- 0.93%) 0.63s 0.65s
Check Time 13.49s (± 0.88%) 13.27s (± 0.47%) -0.22s (- 1.63%) 13.17s 13.50s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.09s (± 0.76%) 15.86s (± 0.37%) -0.23s (- 1.45%) 15.77s 16.08s
Angular - node (v14.15.1, x64)
Memory used 321,014k (± 0.00%) 321,019k (± 0.01%) +5k (+ 0.00%) 320,978k 321,058k
Parse Time 1.92s (± 0.39%) 1.90s (± 0.42%) -0.02s (- 0.78%) 1.89s 1.92s
Bind Time 0.87s (± 0.54%) 0.87s (± 0.77%) -0.01s (- 0.69%) 0.86s 0.89s
Check Time 5.18s (± 0.49%) 5.14s (± 0.22%) -0.04s (- 0.70%) 5.12s 5.17s
Emit Time 5.86s (± 0.43%) 5.78s (± 0.52%) -0.08s (- 1.38%) 5.69s 5.83s
Total Time 13.83s (± 0.37%) 13.69s (± 0.25%) -0.14s (- 1.01%) 13.59s 13.76s
Compiler-Unions - node (v14.15.1, x64)
Memory used 188,025k (± 0.63%) 189,307k (± 0.38%) +1,282k (+ 0.68%) 186,409k 189,697k
Parse Time 0.81s (± 0.72%) 0.80s (± 0.50%) -0.01s (- 0.99%) 0.79s 0.81s
Bind Time 0.56s (± 0.71%) 0.56s (± 0.89%) -0.01s (- 0.89%) 0.55s 0.57s
Check Time 7.18s (± 0.68%) 7.13s (± 0.52%) -0.05s (- 0.67%) 7.06s 7.22s
Emit Time 2.46s (± 1.26%) 2.25s (± 0.69%) 🟩-0.21s (- 8.45%) 2.22s 2.29s
Total Time 11.01s (± 0.57%) 10.74s (± 0.47%) -0.27s (- 2.43%) 10.66s 10.88s
Monaco - node (v14.15.1, x64)
Memory used 323,137k (± 0.00%) 323,124k (± 0.01%) -13k (- 0.00%) 323,064k 323,162k
Parse Time 1.58s (± 0.69%) 1.57s (± 0.77%) -0.02s (- 1.01%) 1.55s 1.61s
Bind Time 0.75s (± 0.53%) 0.75s (± 0.64%) -0.00s (- 0.27%) 0.74s 0.76s
Check Time 5.21s (± 0.65%) 5.18s (± 0.52%) -0.03s (- 0.58%) 5.11s 5.23s
Emit Time 3.09s (± 0.86%) 3.08s (± 0.80%) -0.01s (- 0.16%) 3.04s 3.13s
Total Time 10.63s (± 0.56%) 10.58s (± 0.44%) -0.05s (- 0.48%) 10.47s 10.66s
TFS - node (v14.15.1, x64)
Memory used 287,667k (± 0.00%) 287,646k (± 0.01%) -21k (- 0.01%) 287,608k 287,714k
Parse Time 1.27s (± 1.17%) 1.27s (± 0.47%) -0.00s (- 0.16%) 1.26s 1.28s
Bind Time 0.72s (± 0.72%) 0.72s (± 0.93%) -0.00s (- 0.28%) 0.71s 0.74s
Check Time 4.74s (± 0.49%) 4.73s (± 0.80%) -0.01s (- 0.21%) 4.67s 4.82s
Emit Time 3.24s (± 1.21%) 3.20s (± 0.33%) -0.04s (- 1.39%) 3.18s 3.22s
Total Time 9.97s (± 0.55%) 9.91s (± 0.48%) -0.06s (- 0.61%) 9.81s 10.02s
material-ui - node (v14.15.1, x64)
Memory used 449,982k (± 0.01%) 449,999k (± 0.01%) +17k (+ 0.00%) 449,922k 450,089k
Parse Time 2.00s (± 0.69%) 1.99s (± 0.56%) -0.02s (- 0.95%) 1.96s 2.01s
Bind Time 0.70s (± 0.74%) 0.70s (± 0.74%) +0.00s (+ 0.00%) 0.69s 0.71s
Check Time 13.62s (± 1.03%) 13.47s (± 0.48%) -0.15s (- 1.12%) 13.35s 13.64s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.33s (± 0.84%) 16.15s (± 0.44%) -0.17s (- 1.06%) 16.04s 16.35s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

function toJSON(): RawSourceMap {
commitPendingMapping();
const mappings = (lastMappings ??= serializeMappings(mappingsPos));
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems sketchy. Do we guarantee that no new mappings will ever be added after calling toJSON()?

Copy link
Member Author

Choose a reason for hiding this comment

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

The new version which just uses your 1024-byte buffer trick no longer needs a cached value for mappings.

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 11, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,737k (± 0.02%) 344,724k (± 0.03%) -13k (- 0.00%) 344,526k 344,962k
Parse Time 1.93s (± 0.39%) 1.91s (± 0.40%) -0.01s (- 0.62%) 1.90s 1.93s
Bind Time 0.84s (± 0.44%) 0.84s (± 0.53%) -0.01s (- 0.83%) 0.83s 0.85s
Check Time 5.26s (± 0.51%) 5.24s (± 0.43%) -0.02s (- 0.30%) 5.19s 5.28s
Emit Time 5.60s (± 0.49%) 5.55s (± 0.77%) -0.05s (- 0.89%) 5.47s 5.64s
Total Time 13.63s (± 0.33%) 13.54s (± 0.38%) -0.09s (- 0.65%) 13.43s 13.62s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,315k (± 0.05%) 200,257k (± 0.03%) -58k (- 0.03%) 200,148k 200,394k
Parse Time 0.79s (± 1.01%) 0.79s (± 0.76%) -0.01s (- 0.76%) 0.77s 0.80s
Bind Time 0.53s (± 1.87%) 0.52s (± 1.45%) -0.01s (- 1.69%) 0.51s 0.54s
Check Time 7.63s (± 0.53%) 7.56s (± 0.34%) -0.08s (- 0.98%) 7.52s 7.62s
Emit Time 2.47s (± 0.87%) 2.25s (± 1.30%) 🟩-0.22s (- 9.11%) 2.20s 2.32s
Total Time 11.43s (± 0.42%) 11.12s (± 0.43%) -0.31s (- 2.74%) 11.04s 11.22s
Monaco - node (v10.16.3, x64)
Memory used 341,714k (± 0.02%) 341,637k (± 0.01%) -77k (- 0.02%) 341,552k 341,737k
Parse Time 1.57s (± 0.88%) 1.55s (± 0.82%) -0.01s (- 0.96%) 1.53s 1.59s
Bind Time 0.74s (± 0.75%) 0.74s (± 0.90%) -0.00s (- 0.27%) 0.73s 0.76s
Check Time 5.41s (± 0.51%) 5.38s (± 0.65%) -0.04s (- 0.68%) 5.33s 5.48s
Emit Time 2.98s (± 1.12%) 2.97s (± 0.56%) -0.02s (- 0.54%) 2.94s 3.01s
Total Time 10.70s (± 0.43%) 10.63s (± 0.52%) -0.07s (- 0.64%) 10.55s 10.80s
TFS - node (v10.16.3, x64)
Memory used 304,233k (± 0.02%) 304,236k (± 0.02%) +3k (+ 0.00%) 303,998k 304,358k
Parse Time 1.22s (± 0.67%) 1.21s (± 0.95%) -0.00s (- 0.33%) 1.19s 1.24s
Bind Time 0.70s (± 0.71%) 0.71s (± 0.82%) +0.00s (+ 0.28%) 0.69s 0.72s
Check Time 4.80s (± 0.58%) 4.80s (± 0.38%) -0.00s (- 0.02%) 4.76s 4.84s
Emit Time 3.13s (± 0.96%) 3.15s (± 1.60%) +0.02s (+ 0.77%) 3.04s 3.25s
Total Time 9.85s (± 0.47%) 9.87s (± 0.51%) +0.02s (+ 0.18%) 9.75s 10.01s
material-ui - node (v10.16.3, x64)
Memory used 473,753k (± 0.01%) 473,800k (± 0.02%) +47k (+ 0.01%) 473,596k 473,954k
Parse Time 1.96s (± 0.67%) 1.95s (± 0.58%) -0.01s (- 0.66%) 1.92s 1.98s
Bind Time 0.66s (± 0.91%) 0.65s (± 1.08%) -0.01s (- 0.76%) 0.64s 0.67s
Check Time 14.85s (± 0.62%) 14.77s (± 0.69%) -0.08s (- 0.56%) 14.62s 15.12s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.47s (± 0.59%) 17.37s (± 0.59%) -0.10s (- 0.56%) 17.22s 17.73s
Angular - node (v12.1.0, x64)
Memory used 322,362k (± 0.04%) 322,357k (± 0.02%) -5k (- 0.00%) 322,213k 322,592k
Parse Time 1.91s (± 0.58%) 1.92s (± 0.71%) +0.01s (+ 0.68%) 1.88s 1.95s
Bind Time 0.83s (± 0.85%) 0.83s (± 1.12%) -0.00s (- 0.12%) 0.81s 0.85s
Check Time 5.16s (± 0.47%) 5.17s (± 0.46%) +0.00s (+ 0.08%) 5.14s 5.24s
Emit Time 5.82s (± 0.68%) 5.75s (± 0.66%) -0.06s (- 1.05%) 5.70s 5.84s
Total Time 13.71s (± 0.35%) 13.66s (± 0.39%) -0.05s (- 0.34%) 13.58s 13.79s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,395k (± 0.14%) 187,707k (± 0.06%) +312k (+ 0.17%) 187,319k 187,884k
Parse Time 0.78s (± 0.79%) 0.77s (± 0.97%) -0.01s (- 1.02%) 0.76s 0.79s
Bind Time 0.53s (± 1.25%) 0.53s (± 0.68%) +0.00s (+ 0.19%) 0.53s 0.54s
Check Time 7.07s (± 0.83%) 7.01s (± 0.63%) -0.07s (- 0.95%) 6.93s 7.12s
Emit Time 2.47s (± 2.08%) 2.25s (± 0.83%) 🟩-0.22s (- 8.87%) 2.21s 2.29s
Total Time 10.85s (± 0.72%) 10.56s (± 0.51%) -0.29s (- 2.65%) 10.49s 10.70s
Monaco - node (v12.1.0, x64)
Memory used 324,020k (± 0.02%) 324,055k (± 0.02%) +35k (+ 0.01%) 323,925k 324,170k
Parse Time 1.56s (± 0.44%) 1.54s (± 0.48%) -0.02s (- 0.96%) 1.53s 1.56s
Bind Time 0.72s (± 0.66%) 0.72s (± 1.11%) +0.01s (+ 0.70%) 0.71s 0.75s
Check Time 5.21s (± 0.41%) 5.23s (± 0.65%) +0.02s (+ 0.38%) 5.14s 5.31s
Emit Time 3.03s (± 0.44%) 3.03s (± 0.75%) -0.01s (- 0.26%) 2.99s 3.09s
Total Time 10.52s (± 0.18%) 10.52s (± 0.51%) +0.00s (+ 0.05%) 10.38s 10.63s
TFS - node (v12.1.0, x64)
Memory used 288,749k (± 0.03%) 288,698k (± 0.02%) -51k (- 0.02%) 288,543k 288,835k
Parse Time 1.22s (± 0.84%) 1.21s (± 0.87%) -0.01s (- 0.49%) 1.19s 1.24s
Bind Time 0.69s (± 0.80%) 0.70s (± 0.83%) +0.01s (+ 0.72%) 0.69s 0.71s
Check Time 4.71s (± 0.58%) 4.71s (± 0.27%) -0.01s (- 0.13%) 4.68s 4.74s
Emit Time 3.12s (± 1.21%) 3.12s (± 0.46%) +0.00s (+ 0.16%) 3.09s 3.17s
Total Time 9.74s (± 0.52%) 9.74s (± 0.24%) -0.01s (- 0.05%) 9.69s 9.80s
material-ui - node (v12.1.0, x64)
Memory used 451,578k (± 0.06%) 451,571k (± 0.07%) -7k (- 0.00%) 450,451k 451,862k
Parse Time 1.95s (± 0.46%) 1.96s (± 0.52%) +0.00s (+ 0.05%) 1.94s 1.99s
Bind Time 0.65s (± 0.58%) 0.64s (± 0.87%) -0.00s (- 0.47%) 0.63s 0.65s
Check Time 13.49s (± 0.88%) 13.34s (± 0.51%) -0.15s (- 1.10%) 13.23s 13.52s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.09s (± 0.76%) 15.94s (± 0.47%) -0.15s (- 0.96%) 15.81s 16.12s
Angular - node (v14.15.1, x64)
Memory used 321,014k (± 0.00%) 321,016k (± 0.00%) +2k (+ 0.00%) 320,975k 321,041k
Parse Time 1.92s (± 0.39%) 1.91s (± 0.70%) -0.01s (- 0.31%) 1.88s 1.95s
Bind Time 0.87s (± 0.54%) 0.87s (± 0.51%) -0.00s (- 0.11%) 0.87s 0.89s
Check Time 5.18s (± 0.49%) 5.18s (± 0.41%) +0.00s (+ 0.06%) 5.14s 5.22s
Emit Time 5.86s (± 0.43%) 5.80s (± 0.70%) -0.05s (- 0.92%) 5.70s 5.87s
Total Time 13.83s (± 0.37%) 13.77s (± 0.45%) -0.06s (- 0.42%) 13.65s 13.89s
Compiler-Unions - node (v14.15.1, x64)
Memory used 188,025k (± 0.63%) 188,342k (± 0.62%) +317k (+ 0.17%) 186,378k 189,662k
Parse Time 0.81s (± 0.72%) 0.81s (± 1.03%) -0.00s (- 0.12%) 0.79s 0.83s
Bind Time 0.56s (± 0.71%) 0.56s (± 0.40%) -0.00s (- 0.36%) 0.55s 0.56s
Check Time 7.18s (± 0.68%) 7.14s (± 0.67%) -0.04s (- 0.53%) 7.05s 7.23s
Emit Time 2.46s (± 1.26%) 2.25s (± 0.52%) 🟩-0.21s (- 8.65%) 2.23s 2.28s
Total Time 11.01s (± 0.57%) 10.75s (± 0.46%) -0.26s (- 2.32%) 10.64s 10.84s
Monaco - node (v14.15.1, x64)
Memory used 323,137k (± 0.00%) 323,135k (± 0.01%) -2k (- 0.00%) 323,090k 323,181k
Parse Time 1.58s (± 0.69%) 1.57s (± 0.68%) -0.01s (- 0.70%) 1.55s 1.60s
Bind Time 0.75s (± 0.53%) 0.75s (± 0.64%) -0.00s (- 0.27%) 0.74s 0.76s
Check Time 5.21s (± 0.65%) 5.18s (± 0.32%) -0.03s (- 0.58%) 5.15s 5.21s
Emit Time 3.09s (± 0.86%) 3.08s (± 0.69%) -0.01s (- 0.39%) 3.03s 3.11s
Total Time 10.63s (± 0.56%) 10.57s (± 0.28%) -0.06s (- 0.56%) 10.49s 10.62s
TFS - node (v14.15.1, x64)
Memory used 287,667k (± 0.00%) 287,650k (± 0.01%) -17k (- 0.01%) 287,594k 287,692k
Parse Time 1.27s (± 1.17%) 1.27s (± 1.09%) -0.00s (- 0.24%) 1.23s 1.29s
Bind Time 0.72s (± 0.72%) 0.72s (± 0.80%) +0.00s (+ 0.56%) 0.71s 0.73s
Check Time 4.74s (± 0.49%) 4.75s (± 0.58%) +0.01s (+ 0.15%) 4.71s 4.84s
Emit Time 3.24s (± 1.21%) 3.23s (± 0.72%) -0.01s (- 0.34%) 3.20s 3.30s
Total Time 9.97s (± 0.55%) 9.96s (± 0.44%) -0.01s (- 0.06%) 9.89s 10.07s
material-ui - node (v14.15.1, x64)
Memory used 449,982k (± 0.01%) 449,979k (± 0.01%) -3k (- 0.00%) 449,877k 450,103k
Parse Time 2.00s (± 0.69%) 1.99s (± 0.57%) -0.02s (- 0.85%) 1.97s 2.01s
Bind Time 0.70s (± 0.74%) 0.70s (± 0.64%) -0.00s (- 0.14%) 0.69s 0.71s
Check Time 13.62s (± 1.03%) 13.61s (± 0.92%) -0.01s (- 0.07%) 13.38s 13.97s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.33s (± 0.84%) 16.30s (± 0.80%) -0.03s (- 0.17%) 16.05s 16.66s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@dmichon-msft
Copy link
Contributor

I'm guessing the memory bump is from allocating a fresh buffer for each source map generator, which for small files may be larger than the previous string allocations?

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 11, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,738k (± 0.01%) 0k 🟩-344,738k (-100.00%) 0k 0k
Parse Time 1.91s (± 0.50%) 0.00s 🟩-1.91s (-100.00%) 0.00s 0.00s
Bind Time 0.83s (± 0.70%) 0.00s 🟩-0.83s (-100.00%) 0.00s 0.00s
Check Time 5.23s (± 0.28%) 0.00s 🟩-5.23s (-100.00%) 0.00s 0.00s
Emit Time 5.57s (± 0.34%) 0.00s 🟩-5.57s (-100.00%) 0.00s 0.00s
Total Time 13.55s (± 0.20%) 0.00s 🟩-13.55s (-100.00%) 0.00s 0.00s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,233k (± 0.06%) 0k 🟩-200,233k (-100.00%) 0k 0k
Parse Time 0.78s (± 0.71%) 0.00s 🟩-0.78s (-100.00%) 0.00s 0.00s
Bind Time 0.53s (± 1.09%) 0.00s 🟩-0.53s (-100.00%) 0.00s 0.00s
Check Time 7.51s (± 0.37%) 0.00s 🟩-7.51s (-100.00%) 0.00s 0.00s
Emit Time 2.45s (± 0.78%) 0.00s 🟩-2.45s (-100.00%) 0.00s 0.00s
Total Time 11.26s (± 0.27%) 0.00s 🟩-11.26s (-100.00%) 0.00s 0.00s
Monaco - node (v10.16.3, x64)
Memory used 341,668k (± 0.03%) 0k 🟩-341,668k (-100.00%) 0k 0k
Parse Time 1.56s (± 0.43%) 0.00s 🟩-1.56s (-100.00%) 0.00s 0.00s
Bind Time 0.74s (± 0.88%) 0.00s 🟩-0.74s (-100.00%) 0.00s 0.00s
Check Time 5.36s (± 0.21%) 0.00s 🟩-5.36s (-100.00%) 0.00s 0.00s
Emit Time 2.97s (± 0.61%) 0.00s 🟩-2.97s (-100.00%) 0.00s 0.00s
Total Time 10.63s (± 0.19%) 0.00s 🟩-10.63s (-100.00%) 0.00s 0.00s
TFS - node (v10.16.3, x64)
Memory used 304,195k (± 0.01%) 0k 🟩-304,195k (-100.00%) 0k 0k
Parse Time 1.21s (± 0.58%) 0.00s 🟩-1.21s (-100.00%) 0.00s 0.00s
Bind Time 0.71s (± 0.73%) 0.00s 🟩-0.71s (-100.00%) 0.00s 0.00s
Check Time 4.81s (± 0.41%) 0.00s 🟩-4.81s (-100.00%) 0.00s 0.00s
Emit Time 3.11s (± 1.80%) 0.00s 🟩-3.11s (-100.00%) 0.00s 0.00s
Total Time 9.84s (± 0.56%) 0.00s 🟩-9.84s (-100.00%) 0.00s 0.00s
material-ui - node (v10.16.3, x64)
Memory used 473,839k (± 0.01%) 0k 🟩-473,839k (-100.00%) 0k 0k
Parse Time 1.93s (± 0.68%) 0.00s 🟩-1.93s (-100.00%) 0.00s 0.00s
Bind Time 0.65s (± 0.85%) 0.00s 🟩-0.65s (-100.00%) 0.00s 0.00s
Check Time 14.71s (± 0.44%) 0.00s 🟩-14.71s (-100.00%) 0.00s 0.00s
Emit Time 0.00s (± 0.00%) 0.00s 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.30s (± 0.42%) 0.00s 🟩-17.30s (-100.00%) 0.00s 0.00s
Angular - node (v12.1.0, x64)
Memory used 322,370k (± 0.04%) 0k 🟩-322,370k (-100.00%) 0k 0k
Parse Time 1.91s (± 0.76%) 0.00s 🟩-1.91s (-100.00%) 0.00s 0.00s
Bind Time 0.83s (± 1.59%) 0.00s 🟩-0.83s (-100.00%) 0.00s 0.00s
Check Time 5.13s (± 0.39%) 0.00s 🟩-5.13s (-100.00%) 0.00s 0.00s
Emit Time 5.78s (± 0.44%) 0.00s 🟩-5.78s (-100.00%) 0.00s 0.00s
Total Time 13.66s (± 0.34%) 0.00s 🟩-13.66s (-100.00%) 0.00s 0.00s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,445k (± 0.20%) 0k 🟩-187,445k (-100.00%) 0k 0k
Parse Time 0.77s (± 0.68%) 0.00s 🟩-0.77s (-100.00%) 0.00s 0.00s
Bind Time 0.53s (± 1.13%) 0.00s 🟩-0.53s (-100.00%) 0.00s 0.00s
Check Time 6.98s (± 0.45%) 0.00s 🟩-6.98s (-100.00%) 0.00s 0.00s
Emit Time 2.44s (± 1.06%) 0.00s 🟩-2.44s (-100.00%) 0.00s 0.00s
Total Time 10.72s (± 0.45%) 0.00s 🟩-10.72s (-100.00%) 0.00s 0.00s
Monaco - node (v12.1.0, x64)
Memory used 324,050k (± 0.01%) 0k 🟩-324,050k (-100.00%) 0k 0k
Parse Time 1.54s (± 0.42%) 0.00s 🟩-1.54s (-100.00%) 0.00s 0.00s
Bind Time 0.72s (± 0.62%) 0.00s 🟩-0.72s (-100.00%) 0.00s 0.00s
Check Time 5.21s (± 0.36%) 0.00s 🟩-5.21s (-100.00%) 0.00s 0.00s
Emit Time 3.02s (± 0.64%) 0.00s 🟩-3.02s (-100.00%) 0.00s 0.00s
Total Time 10.48s (± 0.25%) 0.00s 🟩-10.48s (-100.00%) 0.00s 0.00s
TFS - node (v12.1.0, x64)
Memory used 288,744k (± 0.02%) 0k 🟩-288,744k (-100.00%) 0k 0k
Parse Time 1.21s (± 0.43%) 0.00s 🟩-1.21s (-100.00%) 0.00s 0.00s
Bind Time 0.69s (± 0.72%) 0.00s 🟩-0.69s (-100.00%) 0.00s 0.00s
Check Time 4.70s (± 0.45%) 0.00s 🟩-4.70s (-100.00%) 0.00s 0.00s
Emit Time 3.12s (± 0.93%) 0.00s 🟩-3.12s (-100.00%) 0.00s 0.00s
Total Time 9.72s (± 0.36%) 0.00s 🟩-9.72s (-100.00%) 0.00s 0.00s
material-ui - node (v12.1.0, x64)
Memory used 451,510k (± 0.07%) 0k 🟩-451,510k (-100.00%) 0k 0k
Parse Time 1.94s (± 0.43%) 0.00s 🟩-1.94s (-100.00%) 0.00s 0.00s
Bind Time 0.64s (± 0.87%) 0.00s 🟩-0.64s (-100.00%) 0.00s 0.00s
Check Time 13.35s (± 0.53%) 0.00s 🟩-13.35s (-100.00%) 0.00s 0.00s
Emit Time 0.00s (± 0.00%) 0.00s 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.93s (± 0.41%) 0.00s 🟩-15.93s (-100.00%) 0.00s 0.00s
Angular - node (v14.15.1, x64)
Memory used 321,018k (± 0.00%) 321,001k (± 0.01%) -17k (- 0.01%) 320,937k 321,030k
Parse Time 1.90s (± 0.70%) 1.91s (± 0.77%) +0.02s (+ 0.79%) 1.89s 1.95s
Bind Time 0.87s (± 0.46%) 0.86s (± 0.69%) -0.01s (- 0.69%) 0.86s 0.88s
Check Time 5.13s (± 0.24%) 5.15s (± 0.72%) +0.02s (+ 0.39%) 5.10s 5.28s
Emit Time 5.81s (± 0.75%) 5.76s (± 0.53%) -0.05s (- 0.84%) 5.68s 5.84s
Total Time 13.71s (± 0.35%) 13.69s (± 0.41%) -0.02s (- 0.15%) 13.59s 13.81s
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,720k (± 0.62%) 186,746k (± 0.19%) -975k (- 0.52%) 186,377k 187,543k
Parse Time 0.80s (± 0.45%) 0.80s (± 0.61%) 0.00s ( 0.00%) 0.80s 0.82s
Bind Time 0.55s (± 0.67%) 0.55s (± 0.62%) -0.00s (- 0.36%) 0.55s 0.56s
Check Time 7.11s (± 0.42%) 7.12s (± 0.75%) +0.01s (+ 0.13%) 7.03s 7.29s
Emit Time 2.46s (± 0.80%) 2.23s (± 0.73%) 🟩-0.23s (- 9.32%) 2.20s 2.26s
Total Time 10.92s (± 0.34%) 10.70s (± 0.50%) -0.22s (- 2.00%) 10.63s 10.87s
Monaco - node (v14.15.1, x64)
Memory used 323,126k (± 0.01%) 323,130k (± 0.01%) +3k (+ 0.00%) 323,089k 323,171k
Parse Time 1.56s (± 0.59%) 1.56s (± 0.68%) +0.00s (+ 0.13%) 1.54s 1.59s
Bind Time 0.75s (± 0.64%) 0.75s (± 0.74%) +0.00s (+ 0.67%) 0.74s 0.76s
Check Time 5.17s (± 0.33%) 5.17s (± 0.29%) -0.00s (- 0.06%) 5.13s 5.21s
Emit Time 3.07s (± 0.78%) 3.07s (± 0.67%) +0.01s (+ 0.23%) 3.02s 3.11s
Total Time 10.55s (± 0.36%) 10.56s (± 0.26%) +0.01s (+ 0.06%) 10.48s 10.62s
TFS - node (v14.15.1, x64)
Memory used 287,665k (± 0.01%) 287,646k (± 0.01%) -19k (- 0.01%) 287,601k 287,695k
Parse Time 1.27s (± 1.21%) 1.26s (± 0.95%) -0.00s (- 0.24%) 1.24s 1.30s
Bind Time 0.72s (± 0.80%) 0.71s (± 0.51%) -0.01s (- 0.83%) 0.71s 0.72s
Check Time 4.73s (± 0.30%) 4.72s (± 0.55%) -0.01s (- 0.21%) 4.66s 4.80s
Emit Time 3.21s (± 0.61%) 3.20s (± 0.39%) -0.01s (- 0.22%) 3.17s 3.24s
Total Time 9.92s (± 0.27%) 9.90s (± 0.44%) -0.02s (- 0.23%) 9.81s 10.00s
material-ui - node (v14.15.1, x64)
Memory used 449,978k (± 0.01%) 449,999k (± 0.01%) +21k (+ 0.00%) 449,906k 450,103k
Parse Time 1.98s (± 0.69%) 2.00s (± 0.62%) +0.01s (+ 0.76%) 1.97s 2.03s
Bind Time 0.70s (± 0.49%) 0.70s (± 0.49%) +0.00s (+ 0.00%) 0.69s 0.70s
Check Time 13.41s (± 0.32%) 13.43s (± 0.48%) +0.02s (+ 0.11%) 13.32s 13.56s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.09s (± 0.30%) 16.12s (± 0.37%) +0.03s (+ 0.17%) 16.01s 16.26s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@DanielRosenwasser
Copy link
Member Author

Looks like in Node 10 and 12, using an ASCII decoding reduces overall compile time by 100%. 😅

@DanielRosenwasser
Copy link
Member Author

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 11, 2021

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..43987

Metric master 43987 Delta Best Worst
Angular - node (v10.16.3, x64)
Memory used 344,738k (± 0.01%) 344,665k (± 0.02%) -73k (- 0.02%) 344,457k 344,780k
Parse Time 1.91s (± 0.50%) 1.91s (± 0.56%) -0.00s (- 0.16%) 1.89s 1.93s
Bind Time 0.83s (± 0.70%) 0.84s (± 0.71%) +0.00s (+ 0.36%) 0.82s 0.85s
Check Time 5.23s (± 0.28%) 5.23s (± 0.30%) +0.00s (+ 0.02%) 5.20s 5.27s
Emit Time 5.57s (± 0.34%) 5.71s (± 0.65%) +0.14s (+ 2.44%) 5.64s 5.83s
Total Time 13.55s (± 0.20%) 13.68s (± 0.35%) +0.13s (+ 0.98%) 13.58s 13.82s
Compiler-Unions - node (v10.16.3, x64)
Memory used 200,233k (± 0.06%) 200,225k (± 0.06%) -8k (- 0.00%) 199,795k 200,346k
Parse Time 0.78s (± 0.71%) 0.78s (± 0.74%) +0.00s (+ 0.13%) 0.77s 0.80s
Bind Time 0.53s (± 1.09%) 0.52s (± 1.30%) -0.01s (- 1.13%) 0.51s 0.54s
Check Time 7.51s (± 0.37%) 7.56s (± 0.44%) +0.05s (+ 0.64%) 7.48s 7.64s
Emit Time 2.45s (± 0.78%) 2.21s (± 0.71%) 🟩-0.23s (- 9.57%) 2.18s 2.24s
Total Time 11.26s (± 0.27%) 11.08s (± 0.35%) -0.18s (- 1.63%) 11.02s 11.20s
Monaco - node (v10.16.3, x64)
Memory used 341,668k (± 0.03%) 341,716k (± 0.02%) +49k (+ 0.01%) 341,613k 341,836k
Parse Time 1.56s (± 0.43%) 1.56s (± 0.38%) +0.01s (+ 0.45%) 1.55s 1.57s
Bind Time 0.74s (± 0.88%) 0.74s (± 0.90%) +0.01s (+ 0.68%) 0.73s 0.76s
Check Time 5.36s (± 0.21%) 5.38s (± 0.43%) +0.02s (+ 0.34%) 5.32s 5.42s
Emit Time 2.97s (± 0.61%) 2.98s (± 0.76%) +0.01s (+ 0.24%) 2.94s 3.04s
Total Time 10.63s (± 0.19%) 10.67s (± 0.42%) +0.04s (+ 0.36%) 10.58s 10.78s
TFS - node (v10.16.3, x64)
Memory used 304,195k (± 0.01%) 304,210k (± 0.02%) +15k (+ 0.00%) 303,980k 304,313k
Parse Time 1.21s (± 0.58%) 1.21s (± 0.62%) +0.00s (+ 0.33%) 1.20s 1.23s
Bind Time 0.71s (± 0.73%) 0.71s (± 0.70%) -0.00s (- 0.42%) 0.70s 0.72s
Check Time 4.81s (± 0.41%) 4.79s (± 0.61%) -0.02s (- 0.40%) 4.75s 4.89s
Emit Time 3.11s (± 1.80%) 3.11s (± 1.53%) -0.00s (- 0.13%) 2.99s 3.21s
Total Time 9.84s (± 0.56%) 9.82s (± 0.72%) -0.02s (- 0.22%) 9.68s 9.98s
material-ui - node (v10.16.3, x64)
Memory used 473,839k (± 0.01%) 473,789k (± 0.01%) -50k (- 0.01%) 473,640k 473,906k
Parse Time 1.93s (± 0.68%) 1.93s (± 0.82%) 0.00s ( 0.00%) 1.90s 1.97s
Bind Time 0.65s (± 0.85%) 0.65s (± 0.75%) +0.00s (+ 0.31%) 0.64s 0.66s
Check Time 14.71s (± 0.44%) 14.74s (± 0.51%) +0.03s (+ 0.20%) 14.58s 14.94s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 17.30s (± 0.42%) 17.33s (± 0.48%) +0.03s (+ 0.19%) 17.16s 17.54s
Angular - node (v12.1.0, x64)
Memory used 322,370k (± 0.04%) 322,317k (± 0.03%) -53k (- 0.02%) 322,126k 322,501k
Parse Time 1.91s (± 0.76%) 1.91s (± 0.80%) +0.00s (+ 0.21%) 1.88s 1.95s
Bind Time 0.83s (± 1.59%) 0.82s (± 0.91%) -0.01s (- 1.44%) 0.81s 0.84s
Check Time 5.13s (± 0.39%) 5.15s (± 0.62%) +0.02s (+ 0.39%) 5.10s 5.25s
Emit Time 5.78s (± 0.44%) 5.93s (± 0.86%) +0.15s (+ 2.58%) 5.85s 6.07s
Total Time 13.66s (± 0.34%) 13.82s (± 0.55%) +0.16s (+ 1.17%) 13.71s 14.03s
Compiler-Unions - node (v12.1.0, x64)
Memory used 187,445k (± 0.20%) 187,530k (± 0.12%) +85k (+ 0.05%) 186,939k 187,861k
Parse Time 0.77s (± 0.68%) 0.76s (± 0.65%) -0.00s (- 0.52%) 0.75s 0.77s
Bind Time 0.53s (± 1.13%) 0.53s (± 0.98%) +0.01s (+ 0.95%) 0.52s 0.54s
Check Time 6.98s (± 0.45%) 7.02s (± 0.60%) +0.03s (+ 0.44%) 6.92s 7.10s
Emit Time 2.44s (± 1.06%) 2.24s (± 1.45%) 🟩-0.19s (- 7.92%) 2.19s 2.31s
Total Time 10.72s (± 0.45%) 10.55s (± 0.56%) -0.17s (- 1.56%) 10.39s 10.66s
Monaco - node (v12.1.0, x64)
Memory used 324,050k (± 0.01%) 323,993k (± 0.06%) -57k (- 0.02%) 323,220k 324,303k
Parse Time 1.54s (± 0.42%) 1.54s (± 0.76%) +0.00s (+ 0.07%) 1.51s 1.56s
Bind Time 0.72s (± 0.62%) 0.72s (± 0.72%) +0.00s (+ 0.14%) 0.71s 0.73s
Check Time 5.21s (± 0.36%) 5.19s (± 0.63%) -0.01s (- 0.27%) 5.13s 5.25s
Emit Time 3.02s (± 0.64%) 3.03s (± 0.92%) +0.01s (+ 0.30%) 2.99s 3.10s
Total Time 10.48s (± 0.25%) 10.48s (± 0.48%) -0.00s (- 0.03%) 10.39s 10.63s
TFS - node (v12.1.0, x64)
Memory used 288,744k (± 0.02%) 288,729k (± 0.03%) -15k (- 0.01%) 288,583k 288,883k
Parse Time 1.21s (± 0.43%) 1.21s (± 0.84%) +0.00s (+ 0.17%) 1.19s 1.24s
Bind Time 0.69s (± 0.72%) 0.70s (± 0.53%) +0.00s (+ 0.00%) 0.69s 0.70s
Check Time 4.70s (± 0.45%) 4.71s (± 0.47%) +0.01s (+ 0.23%) 4.66s 4.75s
Emit Time 3.12s (± 0.93%) 3.13s (± 0.55%) +0.01s (+ 0.29%) 3.08s 3.17s
Total Time 9.72s (± 0.36%) 9.75s (± 0.41%) +0.02s (+ 0.23%) 9.67s 9.82s
material-ui - node (v12.1.0, x64)
Memory used 451,510k (± 0.07%) 451,634k (± 0.06%) +125k (+ 0.03%) 450,560k 451,891k
Parse Time 1.94s (± 0.43%) 1.95s (± 0.66%) +0.01s (+ 0.36%) 1.93s 1.99s
Bind Time 0.64s (± 0.87%) 0.64s (± 0.63%) +0.00s (+ 0.16%) 0.63s 0.65s
Check Time 13.35s (± 0.53%) 13.27s (± 0.51%) -0.08s (- 0.61%) 13.15s 13.46s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.93s (± 0.41%) 15.86s (± 0.47%) -0.07s (- 0.44%) 15.73s 16.06s
Angular - node (v14.15.1, x64)
Memory used 321,018k (± 0.00%) 320,987k (± 0.01%) -32k (- 0.01%) 320,941k 321,020k
Parse Time 1.90s (± 0.70%) 1.90s (± 0.47%) -0.00s (- 0.05%) 1.87s 1.91s
Bind Time 0.87s (± 0.46%) 0.87s (± 0.74%) +0.00s (+ 0.11%) 0.86s 0.89s
Check Time 5.13s (± 0.24%) 5.16s (± 0.52%) +0.03s (+ 0.66%) 5.11s 5.23s
Emit Time 5.81s (± 0.75%) 5.96s (± 0.63%) +0.15s (+ 2.51%) 5.89s 6.04s
Total Time 13.71s (± 0.35%) 13.89s (± 0.42%) +0.18s (+ 1.32%) 13.77s 14.04s
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,720k (± 0.62%) 186,949k (± 0.21%) -772k (- 0.41%) 186,398k 187,536k
Parse Time 0.80s (± 0.45%) 0.80s (± 0.50%) -0.00s (- 0.37%) 0.79s 0.81s
Bind Time 0.55s (± 0.67%) 0.55s (± 0.66%) -0.00s (- 0.18%) 0.55s 0.56s
Check Time 7.11s (± 0.42%) 7.14s (± 0.53%) +0.03s (+ 0.46%) 7.03s 7.20s
Emit Time 2.46s (± 0.80%) 2.23s (± 1.09%) 🟩-0.23s (- 9.32%) 2.19s 2.29s
Total Time 10.92s (± 0.34%) 10.73s (± 0.39%) -0.20s (- 1.79%) 10.62s 10.81s
Monaco - node (v14.15.1, x64)
Memory used 323,126k (± 0.01%) 323,119k (± 0.00%) -7k (- 0.00%) 323,083k 323,162k
Parse Time 1.56s (± 0.59%) 1.57s (± 0.66%) +0.01s (+ 0.64%) 1.55s 1.59s
Bind Time 0.75s (± 0.64%) 0.75s (± 0.64%) 0.00s ( 0.00%) 0.74s 0.76s
Check Time 5.17s (± 0.33%) 5.16s (± 0.36%) -0.01s (- 0.17%) 5.13s 5.21s
Emit Time 3.07s (± 0.78%) 3.07s (± 0.59%) -0.00s (- 0.03%) 3.03s 3.11s
Total Time 10.55s (± 0.36%) 10.55s (± 0.27%) -0.00s (- 0.03%) 10.50s 10.61s
TFS - node (v14.15.1, x64)
Memory used 287,665k (± 0.01%) 287,650k (± 0.01%) -15k (- 0.01%) 287,613k 287,691k
Parse Time 1.27s (± 1.21%) 1.27s (± 1.28%) +0.01s (+ 0.71%) 1.26s 1.33s
Bind Time 0.72s (± 0.80%) 0.71s (± 0.63%) -0.01s (- 1.11%) 0.70s 0.72s
Check Time 4.73s (± 0.30%) 4.72s (± 0.41%) -0.01s (- 0.15%) 4.68s 4.76s
Emit Time 3.21s (± 0.61%) 3.21s (± 0.90%) +0.01s (+ 0.22%) 3.17s 3.28s
Total Time 9.92s (± 0.27%) 9.92s (± 0.39%) +0.01s (+ 0.05%) 9.85s 10.01s
material-ui - node (v14.15.1, x64)
Memory used 449,978k (± 0.01%) 449,779k (± 0.07%) -199k (- 0.04%) 448,669k 450,077k
Parse Time 1.98s (± 0.69%) 1.98s (± 0.60%) -0.00s (- 0.05%) 1.96s 2.00s
Bind Time 0.70s (± 0.49%) 0.70s (± 0.47%) +0.00s (+ 0.43%) 0.69s 0.71s
Check Time 13.41s (± 0.32%) 13.53s (± 0.64%) +0.12s (+ 0.89%) 13.38s 13.80s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 16.09s (± 0.30%) 16.21s (± 0.54%) +0.12s (+ 0.73%) 16.05s 16.49s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-206-generic
Architecturex64
Available Memory16 GB
Available Memory6 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v10.16.3, x64)
  • Compiler-Unions - node (v12.1.0, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v14.15.1, x64)
Benchmark Name Iterations
Current 43987 10
Baseline master 10

Developer Information:

Download Benchmark

@DanielRosenwasser
Copy link
Member Author

This was fun! ultimately, @dmichon-msft's approach is way simpler and pretty much just as fast, so I'll defer to #44031.

@DanielRosenwasser DanielRosenwasser deleted the arrayBufferForSourceMappings branch May 11, 2021 20:56
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
None yet
Development

Successfully merging this pull request may close these issues.

Running compiler on itself allocates a lot in addMapping
5 participants