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

Use a const type parameter for Object.freeze. #52317

Closed
wants to merge 4 commits into from

Conversation

DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Jan 19, 2023

This PR removes an unnecessary signature from Object.freeze by using TypeScript 5.0's new const type parameters.

I think if we want to try this out, 5.0 beta is the right time.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 19, 2023
@DanielRosenwasser
Copy link
Member Author

@typescript-bot pack this
@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top100
@typescript-bot run dt
@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at 241b3f2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at 241b3f2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

Heya @DanielRosenwasser, I've started to run the parallelized Definitely Typed test suite on this PR at 241b3f2. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite on this PR at 241b3f2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at 241b3f2. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 19, 2023

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/143202/artifacts?artifactName=tgz&fileId=28CB761571B2A532E58B46779FF657A82496E5A569938B732DB238B8D316BD1502&fileName=/typescript-5.0.0-insiders.20230119.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-52317-9".;

src/lib/es5.d.ts Outdated Show resolved Hide resolved
@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

  • [NEW] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ readonly initialize: SyncHook<[], void, UnsetAdditionalOptions>; readonly shouldEmit: SyncBailHook<[Compilation], boolean, UnsetAdditionalOptions>; ... 29 more ...; readonly entryOption: SyncBailHook<...>; }>'.
  • [NEW] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ readonly buildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; readonly rebuildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; ... 87 more ...; readonly normalModuleLoader: SyncHook<...>; }>'.
  • [MISSING] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ initialize: SyncHook<[], void, UnsetAdditionalOptions>; shouldEmit: SyncBailHook<[Compilation], boolean, UnsetAdditionalOptions>; ... 29 more ...; entryOption: SyncBailHook<...>; }>'.
  • [MISSING] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ buildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; rebuildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; ... 87 more ...; readonly normalModuleLoader: SyncHook<...>; }>'.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/52317/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..52317

Metric main 52317 Delta Best Worst
Angular - node (v16.17.1, x64)
Memory used 358,166k (± 0.01%) 358,176k (± 0.02%) +10k (+ 0.00%) 358,099k 358,256k
Parse Time 4.11s (± 0.29%) 4.15s (± 0.21%) +0.04s (+ 0.92%) 4.13s 4.15s
Bind Time 1.25s (± 0.70%) 1.24s (± 0.15%) -0.02s (- 1.33%) 1.23s 1.24s
Check Time 9.52s (± 0.54%) 9.51s (± 0.29%) -0.01s (- 0.13%) 9.47s 9.53s
Emit Time 7.95s (± 0.50%) 8.06s (± 0.54%) +0.11s (+ 1.33%) 8.00s 8.11s
Total Time 22.83s (± 0.35%) 22.95s (± 0.24%) +0.12s (+ 0.51%) 22.86s 23.02s
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,866k (± 0.08%) 194,307k (± 0.02%) +441k (+ 0.23%) 194,265k 194,359k
Parse Time 1.81s (± 1.20%) 1.80s (± 0.20%) -0.01s (- 0.43%) 1.80s 1.81s
Bind Time 0.85s (± 0.20%) 0.84s (± 0.53%) -0.01s (- 0.95%) 0.83s 0.85s
Check Time 10.35s (± 0.37%) 10.38s (± 0.58%) +0.03s (+ 0.32%) 10.28s 10.45s
Emit Time 3.14s (± 5.23%) 3.07s (± 1.29%) -0.07s (- 2.35%) 3.03s 3.14s
Total Time 16.15s (± 1.10%) 16.09s (± 0.52%) -0.06s (- 0.37%) 15.99s 16.23s
Monaco - node (v16.17.1, x64)
Memory used 345,113k (± 0.01%) 343,216k (± 0.01%) -1,897k (- 0.55%) 343,169k 343,239k
Parse Time 3.12s (± 1.64%) 3.11s (± 1.24%) -0.01s (- 0.21%) 3.07s 3.18s
Bind Time 1.12s (± 0.77%) 1.10s (± 0.99%) -0.03s (- 2.37%) 1.08s 1.11s
Check Time 7.86s (± 0.31%) 7.86s (± 0.22%) -0.00s (- 0.04%) 7.84s 7.88s
Emit Time 4.57s (± 0.70%) 4.53s (± 0.59%) -0.03s (- 0.73%) 4.50s 4.56s
Total Time 16.67s (± 0.39%) 16.61s (± 0.37%) -0.06s (- 0.39%) 16.55s 16.70s
TFS - node (v16.17.1, x64)
Memory used 299,924k (± 0.01%) 299,618k (± 0.00%) -306k (- 0.10%) 299,603k 299,634k
Parse Time 2.43s (± 0.73%) 2.45s (± 0.95%) +0.01s (+ 0.52%) 2.41s 2.47s
Bind Time 1.27s (± 0.91%) 1.26s (± 1.36%) -0.00s (- 0.36%) 1.23s 1.28s
Check Time 7.48s (± 0.60%) 7.47s (± 0.39%) -0.01s (- 0.08%) 7.43s 7.51s
Emit Time 4.24s (± 0.45%) 4.23s (± 0.78%) -0.01s (- 0.26%) 4.20s 4.28s
Total Time 15.42s (± 0.39%) 15.41s (± 0.30%) -0.01s (- 0.04%) 15.34s 15.46s
material-ui - node (v16.17.1, x64)
Memory used 475,695k (± 0.00%) 475,349k (± 0.01%) -346k (- 0.07%) 475,312k 475,381k
Parse Time 3.67s (± 0.40%) 3.66s (± 0.33%) -0.01s (- 0.28%) 3.65s 3.68s
Bind Time 1.01s (± 0.65%) 1.01s (± 0.48%) -0.01s (- 0.89%) 1.00s 1.01s
Check Time 18.05s (± 0.68%) 18.05s (± 1.48%) -0.00s (- 0.00%) 17.87s 18.59s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 22.73s (± 0.55%) 22.71s (± 1.20%) -0.02s (- 0.07%) 22.55s 23.27s
xstate - node (v16.17.1, x64)
Memory used 543,940k (± 0.01%) 544,488k (± 0.02%) +548k (+ 0.10%) 544,348k 544,635k
Parse Time 4.59s (± 0.75%) 4.60s (± 0.65%) +0.01s (+ 0.27%) 4.57s 4.66s
Bind Time 1.79s (± 0.67%) 1.78s (± 0.55%) -0.01s (- 0.75%) 1.77s 1.79s
Check Time 2.94s (± 0.65%) 2.95s (± 0.30%) +0.01s (+ 0.25%) 2.93s 2.96s
Emit Time 0.09s (± 4.62%) 0.09s (± 7.08%) +0.00s (+ 1.69%) 0.08s 0.10s
Total Time 9.42s (± 0.45%) 9.42s (± 0.46%) +0.01s (+ 0.07%) 9.37s 9.50s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52317 6
Baseline main 6

