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

Treat contextually typed functions in JS files as typed #56907

Merged

Conversation

Andarist
Copy link
Contributor

fixes #56900

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 30, 2023
@jakebailey
Copy link
Member

@typescript-bot test top200
@typescript-bot user test this
@typescript-bot run dt

@typescript-bot perf test this
@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jan 4, 2024

Hey @jakebailey, 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/159255/artifacts?artifactName=tgz&fileId=EB4F0807D220309B355F9F343E9CE2CD5748423A179B21BBD0DE75F81484C1CE02&fileName=/typescript-5.4.0-insiders.20240104.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/[email protected]".;

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

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

Compiler

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Angular - node (v18.15.0, x64)
Memory used 295,446k (± 0.01%) 295,466k (± 0.01%) ~ 295,417k 295,518k p=0.521 n=6
Parse Time 2.65s (± 0.21%) 2.65s (± 0.40%) ~ 2.63s 2.66s p=1.000 n=6
Bind Time 0.82s (± 1.00%) 0.82s (± 0.77%) ~ 0.81s 0.83s p=0.599 n=6
Check Time 8.17s (± 0.49%) 8.15s (± 0.25%) ~ 8.13s 8.18s p=0.333 n=6
Emit Time 7.10s (± 0.31%) 7.10s (± 0.15%) ~ 7.08s 7.11s p=0.623 n=6
Total Time 18.73s (± 0.31%) 18.71s (± 0.14%) ~ 18.68s 18.75s p=0.420 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used 192,467k (± 1.22%) 194,416k (± 1.65%) ~ 191,469k 197,413k p=0.471 n=6
Parse Time 1.35s (± 1.85%) 1.36s (± 1.46%) ~ 1.32s 1.38s p=0.871 n=6
Bind Time 0.72s (± 0.00%) 0.72s (± 0.00%) ~ 0.72s 0.72s p=1.000 n=6
Check Time 9.27s (± 0.44%) 9.24s (± 0.31%) ~ 9.19s 9.27s p=0.260 n=6
Emit Time 2.62s (± 1.09%) 2.62s (± 1.01%) ~ 2.59s 2.66s p=0.807 n=6
Total Time 13.97s (± 0.28%) 13.94s (± 0.19%) ~ 13.91s 13.97s p=0.225 n=6
Monaco - node (v18.15.0, x64)
Memory used 347,410k (± 0.01%) 347,402k (± 0.00%) ~ 347,382k 347,427k p=0.575 n=6
Parse Time 2.47s (± 0.43%) 2.46s (± 0.60%) ~ 2.43s 2.47s p=0.554 n=6
Bind Time 0.93s (± 0.59%) 0.93s (± 0.44%) ~ 0.92s 0.93s p=0.282 n=6
Check Time 6.87s (± 0.25%) 6.87s (± 0.61%) ~ 6.84s 6.95s p=0.570 n=6
Emit Time 4.06s (± 0.29%) 4.05s (± 0.19%) ~ 4.04s 4.06s p=0.054 n=6
Total Time 14.33s (± 0.19%) 14.30s (± 0.24%) ~ 14.27s 14.36s p=0.260 n=6
TFS - node (v18.15.0, x64)
Memory used 302,725k (± 0.01%) 302,736k (± 0.01%) ~ 302,711k 302,759k p=0.748 n=6
Parse Time 1.99s (± 0.55%) 2.01s (± 1.50%) ~ 1.96s 2.05s p=0.250 n=6
Bind Time 1.01s (± 0.97%) 1.00s (± 1.17%) ~ 0.99s 1.02s p=0.066 n=6
Check Time 6.28s (± 0.33%) 6.30s (± 0.23%) ~ 6.28s 6.32s p=0.256 n=6
Emit Time 3.58s (± 0.48%) 3.58s (± 0.29%) ~ 3.57s 3.60s p=0.806 n=6
Total Time 12.87s (± 0.22%) 12.89s (± 0.28%) ~ 12.83s 12.93s p=0.195 n=6
material-ui - node (v18.15.0, x64)
Memory used 506,810k (± 0.00%) 506,831k (± 0.01%) ~ 506,773k 506,870k p=0.149 n=6
Parse Time 2.58s (± 0.76%) 2.58s (± 0.41%) ~ 2.57s 2.60s p=0.802 n=6
Bind Time 0.98s (± 1.40%) 0.99s (± 0.52%) ~ 0.99s 1.00s p=0.111 n=6
Check Time 16.97s (± 0.44%) 16.96s (± 0.39%) ~ 16.88s 17.07s p=0.873 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.54s (± 0.31%) 20.54s (± 0.32%) ~ 20.47s 20.65s p=1.000 n=6
xstate - node (v18.15.0, x64)
Memory used 512,892k (± 0.01%) 512,824k (± 0.01%) ~ 512,722k 512,925k p=0.128 n=6
Parse Time 3.27s (± 0.32%) 3.27s (± 0.23%) ~ 3.26s 3.28s p=0.611 n=6
Bind Time 1.54s (± 0.36%) 1.54s (± 0.36%) ~ 1.53s 1.54s p=1.000 n=6
Check Time 2.84s (± 0.96%) 2.83s (± 0.37%) ~ 2.81s 2.84s p=0.809 n=6
Emit Time 0.07s (± 0.00%) 0.07s (± 0.00%) ~ 0.07s 0.07s p=1.000 n=6
Total Time 7.72s (± 0.32%) 7.72s (± 0.25%) ~ 7.69s 7.74s p=0.872 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,342ms (± 0.97%) 2,350ms (± 0.91%) ~ 2,316ms 2,375ms p=0.471 n=6
Req 2 - geterr 5,448ms (± 1.94%) 5,447ms (± 1.38%) ~ 5,364ms 5,524ms p=1.000 n=6
Req 3 - references 328ms (± 1.58%) 325ms (± 1.17%) ~ 320ms 331ms p=0.295 n=6
Req 4 - navto 274ms (± 1.10%) 275ms (± 1.05%) ~ 272ms 279ms p=0.935 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 92ms (± 4.92%) 92ms (± 4.50%) ~ 84ms 95ms p=1.000 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,500ms (± 0.83%) 2,474ms (± 1.08%) ~ 2,441ms 2,514ms p=0.092 n=6
Req 2 - geterr 4,139ms (± 1.80%) 4,159ms (± 2.01%) ~ 4,078ms 4,238ms p=1.000 n=6
Req 3 - references 338ms (± 0.98%) 335ms (± 1.39%) ~ 332ms 344ms p=0.167 n=6
Req 4 - navto 285ms (± 1.03%) 286ms (± 1.31%) ~ 283ms 291ms p=0.931 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 85ms (± 7.16%) 83ms (± 6.19%) ~ 78ms 89ms p=0.415 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,609ms (± 0.63%) 2,595ms (± 0.83%) ~ 2,575ms 2,620ms p=0.470 n=6
Req 2 - geterr 1,738ms (± 2.36%) 1,693ms (± 2.79%) ~ 1,639ms 1,764ms p=0.128 n=6
Req 3 - references 108ms (± 9.55%) 113ms (±10.71%) ~ 101ms 125ms p=0.285 n=6
Req 4 - navto 362ms (± 1.14%) 365ms (± 0.24%) ~ 364ms 366ms p=0.084 n=6
Req 5 - completionInfo count 2,073 (± 0.00%) 2,073 (± 0.00%) ~ 2,073 2,073 p=1.000 n=6
Req 5 - completionInfo 310ms (± 1.87%) 303ms (± 2.16%) ~ 296ms 312ms p=0.128 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Startup

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
tsc-startup - node (v18.15.0, x64)
Execution time 153.75ms (± 0.20%) 153.65ms (± 0.19%) -0.10ms (- 0.06%) 152.60ms 156.13ms p=0.002 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 228.47ms (± 0.15%) 228.33ms (± 0.17%) -0.14ms (- 0.06%) 227.09ms 233.34ms p=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 230.75ms (± 0.21%) 230.53ms (± 0.18%) -0.22ms (- 0.09%) 228.62ms 234.69ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 230.35ms (± 0.21%) 230.32ms (± 0.19%) ~ 228.36ms 235.21ms p=0.845 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - 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-repos suite comparing main and refs/pull/56907/merge:

