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

feat(lib): define TypedArray interface #59205

Closed
wants to merge 6 commits into from

Conversation

mfulton26
Copy link
Contributor

Each concrete typed array type and constructor share common interfaces.

Library types can be defined extending base interfaces:

  1. higher code reuse
  2. less duplication
  3. easier maintenance (less error prone)

Closes #15402
Fixes #45198

Each concrete typed array type and constructor share common interfaces.

Library types can be defined extending base interfaces:

1. higher code reuse
2. less duplication
3. easier maintenance (less error prone)

Closes microsoft#15402
Fixes microsoft#45198
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug For Milestone Bug PRs that fix a bug with a specific milestone labels Jul 9, 2024
@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue #15402. If you can get it accepted, this PR will have a better chance of being reviewed.

@DanielRosenwasser
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 9, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started 👀 Results
user test this ✅ Started 👀 Results
run dt ✅ Started 👀 Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, the results of running the DT tests are ready.

There were interesting changes:

Branch only errors:

Package: pouchdb-core
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/pouchdb-core/index.d.ts
  11:11  error  TypeScript@local compile error: 
Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  The types returned by 'slice(...)' are incompatible between these types.
    Type 'Buffer' is not assignable to type 'this'.
      'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node/v16
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/node/v16/buffer.d.ts
  552:19  error  TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: 
Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  The types returned by 'slice(...)' are incompatible between these types.
    Type 'Buffer' is not assignable to type 'this'.
      'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node/v18
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/node/v18/buffer.d.ts
  622:19  error  TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: 
Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  The types returned by 'slice(...)' are incompatible between these types.
    Type 'Buffer' is not assignable to type 'this'.
      'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

Package: node
Error:

Error: 
/mnt/vss/_work/1/DefinitelyTyped/types/node/buffer.d.ts
  632:19  error  TypeScript@local tsconfig.dom.json, local tsconfig.non-dom.json compile error: 
Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  The types returned by 'slice(...)' are incompatible between these types.
    Type 'Buffer' is not assignable to type 'this'.
      'Buffer' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Buffer'  @definitelytyped/expect

✖ 1 problem (1 error, 0 warnings)

    at combineErrorsAndWarnings (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:194:28)
    at runTests (/mnt/vss/_work/1/DefinitelyTyped/node_modules/.pnpm/@definitelytyped+dtslint@0.2.22_typescript@5.6.0-dev.20240709/node_modules/@definitelytyped/dtslint/dist/index.js:186:20)

You can check the log here.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user tests with tsc comparing main and refs/pull/59205/merge:

Something interesting changed - please have a look.

Details

azure-sdk

/mnt/ts_downloads/_/m/azure-sdk/build.sh

  • [NEW] error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
    • /mnt/ts_downloads/_/temp/node_modules/.pnpm/@types+node@18.19.39/node_modules/@types/node/buffer.d.ts(622,19)
  • [NEW] error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.
    • /mnt/ts_downloads/_/temp/node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts(9,5)
  • [MISSING] error TS2322: Type 'string' is not assignable to type 'never'.
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(59,9)
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(213,9)
    • /mnt/ts_downloads/_/m/azure-sdk/test/narrowedTypes.ts(254,11)

xterm.js

src/tsconfig-library-base.json

  • [NEW] error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,153 60,988 -1,165 (- 1.87%) ~ ~ p=0.001 n=6