Developer Information:

Download Benchmark

@DanielRosenwasser
Copy link
Member Author

@typescript-bot pack this
@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test tsserver top100
@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite (tsserver) on this PR at bedfac1. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

Heya @DanielRosenwasser, I've started to run the diff-based user code test suite on this PR at bedfac1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite on this PR at bedfac1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

Heya @DanielRosenwasser, I've started to run the diff-based top-repos suite (tsserver) on this PR at bedfac1. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

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

@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review January 20, 2023 00:17
@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 20, 2023

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/143231/artifacts?artifactName=tgz&fileId=D513BBD7D2E92BD8C59FE26687B5A5D7FE98CE9809E93573C555B4E9A2C83C3302&fileName=/typescript-5.0.0-insiders.20230120.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.0.0-pr-52317-22".;

@@ -9,7 +9,7 @@ tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly
someFunction(function(BaseClass) {
~~~~~~~~~~~~
!!! error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'?
!!! related TS2728 /.ts/lib.es5.d.ts:321:13: 'Function' is declared here.
!!! related TS2728 /.ts/lib.es5.d.ts:315:13: 'Function' is declared here.
Copy link
Member

Choose a reason for hiding this comment

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

I really want to send a PR which changes the baselines to filter out all line numbers from lib.*.d.ts files; it really sucks to modify a baseline and have it all be line numbers that don't matter.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking the same - however, maybe start conservative and only do that on related spans.

Copy link
Member

Choose a reason for hiding this comment

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

The other problem is that when you add a new overload to a lib, more than just line numbers change; any use gets more symbols too, so it's not a perfect solution.

Copy link
Member

Choose a reason for hiding this comment

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

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

  • [NEW] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ readonly initialize: SyncHook<[], void, UnsetAdditionalOptions>; readonly shouldEmit: SyncBailHook<[Compilation], boolean, UnsetAdditionalOptions>; ... 29 more ...; readonly entryOption: SyncBailHook<...>; }>'.
  • [NEW] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ readonly buildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; readonly rebuildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; ... 87 more ...; readonly normalModuleLoader: SyncHook<...>; }>'.
  • [MISSING] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ initialize: SyncHook<[], void, UnsetAdditionalOptions>; shouldEmit: SyncBailHook<[Compilation], boolean, UnsetAdditionalOptions>; ... 29 more ...; entryOption: SyncBailHook<...>; }>'.
  • [MISSING] error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Readonly<{ buildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; rebuildModule: SyncHook<[Module], void, UnsetAdditionalOptions>; ... 87 more ...; readonly normalModuleLoader: SyncHook<...>; }>'.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the user test suite comparing main and refs/pull/52317/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@jakebailey