Everything looks good!

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I think looking for a contextual signature might be incorrect unless there's somethiing inherently contextual about @satisfies that @type doesn't have.

@@ -15107,7 +15107,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
isInJSFile(declaration) &&
isValueSignatureDeclaration(declaration) &&
!hasJSDocParameterTags(declaration) &&
!getJSDocType(declaration);
!getJSDocType(declaration) &&
!getContextualSignatureForFunctionLikeDeclaration(declaration);
Copy link
Member

Choose a reason for hiding this comment

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

Does this change the semantics of @type, or is it specific to @satisfies? For example, in

/** @type {(uuid: string) => string}
const f = uuid => uuid

I recall that @type intentionally is not treated as a contextual signature in that case, but I could be mistaken. I believe that instead the @type tag is looked up and treated the same as if it were written:

const f = /** @type {(uuid: string) => }*/(uuid => uuid)

That is, treated like a cast. Probably @satisfies should be the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It changes the semantics of the second example but not the first one. @type above the declaration is treated as the contextual signature (getContextualSignature calls getSignatureOfTypeTag and returns that if it's found).

That said, I'm not sure if this is a bad change. This flag has one purpose - it changes how getMinArgumentCount gets computed. If the types of parameters are assigned in just any way, I think it's surprising that the resulting signature might get treated as "untyped" and that it might allow calls without all (seemingly) required parameters. Just take a look at the situation reported in this thread and at the discussion happening there. While this PR here doesn't solve the problem described there with @type applied to parameters, the root cause is similar - despite the call being typed it's treated as untyped. This creates weird discrepancies between TS and JS files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An extra data point:

const f1 = /** @type {(uuid: string) => {}}*/(uuid => uuid)
f1() // error

const f2 = /** @satisfies {(uuid: string) => {}}*/(uuid => uuid)
f2() // ok, wat?

The reason behind the difference here is that with the cast the inner signature is untyped but the final type of f1 is sourced from the casted type itself. Since that's a type node~ it can't be untyped.

To give more context on the above:

  • checkAssertionWorker computes exprType with an untyped signature (but its parameters are typed!)
  • but it returns getTypeFromTypeNode(type)

This can't work like that with @satisfies as the @satifies merely provides some contextual typing - it doesn't "override" the expression type.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, that explanation helps. I was getting side-tracked by having the jsdoc on the declaration instead of directly on the arrow.

@sandersn sandersn self-assigned this Jan 29, 2024
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 29, 2024
@sandersn sandersn requested a review from rbuckton January 29, 2024 23:33
@Andarist Andarist requested a review from sandersn May 21, 2024 09:05
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

This makes sense to me as a place that should have been contextually typed before, but wasn't.

@@ -15107,7 +15107,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
isInJSFile(declaration) &&
isValueSignatureDeclaration(declaration) &&
!hasJSDocParameterTags(declaration) &&
!getJSDocType(declaration);
!getJSDocType(declaration) &&
!getContextualSignatureForFunctionLikeDeclaration(declaration);
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, that explanation helps. I was getting side-tracked by having the jsdoc on the declaration instead of directly on the arrow.

@sandersn
Copy link
Member

@Andarist can you merge this from main and then I'll run typescript-bot test it before merging it.

@Andarist
Copy link
Contributor Author

@sandersn done

@Andarist
Copy link
Contributor Author

@jakebailey could u rerun extended tests here?

@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 14, 2025

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/56907/merge:

Something interesting changed - please have a look.

Details

webpack

tsconfig.types.json

  • [NEW] error TS2322: Type '(schema: Schema) => any' is not assignable to type '{ (): T; (schema: Schema): T; }'.

tsconfig.json

  • [NEW] error TS2322: Type '(schema: Schema) => any' is not assignable to type '{ (): T; (schema: Schema): T; }'.
  • [NEW] error TS2322: Type '(options: ResolveOptionsWithDependencyType) => (context: string, request: string, callback: (err: ErrorWithDetail, res?: string | false, req?: ResolveRequest) => void) => Promise<...>' is not assignable to type '(options?: ResolveOptionsWithDependencyType) => ((context: string, request: string, callback: (err: ErrorWithDetail, res?: string | false, req?: ResolveRequest) => void) => void) & ((context: string, request: string) => Promise<...>)'.

@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 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,390 62,390 ~ ~ ~ p=1.000 n=6
Types 50,395 50,395 ~ ~ ~ p=1.000 n=6
Memory used 194,807k (± 1.00%) 194,709k (± 1.01%) ~ 192,870k 196,554k p=0.630 n=6
Parse Time 1.31s (± 0.89%) 1.31s (± 1.15%) ~ 1.28s 1.32s p=1.000 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.72s (± 0.40%) 9.76s (± 0.36%) ~ 9.72s 9.82s p=0.328 n=6
Emit Time 2.71s (± 0.50%) 2.73s (± 0.68%) ~ 2.71s 2.75s p=0.360 n=6
Total Time 14.47s (± 0.24%) 14.52s (± 0.17%) ~ 14.50s 14.56s p=0.056 n=6
angular-1 - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 948,488 948,488 ~ ~ ~ p=1.000 n=6
Types 411,006 411,006 ~ ~ ~ p=1.000 n=6
Memory used 1,224,164k (± 0.00%) 1,224,229k (± 0.01%) ~ 1,224,056k 1,224,371k p=0.128 n=6
Parse Time 6.67s (± 0.43%) 6.61s (± 1.08%) ~ 6.50s 6.68s p=0.288 n=6
Bind Time 1.88s (± 0.55%) 1.88s (± 0.62%) ~ 1.87s 1.90s p=0.437 n=6
Check Time 31.86s (± 0.17%) 31.77s (± 0.29%) ~ 31.69s 31.94s p=0.092 n=6
Emit Time 15.25s (± 0.64%) 15.20s (± 0.23%) ~ 15.15s 15.24s p=0.422 n=6
Total Time 55.66s (± 0.20%) 55.46s (± 0.23%) -0.20s (- 0.35%) 55.23s 55.57s p=0.013 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,372,168 2,372,060 -108 (- 0.00%) ~ ~ p=0.001 n=6
Types 846,200 846,118 -82 (- 0.01%) ~ ~ p=0.001 n=6
Memory used 2,134,673k (± 0.00%) 2,134,978k (± 0.00%) +306k (+ 0.01%) 2,134,843k 2,135,116k p=0.005 n=6
Parse Time 7.26s (± 0.10%) 7.27s (± 0.11%) ~ 7.26s 7.28s p=0.383 n=6
Bind Time 2.46s (± 0.65%) 2.45s (± 0.45%) ~ 2.43s 2.46s p=0.301 n=6
Check Time 72.78s (± 0.32%) 73.00s (± 0.73%) ~ 72.29s 73.58s p=0.521 n=6
Emit Time 0.15s 0.15s ~ ~ ~ p=1.000 n=6
Total Time 82.65s (± 0.29%) 82.87s (± 0.64%) ~ 82.17s 83.44s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,511 1,228,511 ~ ~ ~ p=1.000 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,358,566k (± 0.01%) 2,358,757k (± 0.03%) ~ 2,357,795k 2,359,499k p=0.298 n=6
Parse Time 5.17s (± 0.72%) 5.20s (± 0.81%) ~ 5.14s 5.25s p=0.199 n=6
Bind Time 1.78s (± 1.26%) 1.79s (± 1.53%) ~ 1.76s 1.83s p=1.000 n=6
Check Time 35.20s (± 0.29%) 35.17s (± 0.29%) ~ 35.00s 35.31s p=0.378 n=6
Emit Time 2.98s (± 1.48%) 3.01s (± 0.82%) ~ 2.97s 3.04s p=0.467 n=6
Total Time 45.14s (± 0.22%) 45.17s (± 0.24%) ~ 44.97s 45.29s p=0.521 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,228,511 1,228,511 ~ ~ ~ p=1.000 n=6
Types 266,960 266,960 ~ ~ ~ p=1.000 n=6
Memory used 2,791,315k (±14.23%) 3,034,078k (± 9.74%) 🔻+242,764k (+ 8.70%) 2,429,932k 3,156,185k p=0.020 n=6
Parse Time 6.91s (± 1.49%) 6.99s (± 1.38%) ~ 6.83s 7.08s p=0.230 n=6
Bind Time 2.15s (± 2.27%) 2.15s (± 1.08%) ~ 2.11s 2.17s p=0.809 n=6
Check Time 42.73s (± 0.50%) 42.63s (± 0.41%) ~ 42.34s 42.83s p=0.575 n=6
Emit Time 3.52s (± 2.49%) 3.49s (± 1.06%) ~ 3.45s 3.55s p=0.810 n=6
Total Time 55.30s (± 0.44%) 55.26s (± 0.49%) ~ 54.81s 55.59s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,817 262,817 ~ ~ ~ p=1.000 n=6
Types 106,833 106,833 ~ ~ ~ p=1.000 n=6
Memory used 440,479k (± 0.03%) 440,489k (± 0.02%) ~ 440,381k 440,551k p=0.575 n=6
Parse Time 3.54s (± 0.46%) 3.55s (± 1.25%) ~ 3.51s 3.60s p=1.000 n=6
Bind Time 1.31s (± 1.12%) 1.31s (± 0.79%) ~ 1.30s 1.33s p=0.510 n=6
Check Time 18.86s (± 0.32%) 18.89s (± 0.38%) ~ 18.82s 19.02s p=0.520 n=6
Emit Time 1.53s (± 1.01%) 1.52s (± 0.77%) ~ 1.50s 1.53s p=0.459 n=6
Total Time 25.24s (± 0.36%) 25.28s (± 0.37%) ~ 25.19s 25.44s p=0.470 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 70 70 ~ ~ ~ p=1.000 n=6
Symbols 226,113 226,113 ~ ~ ~ p=1.000 n=6
Types 94,488 94,488 ~ ~ ~ p=1.000 n=6
Memory used 371,323k (± 0.02%) 371,364k (± 0.05%) ~ 371,238k 371,739k p=0.936 n=6
Parse Time 2.91s (± 0.56%) 2.85s (± 1.34%) ~ 2.83s 2.93s p=0.053 n=6
Bind Time 1.59s (± 0.76%) 1.58s (± 0.65%) -0.02s (- 1.05%) 1.56s 1.59s p=0.046 n=6
Check Time 16.45s (± 0.20%) 16.46s (± 0.24%) ~ 16.42s 16.53s p=0.809 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 20.95s (± 0.24%) 20.89s (± 0.20%) -0.06s (- 0.29%) 20.85s 20.95s p=0.045 n=6
vscode - node (v18.15.0, x64)
Errors 3 3 ~ ~ ~ p=1.000 n=6
Symbols 3,216,500 3,216,500 ~ ~ ~ p=1.000 n=6
Types 1,091,108 1,091,108 ~ ~ ~ p=1.000 n=6
Memory used 3,289,869k (± 0.00%) 3,289,789k (± 0.01%) ~ 3,289,519k 3,290,002k p=0.575 n=6
Parse Time 14.24s (± 0.64%) 14.29s (± 0.70%) ~ 14.22s 14.49s p=0.377 n=6
Bind Time 4.58s (± 0.60%) 4.58s (± 0.51%) ~ 4.54s 4.61s p=0.805 n=6
Check Time 89.24s (± 1.62%) 89.20s (± 2.07%) ~ 87.21s 91.91s p=0.936 n=6
Emit Time 25.21s (±10.08%) 25.26s (± 9.40%) ~ 22.84s 27.58s p=0.873 n=6
Total Time 133.27s (± 1.98%) 133.33s (± 2.75%) ~ 130.08s 138.36s p=1.000 n=6
webpack - node (v18.15.0, x64)
Errors 0 2 🔻+2 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 293,866 293,866 ~ ~ ~ p=1.000 n=6
Types 119,615 119,626 +11 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 447,150k (± 0.02%) 447,165k (± 0.02%) ~ 447,045k 447,240k p=0.688 n=6
Parse Time 4.10s (± 0.62%) 4.09s (± 1.50%) ~ 4.01s 4.18s p=0.686 n=6
Bind Time 1.77s (± 1.31%) 1.76s (± 0.86%) ~ 1.75s 1.79s p=0.935 n=6
Check Time 18.67s (± 0.54%) 18.82s (± 0.34%) +0.14s (+ 0.78%) 18.72s 18.91s p=0.016 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.54s (± 0.42%) 24.67s (± 0.27%) ~ 24.59s 24.75s p=0.054 n=6
xstate-main - node (v18.15.0, x64)
Errors 5 5 ~ ~ ~ p=1.000 n=6
Symbols 558,084 558,084 ~ ~ ~ p=1.000 n=6
Types 186,415 186,415 ~ ~ ~ p=1.000 n=6
Memory used 495,065k (± 0.01%) 495,080k (± 0.03%) ~ 494,791k 495,239k p=0.336 n=6
Parse Time 3.40s (± 0.44%) 3.40s (± 1.19%) ~ 3.36s 3.46s p=0.467 n=6
Bind Time 1.19s (± 0.83%) 1.20s (± 0.43%) ~ 1.19s 1.20s p=0.140 n=6
Check Time 19.56s (± 0.27%) 19.65s (± 1.42%) ~ 19.41s 20.20s p=1.000 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.15s (± 0.22%) 24.24s (± 1.22%) ~ 24.06s 24.84s p=0.810 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/56907/merge:

Everything looks good!

@Andarist
Copy link
Contributor Author

The webpack break above is correct in a sense that it brings the JS behavior closer to the TS behavior:

  1. TS playground - it has 2 errors
  2. JS playground - it currently has no errors

@jakebailey jakebailey merged commit 71b16ea into microsoft:main Feb 20, 2025
32 checks passed
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
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Using @satisfies tag in JSDoc has strange effects on arrow function parameters
4 participants