Types 50,242 50,046 -196 (- 0.39%) ~ ~ p=0.001 n=6
Memory used 192,803k (± 0.71%) 191,430k (± 0.74%) -1,373k (- 0.71%) 190,764k 194,308k p=0.045 n=6
Parse Time 1.58s (± 0.57%) 1.57s (± 0.48%) ~ 1.56s 1.58s p=0.149 n=6
Bind Time 0.86s (± 0.64%) 0.84s (± 1.06%) -0.02s (- 1.75%) 0.83s 0.85s p=0.015 n=6
Check Time 11.25s (± 0.58%) 11.13s (± 0.36%) -0.11s (- 1.01%) 11.08s 11.20s p=0.013 n=6
Emit Time 3.28s (± 0.74%) 3.23s (± 1.42%) -0.05s (- 1.42%) 3.14s 3.27s p=0.023 n=6
Total Time 16.96s (± 0.42%) 16.78s (± 0.40%) -0.18s (- 1.08%) 16.66s 16.86s p=0.005 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,114 942,466 -1,648 (- 0.17%) ~ ~ p=0.001 n=6
Types 407,050 407,109 +59 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 1,218,374k (± 0.00%) 1,216,623k (± 0.00%) -1,751k (- 0.14%) 1,216,558k 1,216,661k p=0.005 n=6
Parse Time 7.92s (± 0.54%) 7.79s (± 0.54%) -0.13s (- 1.62%) 7.74s 7.86s p=0.005 n=6
Bind Time 2.22s (± 0.40%) 2.20s (± 0.55%) ~ 2.19s 2.22s p=0.058 n=6
Check Time 35.71s (± 0.57%) 35.71s (± 0.15%) ~ 35.65s 35.78s p=1.000 n=6
Emit Time 16.09s (± 0.89%) 16.12s (± 1.39%) ~ 15.92s 16.52s p=0.873 n=6
Total Time 61.95s (± 0.19%) 61.81s (± 0.41%) ~ 61.62s 62.25s p=0.172 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,130,342 2,128,539 -1,803 (- 0.08%) ~ ~ p=0.001 n=6
Types 927,684 927,705 +21 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,107,655k (± 0.05%) 2,105,511k (± 0.01%) -2,144k (- 0.10%) 2,105,317k 2,105,773k p=0.005 n=6
Parse Time 9.67s (± 0.46%) 9.67s (± 0.57%) ~ 9.62s 9.77s p=0.872 n=6
Bind Time 3.39s (± 0.85%) 3.38s (± 1.07%) ~ 3.33s 3.44s p=0.624 n=6
Check Time 100.59s (± 1.61%) 102.01s (± 0.77%) +1.42s (+ 1.41%) 100.40s 102.40s p=0.045 n=6
Emit Time 0.60s (±102.48%) 0.19s 🟩-0.41s (-68.25%) ~ ~ p=0.009 n=6
Total Time 114.25s (± 1.11%) 115.24s (± 0.62%) ~ 113.80s 115.61s p=0.066 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,773 1,200,843 -24,930 (- 2.03%) ~ ~ p=0.001 n=6
Types 261,518 261,573 +55 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,343,177k (± 0.06%) 2,317,266k (± 0.03%) -25,910k (- 1.11%) 2,316,368k 2,318,306k p=0.005 n=6
Parse Time 7.52s (± 0.25%) 7.51s (± 0.93%) ~ 7.42s 7.61s p=0.575 n=6
Bind Time 2.79s (± 0.71%) 2.78s (± 0.45%) ~ 2.77s 2.80s p=0.105 n=6
Check Time 49.37s (± 0.26%) 49.83s (± 0.62%) +0.46s (+ 0.94%) 49.51s 50.35s p=0.008 n=6
Emit Time 3.85s (± 5.82%) 4.00s (± 2.87%) ~ 3.90s 4.20s p=0.078 n=6
Total Time 63.54s (± 0.38%) 64.14s (± 0.54%) +0.61s (+ 0.95%) 63.83s 64.70s p=0.013 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,225,773 1,200,843 -24,930 (- 2.03%) ~ ~ p=0.001 n=6
Types 261,518 261,573 +55 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 2,416,134k (± 0.03%) 2,391,213k (± 0.03%) -24,921k (- 1.03%) 2,390,424k 2,392,500k p=0.005 n=6
Parse Time 7.77s (± 0.34%) 7.82s (± 0.73%) ~ 7.75s 7.89s p=0.229 n=6
Bind Time 2.52s (± 0.74%) 2.81s (± 0.73%) 🔻+0.28s (+11.22%) 2.78s 2.83s p=0.005 n=6
Check Time 50.34s (± 0.88%) 49.95s (± 0.68%) ~ 49.63s 50.50s p=0.173 n=6
Emit Time 3.95s (± 2.85%) 3.93s (± 2.03%) ~ 3.79s 4.02s p=0.873 n=6
Total Time 64.61s (± 0.85%) 64.51s (± 0.62%) ~ 64.15s 65.15s p=0.575 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,268 256,645 -1,623 (- 0.63%) ~ ~ p=0.001 n=6
Types 104,775 104,755 -20 (- 0.02%) ~ ~ p=0.001 n=6
Memory used 427,606k (± 0.02%) 426,074k (± 0.03%) -1,533k (- 0.36%) 425,962k 426,296k p=0.005 n=6
Parse Time 3.29s (± 0.60%) 3.28s (± 0.42%) ~ 3.27s 3.30s p=1.000 n=6
Bind Time 1.31s (± 1.04%) 1.30s (± 0.63%) ~ 1.30s 1.32s p=0.127 n=6
Check Time 17.85s (± 0.23%) 17.78s (± 0.43%) ~ 17.69s 17.91s p=0.092 n=6
Emit Time 1.26s (± 1.42%) 1.26s (± 1.42%) ~ 1.24s 1.29s p=0.871 n=6
Total Time 23.71s (± 0.18%) 23.63s (± 0.36%) ~ 23.52s 23.76s p=0.148 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 36 +1 (+ 2.86%) ~ ~ p=0.001 n=6
Symbols 224,565 222,993 -1,572 (- 0.70%) ~ ~ p=0.001 n=6
Types 93,734 93,747 +13 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 369,530k (± 0.04%) 367,882k (± 0.04%) -1,648k (- 0.45%) 367,680k 368,026k p=0.005 n=6
Parse Time 2.77s (± 1.00%) 2.75s (± 0.96%) ~ 2.72s 2.78s p=0.198 n=6
Bind Time 1.58s (± 0.89%) 1.55s (± 1.00%) -0.03s (- 1.90%) 1.53s 1.56s p=0.010 n=6
Check Time 15.46s (± 0.21%) 15.41s (± 0.59%) ~ 15.28s 15.51s p=0.423 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.81s (± 0.25%) 19.70s (± 0.49%) ~ 19.58s 19.83s p=0.077 n=6
vscode - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 2,887,287 2,886,770 -517 (- 0.02%) ~ ~ p=0.001 n=6
Types 977,035 976,981 -54 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 3,051,421k (± 0.00%) 3,049,926k (± 0.00%) -1,495k (- 0.05%) 3,049,865k 3,049,953k p=0.005 n=6
Parse Time 16.85s (± 0.45%) 16.88s (± 0.07%) ~ 16.87s 16.90s p=0.452 n=6
Bind Time 5.19s (± 2.24%) 5.08s (± 0.41%) -0.11s (- 2.22%) 5.04s 5.10s p=0.010 n=6
Check Time 90.35s (± 2.29%) 89.48s (± 0.25%) ~ 89.18s 89.83s p=0.378 n=6
Emit Time 28.40s (± 6.92%) 29.25s (± 0.27%) ~ 29.12s 29.32s p=0.469 n=6
Total Time 140.79s (± 0.23%) 140.68s (± 0.14%) ~ 140.41s 140.95s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 0 1 🔻+1 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 267,117 266,606 -511 (- 0.19%) ~ ~ p=0.001 n=6
Types 108,775 108,743 -32 (- 0.03%) ~ ~ p=0.001 n=6
Memory used 411,579k (± 0.02%) 410,134k (± 0.01%) -1,445k (- 0.35%) 410,039k 410,195k p=0.005 n=6
Parse Time 3.19s (± 0.46%) 3.16s (± 0.37%) -0.03s (- 0.94%) 3.14s 3.17s p=0.008 n=6
Bind Time 1.41s (± 0.37%) 1.39s (± 1.26%) -0.02s (- 1.42%) 1.37s 1.42s p=0.040 n=6
Check Time 14.21s (± 0.44%) 14.11s (± 0.21%) -0.10s (- 0.69%) 14.06s 14.15s p=0.036 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.81s (± 0.29%) 18.66s (± 0.08%) -0.15s (- 0.80%) 18.64s 18.68s p=0.005 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 525,251 523,540 -1,711 (- 0.33%) ~ ~ p=0.001 n=6
Types 178,574 178,634 +60 (+ 0.03%) ~ ~ p=0.001 n=6
Memory used 462,948k (± 0.09%) 460,961k (± 0.07%) -1,987k (- 0.43%) 460,626k 461,370k p=0.005 n=6
Parse Time 3.17s (± 1.01%) 3.17s (± 0.92%) ~ 3.14s 3.22s p=1.000 n=6
Bind Time 1.17s 1.16s (± 0.45%) -0.01s (- 1.14%) 1.15s 1.16s p=0.002 n=6
Check Time 17.98s (± 0.28%) 17.96s (± 0.31%) ~ 17.91s 18.04s p=0.514 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.33s (± 0.33%) 22.30s (± 0.22%) ~ 22.23s 22.36s p=0.514 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@rubiesonthesky
Copy link

This PR does partly the same I think, #58188 - but is less breaking?

@mfulton26
Copy link
Contributor Author

This PR does partly the same I think, #58188 - but is less breaking?

This PR does address #45198, I'm not sure if it addresses #45199 though. Oh, on second look though, this might address it too. I can try grabbing the test changes from https://github.com/microsoft/TypeScript/pull/58188/files#diff-259a5a5be5d9d2b11bd636646375791a0d37a60f80c1871b6b97c9f1cde672ee to confirm.

@mfulton26
Copy link
Contributor Author

mfulton26 commented Jul 9, 2024

This PR does partly the same I think, #58188 - but is less breaking?

The main objective of this PR is more to create a common interface for all TypedArray prototypes and constructors for use in code (userland and TS project itself) that acts on any TypedArray instance (and to reduce duplication in the lib d.ts files.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59205/merge:

Something interesting changed - please have a look.

Details

Chocobozzz/PeerTube

6 of 12 projects failed to build with the old tsc and were ignored

packages/types-generator/tsconfig.types.json

  • error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
  • error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are some more interesting changes from running the top 400 repos suite

Details

jupyterlab/jupyterlab

46 of 59 projects failed to build with the old tsc and were ignored

packages/ui-components/examples/simple-windowed-list/tsconfig.json

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are some more interesting changes from running the top 400 repos suite

Details

mattermost/mattermost

2 of 4 projects failed to build with the old tsc and were ignored

webapp/platform/client/tsconfig.build.json

vercel/hyper

2 of 3 projects failed to build with the old tsc and were ignored

tsconfig.json

  • error TS2430: Interface 'Buffer' incorrectly extends interface 'Uint8Array'.
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/@types/node/buffer.d.ts#L622 in app/tsconfig.json
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/@types/node/buffer.d.ts#L622 in tsconfig.json
  • error TS2416: Property 'slice' in type 'Buffer' is not assignable to the same property in base type 'Uint8Array'.
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/buffer/index.d.ts#L9 in app/tsconfig.json
    • file:///mnt/ts_downloads/_/m/hyper/node_modules/buffer/index.d.ts#L9 in tsconfig.json

Changes TypedArray methods to receive/return the concrete subclass or `this` rather than only `this` which breaks `Buffer` in `@types/node` (e.g. `slice()` in `Buffer` returns `Buffer` and not `this`).
@mfulton26
Copy link
Contributor Author

@typescript-bot test it

@mfulton26
Copy link
Contributor Author

@typescript-bot test it

@DanielRosenwasser, I've pushed a potential fix for Buffer extends Uint8Array. Can we re-test?

@sandersn sandersn self-assigned this Jul 18, 2024
@sandersn
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 18, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerShortCircuitException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerShortCircuitException","errorCode":0,"eventId":3000}
user test this ❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerShortCircuitException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerShortCircuitException","errorCode":0,"eventId":3000}
run dt ❌ Error: Error: TF10216: Azure DevOps services are currently unavailable. Try again later. Activity Id: 5d706515-d449-4fd3-a5da-e2588365ebfd
perf test this faster ❌ Error: Error: {"$id":"1","innerException":null,"message":"TF400898: An Internal Error Occurred.","typeName":"Microsoft.VisualStudio.Services.CircuitBreaker.CircuitBreakerExceededConcurrencyException, Microsoft.VisualStudio.Services.Common","typeKey":"CircuitBreakerExceededConcurrencyException","errorCode":0,"eventId":3000}

@sandersn
Copy link
Member

I'm also interested to see what performance looks like with a second sample.

@jakebailey
Copy link
Member

There are merge conflicts, so the bot can't run anything.

@jakebailey
Copy link
Member

That and there's an Azure DevOps outage....

@mfulton26
Copy link
Contributor Author

There are merge conflicts, so the bot can't run anything.

merge conflicts resolved; this branch is now up to date with main

@typescript-bot test it

can we try again @sandersn?

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 19, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/59205/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,153 60,989 -1,164 (- 1.87%) ~ ~ p=0.001 n=6
Types 50,242 50,056 -186 (- 0.37%) ~ ~ p=0.001 n=6
Memory used 194,713k (± 0.98%) 191,647k (± 0.79%) -3,066k (- 1.57%) 190,884k 194,712k p=0.013 n=6
Parse Time 1.30s (± 1.93%) 1.30s (± 0.76%) ~ 1.28s 1.31s p=0.676 n=6
Bind Time 0.71s 0.70s (± 0.58%) -0.01s (- 1.17%) 0.70s 0.71s p=0.007 n=6
Check Time 9.52s (± 0.36%) 9.46s (± 0.25%) -0.06s (- 0.60%) 9.43s 9.49s p=0.019 n=6
Emit Time 2.76s (± 0.67%) 2.73s (± 1.34%) ~ 2.68s 2.79s p=0.147 n=6
Total Time 14.28s (± 0.31%) 14.19s (± 0.34%) -0.09s (- 0.62%) 14.13s 14.25s p=0.029 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 944,250 942,607 -1,643 (- 0.17%) ~ ~ p=0.001 n=6
Types 407,076 407,146 +70 (+ 0.02%) ~ ~ p=0.001 n=6
Memory used 1,218,703k (± 0.00%) 1,217,056k (± 0.00%) -1,647k (- 0.14%) 1,217,012k 1,217,146k p=0.005 n=6
Parse Time 6.68s (± 0.41%) 6.63s (± 0.15%) -0.05s (- 0.82%) 6.62s 6.64s p=0.007 n=6
Bind Time 1.87s (± 0.73%) 1.84s (± 0.56%) -0.02s (- 1.25%) 1.83s 1.86s p=0.018 n=6
Check Time 30.93s (± 0.46%) 31.01s (± 0.49%) ~ 30.86s 31.17s p=0.335 n=6
Emit Time 15.01s (± 0.37%) 15.01s (± 0.41%) ~ 14.93s 15.08s p=1.000 n=6
Total Time 54.49s (± 0.34%) 54.50s (± 0.38%) ~ 54.29s 54.71s p=0.810 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,276,156 2,274,358 -1,798 (- 0.08%) ~ ~ p=0.001 n=6
Types 948,845 948,867 +22 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,207,588k (± 0.00%) 2,205,841k (± 0.00%) -1,747k (- 0.08%) 2,205,784k 2,205,895k p=0.005 n=6
Parse Time 6.62s (± 0.21%) 6.60s (± 0.21%) -0.03s (- 0.40%) 6.58s 6.61s p=0.019 n=6
Bind Time 2.33s (± 0.24%) 2.33s (± 1.38%) ~ 2.30s 2.39s p=0.228 n=6
Check Time 73.06s (± 0.45%) 72.65s (± 1.24%) ~ 70.99s 73.62s p=0.471 n=6
Emit Time 0.14s 0.14s (± 4.51%) ~ 0.13s 0.15s p=1.000 n=6
Total Time 82.14s (± 0.40%) 81.71s (± 1.07%) ~ 80.10s 82.67s p=0.378 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,332 1,202,472 -24,860 (- 2.03%) ~ ~ p=0.001 n=6
Types 261,851 261,951 +100 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 2,341,496k (± 0.03%) 2,317,151k (± 0.02%) -24,346k (- 1.04%) 2,316,417k 2,317,629k p=0.005 n=6
Parse Time 5.08s (± 1.19%) 5.09s (± 0.75%) ~ 5.05s 5.16s p=0.688 n=6
Bind Time 1.90s (± 0.43%) 1.89s (± 0.27%) -0.02s (- 0.88%) 1.88s 1.89s p=0.009 n=6
Check Time 34.50s (± 0.13%) 34.52s (± 0.26%) ~ 34.42s 34.64s p=0.936 n=6
Emit Time 3.26s (± 2.11%) 3.24s (± 0.93%) ~ 3.21s 3.28s p=0.520 n=6
Total Time 44.77s (± 0.29%) 44.73s (± 0.22%) ~ 44.63s 44.85s p=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,332 1,202,472 -24,860 (- 2.03%) ~ ~ p=0.001 n=6
Types 261,851 261,951 +100 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 2,533,758k (± 7.20%) 2,391,258k (± 0.02%) 🟩-142,501k (- 5.62%) 2,390,566k 2,391,583k p=0.005 n=6
Parse Time 6.35s (± 0.50%) 6.32s (± 0.65%) ~ 6.28s 6.40s p=0.107 n=6
Bind Time 2.05s (± 0.96%) 2.29s (± 0.28%) 🔻+0.25s (+11.98%) 2.28s 2.30s p=0.005 n=6
Check Time 40.93s (± 0.41%) 40.76s (± 0.32%) ~ 40.51s 40.86s p=0.128 n=6
Emit Time 3.94s (± 1.09%) 3.93s (± 1.62%) ~ 3.86s 4.04s p=0.936 n=6
Total Time 53.28s (± 0.35%) 53.31s (± 0.30%) ~ 53.03s 53.47s p=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,516 256,898 -1,618 (- 0.63%) ~ ~ p=0.001 n=6
Types 104,901 104,891 -10 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 427,882k (± 0.03%) 425,908k (± 0.02%) -1,975k (- 0.46%) 425,793k 426,103k p=0.005 n=6
Parse Time 4.14s (± 0.47%) 4.14s (± 0.45%) ~ 4.12s 4.17s p=0.625 n=6
Bind Time 1.63s (± 1.27%) 1.58s (± 1.36%) -0.04s (- 2.66%) 1.54s 1.60s p=0.016 n=6
Check Time 22.19s (± 0.16%) 22.30s (± 0.59%) ~ 22.12s 22.44s p=0.149 n=6
Emit Time 2.01s (± 0.49%) 2.00s (± 1.21%) ~ 1.96s 2.02s p=0.797 n=6
Total Time 29.96s (± 0.19%) 30.03s (± 0.46%) ~ 29.88s 30.23s p=0.466 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,565 223,063 -1,502 (- 0.67%) ~ ~ p=0.001 n=6
Types 93,734 93,821 +87 (+ 0.09%) ~ ~ p=0.001 n=6
Memory used 369,610k (± 0.03%) 367,982k (± 0.03%) -1,628k (- 0.44%) 367,845k 368,136k p=0.005 n=6
Parse Time 3.45s (± 0.75%) 3.45s (± 0.44%) ~ 3.43s 3.46s p=0.935 n=6
Bind Time 1.94s (± 0.89%) 1.91s (± 1.26%) -0.03s (- 1.72%) 1.88s 1.94s p=0.028 n=6
Check Time 19.34s (± 0.31%) 19.32s (± 0.24%) ~ 19.26s 19.37s p=0.568 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.73s (± 0.30%) 24.67s (± 0.18%) ~ 24.60s 24.74s p=0.296 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,973,494 2,973,844 +350 (+ 0.01%) ~ ~ p=0.001 n=6
Types 1,021,207 1,021,632 +425 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 3,097,873k (± 0.00%) 3,097,234k (± 0.00%) -639k (- 0.02%) 3,097,090k 3,097,337k p=0.005 n=6
Parse Time 13.89s (± 0.16%) 13.96s (± 0.22%) +0.06s (+ 0.47%) 13.90s 13.99s p=0.016 n=6
Bind Time 4.31s (± 2.17%) 4.32s (± 2.79%) ~ 4.23s 4.50s p=0.294 n=6
Check Time 79.31s (± 0.46%) 77.46s (± 2.60%) -1.84s (- 2.32%) 74.61s 79.08s p=0.013 n=6
Emit Time 20.43s (± 0.79%) 21.67s (± 8.50%) ~ 20.38s 24.06s p=0.128 n=6
Total Time 117.93s (± 0.34%) 117.41s (± 0.20%) -0.52s (- 0.44%) 117.04s 117.66s p=0.045 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,370 267,657 +287 (+ 0.11%) ~ ~ p=0.001 n=6
Types 108,862 109,265 +403 (+ 0.37%) ~ ~ p=0.001 n=6
Memory used 411,932k (± 0.01%) 411,259k (± 0.02%) -673k (- 0.16%) 411,178k 411,347k p=0.005 n=6
Parse Time 3.83s (± 0.73%) 3.85s (± 0.55%) ~ 3.83s 3.88s p=0.329 n=6
Bind Time 1.69s (± 0.48%) 1.67s (± 0.91%) -0.02s (- 1.28%) 1.64s 1.68s p=0.016 n=6
Check Time 16.88s (± 0.29%) 16.78s (± 0.25%) -0.09s (- 0.55%) 16.72s 16.84s p=0.008 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.40s (± 0.28%) 22.30s (± 0.21%) -0.10s (- 0.44%) 22.25s 22.36s p=0.016 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 510,573 508,867 -1,706 (- 0.33%) ~ ~ p=0.001 n=6
Types 161,621 161,682 +61 (+ 0.04%) ~ ~ p=0.001 n=6
Memory used 448,305k (± 0.10%) 446,460k (± 0.07%) -1,845k (- 0.41%) 446,017k 446,739k p=0.005 n=6
Parse Time 3.90s (± 0.60%) 3.89s (± 0.85%) ~ 3.86s 3.95s p=0.517 n=6
Bind Time 1.46s (± 1.26%) 1.43s (± 1.23%) -0.03s (- 2.17%) 1.40s 1.44s p=0.009 n=6
Check Time 21.22s (± 0.20%) 21.17s (± 0.33%) ~ 21.03s 21.22s p=0.171 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 26.58s (± 0.15%) 26.49s (± 0.32%) -0.09s (- 0.33%) 26.34s 26.59s p=0.045 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59205/merge:

Everything looks good!

@mfulton26
Copy link
Contributor Author

What do you think of these changes @sandersn? This branch is currently up to date with main. I've noticed various changes to iterators, iterables, and typed arrays (e.g. bug fixes) that would have been easier/avoided with root TypedArray and TypedArrayConstructor types.

@DanielRosenwasser
Copy link
Member

@rbuckton How much of this intersects with the work at #58573?

@rbuckton
Copy link
Member

@rbuckton How much of this intersects with the work at #58573?

They are essentially the same, except for the generic Buffer type argument.

@rbuckton
Copy link
Member

They are essentially the same, except for the generic Buffer type argument.

Sorry, I misspoke. I mistakenly thought you were referencing #59407, which is similar except that #59407 allows the individual typed arrays to be generic over ArrayBufferLike which requires a bit more complexity to enable than is present in this PR.

The only way this PR intersects with #58573 would be in what paths are used.

@mfulton26
Copy link
Contributor Author

Should this PR be closed in favor of #59407? My main goal is to get a common TypedArray and TypedArrayConstructor to reference, extend, etc. Both PRs do this but #59407 does more.

@rbuckton
Copy link
Member

rbuckton commented Aug 8, 2024

Should this PR be closed in favor of #59407? My main goal is to get a common TypedArray and TypedArrayConstructor to reference, extend, etc. Both PRs do this but #59407 does more.

Possibly, but I'm not certain #59407 is the best solution either. While I'd like to introduce TypedArray/TypedArrayConstructor, TypedArrayConstructor needs a higher-kinded types mechanism to be defined cleanly. It's more likely that we'll end up taking #59417 in the near term (5.7 or later) and will need to postpone TypedArray/TypedArrayConstructor for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Big(Int|Uint)64ArrayConstructor: missing from Iterable Suggestion: a built-in TypedArray interface
7 participants