Copy link
Member

Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

This one's actually interesting!

@DanielRosenwasser
Copy link
Member Author

Heya @DanielRosenwasser, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

This one's actually interesting!

There were already mapped through Readonly - so while useful to view, I don't think there's any regression.

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

babel/babel

⚠️ Note that built also had errors ⚠️
Req #710 - definitionAndBoundSpan
    at getConstructorDefinedThisAssignmentTypes (/typescript-main/built/local/tsserver.js:55613:11)
    at getWidenedTypeForAssignmentDeclaration (/typescript-main/built/local/tsserver.js:55427:78)
    at getTypeOfVariableOrParameterOrPropertyWorker (/typescript-main/built/local/tsserver.js:55811:14)
    at getTypeOfVariableOrParameterOrProperty (/typescript-main/built/local/tsserver.js:55759:20)
    at getTypeOfSymbol (/typescript-main/built/local/tsserver.js:56076:14)
    at checkPropertyAccessExpressionOrQualifiedName (/typescript-main/built/local/tsserver.js:72744:116)
    at checkPropertyAccessExpression (/typescript-main/built/local/tsserver.js:72508:94)
    at getSymbolOfNameOrPropertyAccessExpression (/typescript-main/built/local/tsserver.js:83998:11)
    at getSymbolAtLocation (/typescript-main/built/local/tsserver.js:84123:18)
    at Object.getSymbolAtLocation (/typescript-main/built/local/tsserver.js:47227:21)
    at getSymbol (/typescript-main/built/local/tsserver.js:157251:26)
    at getDefinitionAtPosition (/typescript-main/built/local/tsserver.js:157054:43)
    at Object.getDefinitionAndBoundSpan (/typescript-main/built/local/tsserver.js:157235:23)
    at Object.getDefinitionAndBoundSpan2 [as getDefinitionAndBoundSpan] (/typescript-main/built/local/tsserver.js:137622:38)
    at IOSession.getDefinitionAndBoundSpan (/typescript-main/built/local/tsserver.js:179293:73)
    at definitionAndBoundSpan (/typescript-main/built/local/tsserver.js:178275:43)
    at /typescript-main/built/local/tsserver.js:180796:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:180788:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:180796:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:180838:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:182289:14)
Req #710 - definitionAndBoundSpan
    at getConstructorDefinedThisAssignmentTypes (/typescript-52317/built/local/tsserver.js:55613:11)
    at getWidenedTypeForAssignmentDeclaration (/typescript-52317/built/local/tsserver.js:55427:78)
    at getTypeOfVariableOrParameterOrPropertyWorker (/typescript-52317/built/local/tsserver.js:55811:14)
    at getTypeOfVariableOrParameterOrProperty (/typescript-52317/built/local/tsserver.js:55759:20)
    at getTypeOfSymbol (/typescript-52317/built/local/tsserver.js:56076:14)
    at checkPropertyAccessExpressionOrQualifiedName (/typescript-52317/built/local/tsserver.js:72744:116)
    at checkPropertyAccessExpression (/typescript-52317/built/local/tsserver.js:72508:94)
    at getSymbolOfNameOrPropertyAccessExpression (/typescript-52317/built/local/tsserver.js:83998:11)
    at getSymbolAtLocation (/typescript-52317/built/local/tsserver.js:84123:18)
    at Object.getSymbolAtLocation (/typescript-52317/built/local/tsserver.js:47227:21)
    at getSymbol (/typescript-52317/built/local/tsserver.js:157251:26)
    at getDefinitionAtPosition (/typescript-52317/built/local/tsserver.js:157054:43)
    at Object.getDefinitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:157235:23)
    at Object.getDefinitionAndBoundSpan2 [as getDefinitionAndBoundSpan] (/typescript-52317/built/local/tsserver.js:137622:38)
    at IOSession.getDefinitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:179293:73)
    at definitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:178275:43)
    at /typescript-52317/built/local/tsserver.js:180796:69
    at IOSession.executeWithRequestId (/typescript-52317/built/local/tsserver.js:180788:14)
    at IOSession.executeCommand (/typescript-52317/built/local/tsserver.js:180796:29)
    at IOSession.onMessage (/typescript-52317/built/local/tsserver.js:180838:51)
    at Interface.<anonymous> (/typescript-52317/built/local/tsserver.js:182289:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults1/babel.babel.rawError.txt in the artifact folder

Last few requests

{"seq":707,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":5,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":708,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":5,"entryNames":["arguments"]}}
{"seq":709,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":25}}
{"seq":710,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":494,"offset":26}}

Repro Steps

  1. git clone https://github.com/babel/babel --recurse-submodules
  2. In dir babel, run git reset --hard 0f68471ef79933e192b69f2ebdf586fb5d5e54ce
  3. Back in the initial folder, download RepoResults1/babel.babel.replay.txt from the artifact folder
  4. npm install --no-save @typescript/server-replay
  5. npx tsreplay ./babel ./babel.babel.replay.txt path/to/tsserver.js
  6. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

microsoft/vscode

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

extensions/markdown-language-features/server/tsconfig.json

1 similar comment
@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

microsoft/vscode

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

extensions/markdown-language-features/server/tsconfig.json

@typescript-bot
Copy link
Collaborator

@DanielRosenwasser Here are the results of running the top-repos suite comparing main and refs/pull/52317/merge:

Something interesting changed - please have a look.

Details

babel/babel

⚠️ Note that built also had errors ⚠️
Req #710 - definitionAndBoundSpan
    at getConstructorDefinedThisAssignmentTypes (/typescript-main/built/local/tsserver.js:55613:11)
    at getWidenedTypeForAssignmentDeclaration (/typescript-main/built/local/tsserver.js:55427:78)
    at getTypeOfVariableOrParameterOrPropertyWorker (/typescript-main/built/local/tsserver.js:55811:14)
    at getTypeOfVariableOrParameterOrProperty (/typescript-main/built/local/tsserver.js:55759:20)
    at getTypeOfSymbol (/typescript-main/built/local/tsserver.js:56076:14)
    at checkPropertyAccessExpressionOrQualifiedName (/typescript-main/built/local/tsserver.js:72744:116)
    at checkPropertyAccessExpression (/typescript-main/built/local/tsserver.js:72508:94)
    at getSymbolOfNameOrPropertyAccessExpression (/typescript-main/built/local/tsserver.js:83998:11)
    at getSymbolAtLocation (/typescript-main/built/local/tsserver.js:84123:18)
    at Object.getSymbolAtLocation (/typescript-main/built/local/tsserver.js:47227:21)
    at getSymbol (/typescript-main/built/local/tsserver.js:157251:26)
    at getDefinitionAtPosition (/typescript-main/built/local/tsserver.js:157054:43)
    at Object.getDefinitionAndBoundSpan (/typescript-main/built/local/tsserver.js:157235:23)
    at Object.getDefinitionAndBoundSpan2 [as getDefinitionAndBoundSpan] (/typescript-main/built/local/tsserver.js:137622:38)
    at IOSession.getDefinitionAndBoundSpan (/typescript-main/built/local/tsserver.js:179293:73)
    at definitionAndBoundSpan (/typescript-main/built/local/tsserver.js:178275:43)
    at /typescript-main/built/local/tsserver.js:180796:69
    at IOSession.executeWithRequestId (/typescript-main/built/local/tsserver.js:180788:14)
    at IOSession.executeCommand (/typescript-main/built/local/tsserver.js:180796:29)
    at IOSession.onMessage (/typescript-main/built/local/tsserver.js:180838:51)
    at Interface.<anonymous> (/typescript-main/built/local/tsserver.js:182289:14)
Req #710 - definitionAndBoundSpan
    at getConstructorDefinedThisAssignmentTypes (/typescript-52317/built/local/tsserver.js:55613:11)
    at getWidenedTypeForAssignmentDeclaration (/typescript-52317/built/local/tsserver.js:55427:78)
    at getTypeOfVariableOrParameterOrPropertyWorker (/typescript-52317/built/local/tsserver.js:55811:14)
    at getTypeOfVariableOrParameterOrProperty (/typescript-52317/built/local/tsserver.js:55759:20)
    at getTypeOfSymbol (/typescript-52317/built/local/tsserver.js:56076:14)
    at checkPropertyAccessExpressionOrQualifiedName (/typescript-52317/built/local/tsserver.js:72744:116)
    at checkPropertyAccessExpression (/typescript-52317/built/local/tsserver.js:72508:94)
    at getSymbolOfNameOrPropertyAccessExpression (/typescript-52317/built/local/tsserver.js:83998:11)
    at getSymbolAtLocation (/typescript-52317/built/local/tsserver.js:84123:18)
    at Object.getSymbolAtLocation (/typescript-52317/built/local/tsserver.js:47227:21)
    at getSymbol (/typescript-52317/built/local/tsserver.js:157251:26)
    at getDefinitionAtPosition (/typescript-52317/built/local/tsserver.js:157054:43)
    at Object.getDefinitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:157235:23)
    at Object.getDefinitionAndBoundSpan2 [as getDefinitionAndBoundSpan] (/typescript-52317/built/local/tsserver.js:137622:38)
    at IOSession.getDefinitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:179293:73)
    at definitionAndBoundSpan (/typescript-52317/built/local/tsserver.js:178275:43)
    at /typescript-52317/built/local/tsserver.js:180796:69
    at IOSession.executeWithRequestId (/typescript-52317/built/local/tsserver.js:180788:14)
    at IOSession.executeCommand (/typescript-52317/built/local/tsserver.js:180796:29)
    at IOSession.onMessage (/typescript-52317/built/local/tsserver.js:180838:51)
    at Interface.<anonymous> (/typescript-52317/built/local/tsserver.js:182289:14)

That is a filtered view of the text. To see the raw error text, go to RepoResults1/babel.babel.rawError.txt in the artifact folder

Last few requests

{"seq":707,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":5,"includeExternalModuleExports":false,"includeInsertTextCompletions":true,"triggerKind":1}}
{"seq":708,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":5,"entryNames":["arguments"]}}
{"seq":709,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":462,"offset":25}}
{"seq":710,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/packages/babel-generator/test/fixtures/sourcemaps/real-world-babel-file2/output.js","line":494,"offset":26}}

Repro Steps

  1. git clone https://github.com/babel/babel --recurse-submodules
  2. In dir babel, run git reset --hard 0f68471ef79933e192b69f2ebdf586fb5d5e54ce
  3. Back in the initial folder, download RepoResults1/babel.babel.replay.txt from the artifact folder
  4. npm install --no-save @typescript/server-replay
  5. npx tsreplay ./babel ./babel.babel.replay.txt path/to/tsserver.js
  6. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - main..52317

Metric main 52317 Delta Best Worst
Angular - node (v16.17.1, x64)
Memory used 358,170k (± 0.01%) 358,197k (± 0.01%) +27k (+ 0.01%) 358,145k 358,250k
Parse Time 4.13s (± 0.44%) 4.15s (± 0.16%) +0.02s (+ 0.52%) 4.14s 4.16s
Bind Time 1.24s (± 0.39%) 1.25s (± 0.50%) +0.01s (+ 0.80%) 1.24s 1.26s
Check Time 9.52s (± 0.65%) 9.51s (± 0.33%) -0.01s (- 0.11%) 9.48s 9.56s
Emit Time 8.05s (± 0.55%) 8.08s (± 0.50%) +0.03s (+ 0.37%) 8.03s 8.14s
Total Time 22.95s (± 0.48%) 23.00s (± 0.21%) +0.05s (+ 0.22%) 22.92s 23.05s
Compiler-Unions - node (v16.17.1, x64)
Memory used 194,267k (± 0.02%) 194,183k (± 0.05%) -84k (- 0.04%) 194,087k 194,326k
Parse Time 1.80s (± 0.58%) 1.80s (± 0.38%) -0.00s (- 0.13%) 1.79s 1.81s
Bind Time 0.85s (± 0.97%) 0.85s (± 0.58%) +0.00s (+ 0.36%) 0.84s 0.86s
Check Time 10.36s (± 0.69%) 10.31s (± 0.70%) -0.04s (- 0.40%) 10.26s 10.45s
Emit Time 3.02s (± 0.90%) 3.07s (± 1.55%) +0.05s (+ 1.61%) 3.04s 3.17s
Total Time 16.03s (± 0.56%) 16.04s (± 0.72%) +0.01s (+ 0.05%) 15.95s 16.26s
Monaco - node (v16.17.1, x64)
Memory used 343,251k (± 0.01%) 343,216k (± 0.01%) -35k (- 0.01%) 343,191k 343,247k
Parse Time 3.11s (± 1.27%) 3.10s (± 0.92%) -0.01s (- 0.37%) 3.06s 3.14s
Bind Time 1.10s (± 0.50%) 1.10s (± 0.16%) -0.00s (- 0.40%) 1.09s 1.10s
Check Time 7.92s (± 0.26%) 7.87s (± 0.26%) -0.04s (- 0.54%) 7.85s 7.90s
Emit Time 4.54s (± 0.72%) 4.52s (± 0.50%) -0.02s (- 0.39%) 4.50s 4.56s
Total Time 16.67s (± 0.39%) 16.59s (± 0.31%) -0.08s (- 0.48%) 16.51s 16.67s
TFS - node (v16.17.1, x64)
Memory used 299,659k (± 0.00%) 299,641k (± 0.01%) -18k (- 0.01%) 299,618k 299,671k
Parse Time 2.46s (± 0.80%) 2.45s (± 0.85%) -0.01s (- 0.44%) 2.42s 2.47s
Bind Time 1.26s (± 0.49%) 1.27s (± 0.91%) +0.00s (+ 0.23%) 1.25s 1.28s
Check Time 7.45s (± 0.23%) 7.47s (± 0.64%) +0.02s (+ 0.32%) 7.40s 7.51s
Emit Time 4.25s (± 0.42%) 4.23s (± 0.79%) -0.02s (- 0.45%) 4.19s 4.28s
Total Time 15.42s (± 0.09%) 15.41s (± 0.52%) -0.00s (- 0.03%) 15.31s 15.52s
material-ui - node (v16.17.1, x64)
Memory used 475,373k (± 0.00%) 475,325k (± 0.00%) -48k (- 0.01%) 475,302k 475,361k
Parse Time 3.63s (± 0.28%) 3.65s (± 0.47%) +0.02s (+ 0.65%) 3.63s 3.67s
Bind Time 1.00s (± 0.70%) 1.01s (± 0.62%) +0.01s (+ 0.53%) 1.00s 1.02s
Check Time 18.07s (± 1.21%) 17.95s (± 0.45%) -0.12s (- 0.65%) 17.87s 18.05s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 22.70s (± 0.99%) 22.61s (± 0.39%) -0.09s (- 0.39%) 22.52s 22.72s
xstate - node (v16.17.1, x64)
Memory used 544,522k (± 0.02%) 544,498k (± 0.02%) -24k (- 0.00%) 544,340k 544,620k
Parse Time 4.58s (± 0.67%) 4.62s (± 0.66%) +0.04s (+ 0.86%) 4.58s 4.67s
Bind Time 1.78s (± 0.34%) 1.79s (± 0.31%) +0.01s (+ 0.44%) 1.78s 1.80s
Check Time 2.95s (± 0.49%) 2.95s (± 0.31%) +0.01s (+ 0.29%) 2.94s 2.97s
Emit Time 0.09s (± 0.15%) 0.09s (± 0.17%) +0.00s (+ 0.07%) 0.09s 0.09s
Total Time 9.40s (± 0.41%) 9.44s (± 0.53%) +0.04s (+ 0.44%) 9.37s 9.52s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • Angular - node (v16.17.1, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Monaco - node (v16.17.1, x64)
  • TFS - node (v16.17.1, x64)
  • material-ui - node (v16.17.1, x64)
  • xstate - node (v16.17.1, x64)
Benchmark Name Iterations
Current 52317 6
Baseline main 6

Developer Information:

Download Benchmark

@jakebailey
Copy link
Member

jakebailey commented Jan 20, 2023

That tsserver trace is fixed by #52321 #51524.

@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Jan 20, 2023

Literally talked myself out of this during today's design meeting. It almost makes sense until you realize that nested objects aren't frozen.

While lots of users would like for Object.freeze to do deep immutability, it doesn't. And while you might want it to be a signal for deep immutability for TypeScript, you can achieve that by doing your own interface merging and adding a new signature to freeze in ObjectConstructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants