Skip to content

consistently check expressions with >, >=, <, <= for unconstrained types in strictNullChecks #59352

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

iisaduan
Copy link
Member

@iisaduan iisaduan commented Jul 19, 2024

fixes #50603, which bisected to #49119

Previously: unconstrained type parameters were inconsistently checked in comparisons, as shown below (5.5.3 playground):

function f<T>(a: T, b: T) {
   return a > b; \\ okay
}

function g<T extends {} | undefined | null>(a: T, b: T) {
   return a > b; \\ error!! 
      \\ 'a' is possibly 'null' or 'undefined'.ts(18049)
      \\ 'b' is possibly 'null' or 'undefined'.ts(18049)
}

Now with this PR:

    function f1<T>(a: T, b: T): boolean {
        return a > b;
               ~
!!! error TS18046: 'a' is of type 'unknown'.
                   ~
!!! error TS18046: 'b' is of type 'unknown'.
    }
    
    function f2<T extends {} | undefined | null>(a: T, b: T): boolean {
        return a > b;
               ~
!!! error TS18049: 'a' is possibly 'null' or 'undefined'.
                   ~
!!! error TS18049: 'b' is possibly 'null' or 'undefined'.
    }    

This PR does not affect the checking of unconstrained types in other locations.

@iisaduan iisaduan marked this pull request as ready for review July 19, 2024 03:34
@iisaduan
Copy link
Member Author

@typescript-bot test it
@typescript-bot pack this

@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
pack this ✅ Started ✅ 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

typescript-bot commented Jul 19, 2024

Hey @iisaduan, 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/162857/artifacts?artifactName=tgz&fileId=44CAF8D1A815E861B024867349A1BA4D64F7A3FF9ADC7FD310912E8F233464F902&fileName=/typescript-5.6.0-insiders.20240719.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

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

@iisaduan
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 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 192,883k (± 0.75%) 192,382k (± 0.10%) ~ 192,239k 192,624k p=0.689 n=6
Parse Time 1.29s (± 0.90%) 1.30s (± 0.80%) ~ 1.29s 1.32s p=0.085 n=6
Bind Time 0.71s 0.71s ~ ~ ~ p=1.000 n=6
Check Time 9.54s (± 0.45%) 9.50s (± 0.48%) ~ 9.43s 9.55s p=0.170 n=6
Emit Time 2.76s (± 0.55%) 2.75s (± 0.68%) ~ 2.73s 2.77s p=0.933 n=6
Total Time 14.30s (± 0.35%) 14.27s (± 0.35%) ~ 14.21s 14.35s p=0.336 n=6
angular-1 - node (v18.15.0, x64)
Errors 5 15 🔻+10 (+200.00%) ~ ~ p=0.001 n=6
Symbols 944,250 944,250 ~ ~ ~ p=1.000 n=6
Types 407,076 407,076 ~ ~ ~ p=1.000 n=6
Memory used 1,218,709k (± 0.00%) 1,218,714k (± 0.00%) ~ 1,218,661k 1,218,766k p=0.810 n=6
Parse Time 6.72s (± 0.64%) 6.69s (± 0.55%) ~ 6.63s 6.73s p=0.227 n=6
Bind Time 1.87s (± 0.83%) 1.87s (± 0.79%) ~ 1.85s 1.88s p=0.784 n=6
Check Time 31.01s (± 0.17%) 31.01s (± 0.38%) ~ 30.91s 31.23s p=0.574 n=6
Emit Time 15.02s (± 0.71%) 14.96s (± 0.17%) ~ 14.93s 15.01s p=0.288 n=6
Total Time 54.61s (± 0.17%) 54.53s (± 0.21%) ~ 54.40s 54.71s p=0.230 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 16 🔻+16 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 2,276,156 2,276,156 ~ ~ ~ p=1.000 n=6
Types 948,845 948,825 -20 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,207,610k (± 0.00%) 2,207,609k (± 0.00%) ~ 2,207,577k 2,207,642k p=1.000 n=6
Parse Time 6.61s (± 0.18%) 6.60s (± 0.25%) ~ 6.58s 6.62s p=0.103 n=6
Bind Time 2.33s (± 0.22%) 2.33s (± 0.35%) ~ 2.32s 2.34s p=0.929 n=6
Check Time 73.08s (± 0.37%) 73.12s (± 0.29%) ~ 72.75s 73.32s p=0.872 n=6
Emit Time 0.14s 0.14s (± 6.38%) ~ 0.13s 0.15s p=1.000 n=6
Total Time 82.17s (± 0.33%) 82.19s (± 0.26%) ~ 81.82s 82.37s p=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,227,332 1,227,334 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 261,851 261,852 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,341,654k (± 0.02%) 2,341,474k (± 0.02%) ~ 2,340,763k 2,342,012k p=0.471 n=6
Parse Time 5.10s (± 0.55%) 5.12s (± 0.85%) ~ 5.06s 5.17s p=0.471 n=6
Bind Time 1.90s (± 0.43%) 1.91s (± 1.03%) ~ 1.88s 1.93s p=0.744 n=6
Check Time 34.39s (± 0.38%) 34.57s (± 0.11%) +0.18s (+ 0.51%) 34.53s 34.62s p=0.013 n=6
Emit Time 3.29s (± 2.35%) 3.32s (± 2.44%) ~ 3.22s 3.40s p=0.470 n=6
Total Time 44.69s (± 0.15%) 44.91s (± 0.11%) +0.23s (+ 0.51%) 44.85s 44.98s p=0.005 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,227,334 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 261,851 261,852 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,475,459k (± 5.82%) 2,534,670k (±11.36%) ~ 2,416,382k 3,123,003k p=0.378 n=6
Parse Time 7.85s (± 0.77%) 7.88s (± 0.74%) ~ 7.82s 7.98s p=0.688 n=6
Bind Time 2.50s (± 0.73%) 2.50s (± 1.29%) ~ 2.46s 2.54s p=1.000 n=6
Check Time 50.57s (± 0.65%) 50.75s (± 0.67%) ~ 50.50s 51.42s p=0.936 n=6
Emit Time 4.87s (± 2.12%) 4.87s (± 1.08%) ~ 4.80s 4.93s p=0.936 n=6
Total Time 65.81s (± 0.58%) 66.01s (± 0.63%) ~ 65.69s 66.83s p=1.000 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,516 258,518 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 104,901 104,902 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 427,933k (± 0.02%) 427,880k (± 0.03%) ~ 427,778k 428,078k p=0.298 n=6
Parse Time 4.15s (± 0.30%) 4.15s (± 0.33%) ~ 4.13s 4.17s p=0.547 n=6
Bind Time 1.63s (± 1.44%) 1.62s (± 1.20%) ~ 1.60s 1.65s p=0.405 n=6
Check Time 22.15s (± 0.44%) 22.23s (± 0.40%) ~ 22.10s 22.38s p=0.170 n=6
Emit Time 2.01s (± 1.03%) 2.01s (± 0.83%) ~ 1.99s 2.03s p=1.000 n=6
Total Time 29.94s (± 0.23%) 30.01s (± 0.28%) ~ 29.88s 30.14s p=0.149 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,565 224,565 ~ ~ ~ p=1.000 n=6
Types 93,734 93,734 ~ ~ ~ p=1.000 n=6
Memory used 369,623k (± 0.02%) 369,740k (± 0.03%) ~ 369,571k 369,882k p=0.128 n=6
Parse Time 3.45s (± 0.59%) 3.45s (± 0.90%) ~ 3.42s 3.50s p=0.808 n=6
Bind Time 1.93s (± 0.78%) 1.94s (± 0.65%) ~ 1.92s 1.95s p=0.134 n=6
Check Time 19.33s (± 0.38%) 19.36s (± 0.23%) ~ 19.30s 19.41s p=0.336 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.71s (± 0.25%) 24.75s (± 0.31%) ~ 24.64s 24.84s p=0.298 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,973,126 2,973,126 ~ ~ ~ p=1.000 n=6
Types 1,021,075 1,021,075 ~ ~ ~ p=1.000 n=6
Memory used 3,097,512k (± 0.00%) 3,097,551k (± 0.00%) ~ 3,097,468k 3,097,652k p=0.575 n=6
Parse Time 13.93s (± 0.27%) 13.89s (± 0.33%) ~ 13.83s 13.95s p=0.127 n=6
Bind Time 4.44s (± 2.10%) 4.39s (± 2.95%) ~ 4.27s 4.53s p=1.000 n=6
Check Time 79.00s (± 0.23%) 79.20s (± 0.30%) ~ 78.92s 79.49s p=0.261 n=6
Emit Time 20.31s (± 0.42%) 20.35s (± 0.85%) ~ 20.15s 20.65s p=0.630 n=6
Total Time 117.68s (± 0.21%) 117.83s (± 0.29%) ~ 117.25s 118.28s p=0.378 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,370 267,370 ~ ~ ~ p=1.000 n=6
Types 108,862 108,862 ~ ~ ~ p=1.000 n=6
Memory used 411,941k (± 0.02%) 411,946k (± 0.02%) ~ 411,871k 412,054k p=0.936 n=6
Parse Time 4.74s (± 0.68%) 4.76s (± 0.39%) ~ 4.72s 4.77s p=0.357 n=6
Bind Time 2.09s (± 0.78%) 2.08s (± 0.39%) ~ 2.08s 2.10s p=0.227 n=6
Check Time 20.82s (± 0.24%) 20.89s (± 0.40%) ~ 20.79s 21.00s p=0.199 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 27.65s (± 0.24%) 27.73s (± 0.36%) ~ 27.63s 27.87s p=0.173 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 510,573 510,573 ~ ~ ~ p=1.000 n=6
Types 161,621 161,621 ~ ~ ~ p=1.000 n=6
Memory used 448,203k (± 0.09%) 448,328k (± 0.08%) ~ 447,792k 448,626k p=0.748 n=6
Parse Time 3.16s (± 0.74%) 3.17s (± 0.94%) ~ 3.13s 3.20s p=0.514 n=6
Bind Time 1.18s (± 1.25%) 1.17s (± 0.44%) ~ 1.16s 1.17s p=0.210 n=6
Check Time 17.16s (± 0.45%) 17.18s (± 0.45%) ~ 17.05s 17.29s p=0.748 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 21.49s (± 0.38%) 21.52s (± 0.50%) ~ 21.35s 21.66s p=0.872 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

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

Something interesting changed - please have a look.

Details

ag-grid/ag-grid

31 of 110 projects failed to build with the old tsc and were ignored

enterprise-modules/viewport-row-model/tsconfig.watch.json

enterprise-modules/viewport-row-model/tsconfig.types.watch.json

enterprise-modules/status-bar/tsconfig.watch.json

enterprise-modules/status-bar/tsconfig.types.watch.json

enterprise-modules/sparklines/tsconfig.watch.json

enterprise-modules/sparklines/tsconfig.types.watch.json

enterprise-modules/side-bar/tsconfig.watch.json

enterprise-modules/side-bar/tsconfig.types.watch.json

enterprise-modules/set-filter/tsconfig.watch.json

enterprise-modules/set-filter/tsconfig.types.watch.json

enterprise-modules/server-side-row-model/tsconfig.watch.json

enterprise-modules/server-side-row-model/tsconfig.types.watch.json

enterprise-modules/row-grouping/tsconfig.watch.json

enterprise-modules/row-grouping/tsconfig.types.watch.json

enterprise-modules/rich-select/tsconfig.watch.json

enterprise-modules/rich-select/tsconfig.types.watch.json

enterprise-modules/range-selection/tsconfig.watch.json

enterprise-modules/range-selection/tsconfig.types.watch.json

enterprise-modules/multi-filter/tsconfig.watch.json

enterprise-modules/multi-filter/tsconfig.types.watch.json

enterprise-modules/master-detail/tsconfig.watch.json

enterprise-modules/master-detail/tsconfig.types.watch.json

enterprise-modules/filter-tool-panel/tsconfig.watch.json

enterprise-modules/filter-tool-panel/tsconfig.types.watch.json

enterprise-modules/core/tsconfig.watch.json

enterprise-modules/core/tsconfig.types.watch.json

enterprise-modules/advanced-filter/tsconfig.watch.json

enterprise-modules/advanced-filter/tsconfig.types.watch.json

community-modules/vue3/tsconfig.watch.json

community-modules/vue3/tsconfig.types.watch.json

community-modules/infinite-row-model/tsconfig.watch.json

community-modules/infinite-row-model/tsconfig.types.watch.json

community-modules/csv-export/tsconfig.watch.json

community-modules/csv-export/tsconfig.types.watch.json

community-modules/core/tsconfig.watch.json

community-modules/core/tsconfig.types.watch.json

community-modules/client-side-row-model/tsconfig.watch.json

community-modules/client-side-row-model/tsconfig.types.watch.json

compiler-explorer/compiler-explorer

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

tsconfig.tests.json

tsconfig.json

static/tsconfig.json

desktop/desktop

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

tsconfig.json

discordjs/discord.js

39 of 62 projects failed to build with the old tsc and were ignored

packages/collection/tsconfig.json

packages/collection/tsconfig.eslint.json

packages/collection/tsconfig.docs.json

mui/material-ui

29 of 81 projects failed to build with the old tsc and were ignored

docs/tsconfig.json

sequelize/sequelize

13 of 16 projects failed to build with the old tsc and were ignored

packages/utils/tsconfig.json

@iisaduan iisaduan changed the title consistently check for >, >=, <, <= for unconstrained types with strictNullChecks consistently check expressions with >, >=, <, <= for unconstrained types with strictNullChecks Jul 19, 2024
@iisaduan iisaduan changed the title consistently check expressions with >, >=, <, <= for unconstrained types with strictNullChecks consistently check expressions with >, >=, <, <= for unconstrained types in strictNullChecks Jul 19, 2024
@@ -27493,6 +27493,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return type === unknownUnionType ? unknownType : type;
}

// use to determine if a parameter may be undefined or null (or is unknown/unconstrained)
function getUnknownIfMaybeUnknown(type: Type) {
return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type;
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming from #59059 that making this change to getTypeFacts breaks a lot of existing code, is that right?

Also, does making this change to checkNonNullType instead also break a lot of code?

Copy link
Member Author

@iisaduan iisaduan Jul 19, 2024

Choose a reason for hiding this comment

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

Yes, I tried that and putting this change directly into checkNonNullType gets a very similar result to #59059 in terms of breaking object index checking

Copy link
Member Author

Choose a reason for hiding this comment

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

A lot of the cases that break relate to this type of index access #59059 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

I don't know if this it's noticeably different in semantics, but istead of doing this, you might want to try to modify getBaseTypeOfLiteralTypeForComparison and rename it getBaseTypeForComparison. Then pass the result of that into checkNonNullType.

Copy link
Member

Choose a reason for hiding this comment

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

I would also consider renaming this to getBaseConstraintOrUnknown, use ?? instead of ||, and just get rid of the strictNullChecks check.

Copy link
Member

Choose a reason for hiding this comment

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

Also - any clue if this works on unions of unconstrained type parameters? Can you add a test?

function f<T, U>(x: T | U, y: T | U) {
  return x < y;
}

gabritto
gabritto previously approved these changes Jul 19, 2024
@DanielRosenwasser
Copy link
Member

Checking this

@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 20, 2024

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

Command Status Results
perf test this ✅ Started 👀 Results

@@ -27493,6 +27493,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return type === unknownUnionType ? unknownType : type;
}

// use to determine if a parameter may be undefined or null (or is unknown/unconstrained)
function getUnknownIfMaybeUnknown(type: Type) {
return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type;
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if this it's noticeably different in semantics, but istead of doing this, you might want to try to modify getBaseTypeOfLiteralTypeForComparison and rename it getBaseTypeForComparison. Then pass the result of that into checkNonNullType.

@@ -27493,6 +27493,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return type === unknownUnionType ? unknownType : type;
}

// use to determine if a parameter may be undefined or null (or is unknown/unconstrained)
function getUnknownIfMaybeUnknown(type: Type) {
return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type;
Copy link
Member

Choose a reason for hiding this comment

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

I would also consider renaming this to getBaseConstraintOrUnknown, use ?? instead of ||, and just get rid of the strictNullChecks check.

@@ -27493,6 +27493,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return type === unknownUnionType ? unknownType : type;
}

// use to determine if a parameter may be undefined or null (or is unknown/unconstrained)
function getUnknownIfMaybeUnknown(type: Type) {
return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type;
Copy link
Member

Choose a reason for hiding this comment

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

Also - any clue if this works on unions of unconstrained type parameters? Can you add a test?

function f<T, U>(x: T | U, y: T | U) {
  return x < y;
}

@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 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 193,514k (± 0.93%) 194,037k (± 1.04%) ~ 191,979k 195,930k p=0.575 n=6
Parse Time 1.95s (± 0.50%) 1.96s (± 1.05%) ~ 1.93s 1.99s p=0.869 n=6
Bind Time 1.06s (± 1.73%) 1.05s (± 0.72%) ~ 1.04s 1.06s p=0.367 n=6
Check Time 13.96s (± 0.60%) 13.98s (± 0.58%) ~ 13.86s 14.09s p=0.747 n=6
Emit Time 3.99s (± 1.06%) 4.08s (± 4.18%) ~ 3.92s 4.41s p=0.296 n=6
Total Time 20.97s (± 0.46%) 21.06s (± 0.68%) ~ 20.92s 21.32s p=0.468 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 17 🔻+10 (+142.86%) ~ ~ p=0.001 n=6
Symbols 945,532 945,532 ~ ~ ~ p=1.000 n=6
Types 409,507 409,507 ~ ~ ~ p=1.000 n=6
Memory used 1,221,076k (± 0.00%) 1,221,066k (± 0.00%) ~ 1,220,987k 1,221,112k p=1.000 n=6
Parse Time 7.84s (± 0.44%) 7.88s (± 0.54%) ~ 7.82s 7.93s p=0.173 n=6
Bind Time 2.22s (± 1.54%) 2.21s (± 0.62%) ~ 2.19s 2.23s p=0.455 n=6
Check Time 36.36s (± 0.41%) 36.36s (± 0.34%) ~ 36.20s 36.56s p=0.688 n=6
Emit Time 17.83s (± 0.57%) 17.90s (± 0.97%) ~ 17.72s 18.14s p=0.575 n=6
Total Time 64.26s (± 0.38%) 64.34s (± 0.29%) ~ 64.08s 64.57s p=0.689 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 16 🔻+16 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 2,276,293 2,276,293 ~ ~ ~ p=1.000 n=6
Types 949,028 949,008 -20 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,208,070k (± 0.00%) 2,208,060k (± 0.00%) ~ 2,207,931k 2,208,140k p=0.689 n=6
Parse Time 9.64s (± 0.36%) 9.67s (± 0.42%) ~ 9.62s 9.73s p=0.295 n=6
Bind Time 3.36s (± 0.69%) 3.37s (± 1.46%) ~ 3.30s 3.45s p=0.686 n=6
Check Time 105.65s (± 0.50%) 105.04s (± 1.44%) ~ 101.99s 106.12s p=0.471 n=6
Emit Time 0.21s (± 4.71%) 0.21s (± 3.95%) ~ 0.20s 0.22s p=0.862 n=6
Total Time 118.86s (± 0.47%) 118.27s (± 1.26%) ~ 115.27s 119.32s p=0.575 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,230,400 1,230,402 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,743 265,744 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,348,382k (± 0.03%) 2,347,304k (± 0.03%) -1,079k (- 0.05%) 2,346,190k 2,348,045k p=0.020 n=6
Parse Time 7.57s (± 0.92%) 7.54s (± 0.73%) ~ 7.47s 7.63s p=0.575 n=6
Bind Time 2.80s (± 0.54%) 2.79s (± 0.53%) ~ 2.77s 2.80s p=0.296 n=6
Check Time 50.24s (± 0.30%) 50.37s (± 0.75%) ~ 49.98s 51.02s p=0.689 n=6
Emit Time 4.86s (± 3.31%) 4.93s (± 2.34%) ~ 4.80s 5.11s p=0.378 n=6
Total Time 65.48s (± 0.28%) 65.63s (± 0.67%) ~ 65.13s 66.43s p=0.470 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,230,400 1,230,402 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 265,743 265,744 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,420,996k (± 0.02%) 2,420,837k (± 0.01%) ~ 2,420,310k 2,421,277k p=0.471 n=6
Parse Time 5.28s (± 0.82%) 5.31s (± 0.30%) ~ 5.30s 5.34s p=0.261 n=6
Bind Time 1.70s (± 0.32%) 1.69s (± 0.61%) ~ 1.68s 1.70s p=0.147 n=6
Check Time 35.09s (± 0.37%) 35.09s (± 0.17%) ~ 35.03s 35.20s p=0.936 n=6
Emit Time 3.38s (± 1.88%) 3.39s (± 1.09%) ~ 3.36s 3.45s p=1.000 n=6
Total Time 45.43s (± 0.25%) 45.47s (± 0.09%) ~ 45.41s 45.54s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 258,792 258,794 +2 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,554 105,555 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 428,546k (± 0.03%) 428,566k (± 0.02%) ~ 428,464k 428,718k p=0.689 n=6
Parse Time 3.35s (± 0.76%) 3.36s (± 0.77%) ~ 3.32s 3.39s p=0.627 n=6
Bind Time 1.32s (± 0.57%) 1.32s (± 1.33%) ~ 1.29s 1.34s p=0.196 n=6
Check Time 18.03s (± 0.55%) 18.05s (± 0.43%) ~ 17.93s 18.17s p=0.936 n=6
Emit Time 1.65s (± 1.07%) 1.64s (± 0.86%) ~ 1.62s 1.66s p=0.677 n=6
Total Time 24.35s (± 0.40%) 24.37s (± 0.38%) ~ 24.27s 24.52s p=0.810 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,931 224,931 ~ ~ ~ p=1.000 n=6
Types 94,146 94,146 ~ ~ ~ p=1.000 n=6
Memory used 370,029k (± 0.04%) 370,082k (± 0.05%) ~ 369,841k 370,313k p=0.575 n=6
Parse Time 3.45s (± 1.24%) 3.43s (± 0.40%) ~ 3.42s 3.45s p=0.568 n=6
Bind Time 1.91s (± 1.07%) 1.91s (± 0.61%) ~ 1.90s 1.93s p=1.000 n=6
Check Time 19.24s (± 0.53%) 19.29s (± 0.19%) ~ 19.24s 19.34s p=0.126 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.61s (± 0.58%) 24.64s (± 0.16%) ~ 24.60s 24.71s p=0.334 n=6
vscode - node (v18.15.0, x64)
Errors 4 4 ~ ~ ~ p=1.000 n=6
Symbols 2,978,923 2,978,923 ~ ~ ~ p=1.000 n=6
Types 1,024,932 1,024,932 ~ ~ ~ p=1.000 n=6
Memory used 3,104,101k (± 0.00%) 3,104,077k (± 0.00%) ~ 3,104,022k 3,104,106k p=0.630 n=6
Parse Time 13.92s (± 0.31%) 13.89s (± 0.34%) ~ 13.82s 13.95s p=0.332 n=6
Bind Time 4.29s (± 0.28%) 4.30s (± 0.35%) ~ 4.27s 4.31s p=0.218 n=6
Check Time 79.32s (± 0.33%) 79.13s (± 0.30%) ~ 78.71s 79.36s p=0.810 n=6
Emit Time 20.54s (± 0.57%) 20.49s (± 0.29%) ~ 20.44s 20.60s p=0.376 n=6
Total Time 118.07s (± 0.19%) 117.80s (± 0.15%) -0.27s (- 0.23%) 117.54s 118.01s p=0.045 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,602 267,602 ~ ~ ~ p=1.000 n=6
Types 109,105 109,105 ~ ~ ~ p=1.000 n=6
Memory used 412,322k (± 0.01%) 412,295k (± 0.02%) ~ 412,176k 412,391k p=0.689 n=6
Parse Time 3.83s (± 0.54%) 3.83s (± 0.39%) ~ 3.82s 3.86s p=1.000 n=6
Bind Time 1.71s (± 0.48%) 1.71s (± 1.02%) ~ 1.68s 1.73s p=0.605 n=6
Check Time 16.80s (± 0.30%) 16.77s (± 0.44%) ~ 16.68s 16.86s p=0.421 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.34s (± 0.28%) 22.32s (± 0.34%) ~ 22.22s 22.41s p=0.470 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 511,803 511,803 ~ ~ ~ p=1.000 n=6
Types 162,088 162,088 ~ ~ ~ p=1.000 n=6
Memory used 449,026k (± 0.07%) 449,068k (± 0.08%) ~ 448,602k 449,376k p=0.810 n=6
Parse Time 3.89s (± 0.32%) 3.91s (± 0.86%) ~ 3.88s 3.97s p=0.250 n=6
Bind Time 1.44s (± 1.04%) 1.44s (± 0.81%) ~ 1.42s 1.45s p=0.616 n=6
Check Time 21.23s (± 0.16%) 21.27s (± 0.44%) ~ 21.14s 21.36s p=0.810 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.56s (± 0.15%) 26.61s (± 0.38%) ~ 26.46s 26.72s p=0.261 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

tsserver

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 2,758ms (± 1.21%) 2,878ms (± 9.31%) ~ 2,757ms 3,425ms p=0.470 n=6
Req 2 - geterr 6,822ms (±10.70%) 7,056ms (± 9.52%) ~ 6,172ms 7,602ms p=0.575 n=6
Req 3 - references 368ms (±10.59%) 392ms (± 0.25%) ~ 391ms 393ms p=1.000 n=6
Req 4 - navto 339ms (± 0.12%) 339ms (± 0.69%) ~ 334ms 340ms p=0.546 n=6
Req 5 - completionInfo count 1,357 1,357 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 128ms (± 7.04%) 127ms (± 5.80%) ~ 121ms 136ms p=0.570 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen 3,573ms (± 0.97%) 3,577ms (± 0.88%) ~ 3,515ms 3,602ms p=1.000 n=6
Req 2 - geterr 5,687ms (± 0.52%) 5,677ms (± 0.45%) ~ 5,645ms 5,718ms p=0.575 n=6
Req 3 - references 413ms (± 1.13%) 409ms (± 1.51%) ~ 400ms 419ms p=0.328 n=6
Req 4 - navto 341ms (± 1.59%) 342ms (± 2.76%) ~ 336ms 361ms p=1.000 n=6
Req 5 - completionInfo count 1,519 1,519 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 124ms (± 0.66%) 117ms (± 8.98%) ~ 100ms 125ms p=0.402 n=6
xstate-main-1-tsserver - node (v18.15.0, x64)
Req 1 - updateOpen 6,352ms (± 4.95%) 6,474ms (± 6.06%) ~ 6,201ms 7,006ms p=0.689 n=6
Req 2 - geterr 1,664ms (± 0.98%) 1,493ms (±12.49%) ~ 1,307ms 1,691ms p=0.149 n=6
Req 3 - references 127ms (± 5.01%) 126ms (± 9.18%) ~ 103ms 134ms p=0.560 n=6
Req 4 - navto 597ms (± 1.59%) 605ms (± 0.93%) ~ 600ms 616ms p=0.077 n=6
Req 5 - completionInfo count 3,417 3,417 ~ ~ ~ p=1.000 n=6
Req 5 - completionInfo 1,243ms (± 1.30%) 1,240ms (± 1.71%) ~ 1,198ms 1,255ms p=0.748 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)
  • xstate-main-1-tsserver - 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 190.28ms (± 0.16%) 190.25ms (± 0.18%) ~ 188.48ms 195.26ms p=0.109 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time 346.36ms (± 0.28%) 346.16ms (± 0.29%) -0.20ms (- 0.06%) 337.79ms 353.31ms p=0.002 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time 277.64ms (± 0.28%) 277.76ms (± 0.28%) +0.12ms (+ 0.04%) 270.74ms 282.26ms p=0.000 n=600
typescript-startup - node (v18.15.0, x64)
Execution time 278.33ms (± 0.29%) 278.13ms (± 0.28%) -0.20ms (- 0.07%) 271.29ms 284.76ms p=0.000 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

@iisaduan
Copy link
Member Author

@DanielRosenwasser Thanks for the suggestions! Good catch--it does work for unions but not intersections, so I added those cases as well.

@gabritto
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 23, 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

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

Everything looks good!

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@gabritto
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 62,153 ~ ~ ~ p=1.000 n=6
Types 50,242 50,242 ~ ~ ~ p=1.000 n=6
Memory used 192,300k (± 0.01%) 192,912k (± 0.73%) +612k (+ 0.32%) 192,286k 195,807k p=0.045 n=6
Parse Time 1.57s (± 0.96%) 1.57s (± 1.04%) ~ 1.55s 1.59s p=0.801 n=6
Bind Time 0.86s (± 1.04%) 0.86s (± 1.40%) ~ 0.85s 0.88s p=0.676 n=6
Check Time 11.35s (± 0.51%) 11.37s (± 0.73%) ~ 11.27s 11.47s p=0.467 n=6
Emit Time 3.27s (± 0.46%) 3.28s (± 0.92%) ~ 3.25s 3.33s p=1.000 n=6
Total Time 17.05s (± 0.37%) 17.09s (± 0.63%) ~ 16.96s 17.20s p=0.378 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 17 🔻+10 (+142.86%) ~ ~ p=0.001 n=6
Symbols 945,532 945,532 ~ ~ ~ p=1.000 n=6
Types 409,507 409,507 ~ ~ ~ p=1.000 n=6
Memory used 1,221,136k (± 0.01%) 1,221,123k (± 0.00%) ~ 1,221,042k 1,221,176k p=0.470 n=6
Parse Time 6.59s (± 0.86%) 6.62s (± 0.15%) ~ 6.60s 6.63s p=0.370 n=6
Bind Time 1.85s (± 0.41%) 1.85s (± 0.59%) ~ 1.83s 1.86s p=1.000 n=6
Check Time 31.01s (± 0.15%) 31.08s (± 0.24%) ~ 30.99s 31.21s p=0.077 n=6
Emit Time 15.02s (± 0.53%) 15.08s (± 0.44%) ~ 15.01s 15.18s p=0.377 n=6
Total Time 54.48s (± 0.24%) 54.63s (± 0.23%) ~ 54.54s 54.87s p=0.128 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 16 🔻+16 (+ ∞%) ~ ~ p=0.001 n=6
Symbols 2,276,404 2,276,404 ~ ~ ~ p=1.000 n=6
Types 949,156 949,136 -20 (- 0.00%) ~ ~ p=0.001 n=6
Memory used 2,208,290k (± 0.00%) 2,208,352k (± 0.00%) ~ 2,208,292k 2,208,411k p=0.054 n=6
Parse Time 6.60s (± 0.34%) 6.59s (± 0.32%) ~ 6.55s 6.61s p=1.000 n=6
Bind Time 2.32s (± 0.32%) 2.32s (± 0.39%) ~ 2.31s 2.33s p=0.798 n=6
Check Time 72.84s (± 0.16%) 72.84s (± 0.27%) ~ 72.58s 73.06s p=0.809 n=6
Emit Time 0.14s (± 5.31%) 0.14s (± 2.95%) ~ 0.13s 0.14s p=0.389 n=6
Total Time 81.90s (± 0.15%) 81.89s (± 0.27%) ~ 81.58s 82.11s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,067 1,231,070 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,104 266,105 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,349,063k (± 0.02%) 2,407,907k (± 6.03%) ~ 2,347,883k 2,704,372k p=0.575 n=6
Parse Time 5.09s (± 1.07%) 5.08s (± 1.40%) ~ 4.99s 5.15s p=0.520 n=6
Bind Time 1.91s (± 0.54%) 1.89s (± 0.65%) -0.02s (- 1.14%) 1.86s 1.89s p=0.010 n=6
Check Time 34.75s (± 0.61%) 34.64s (± 0.72%) ~ 34.20s 34.88s p=0.630 n=6
Emit Time 3.29s (± 1.99%) 3.28s (± 1.90%) ~ 3.21s 3.38s p=0.936 n=6
Total Time 45.04s (± 0.56%) 44.90s (± 0.55%) ~ 44.49s 45.17s p=0.575 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,067 1,231,070 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 266,104 266,105 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,422,907k (± 0.02%) 2,423,044k (± 0.02%) ~ 2,422,530k 2,423,663k p=0.810 n=6
Parse Time 6.34s (± 0.85%) 6.30s (± 0.52%) ~ 6.26s 6.34s p=0.230 n=6
Bind Time 2.04s (± 0.90%) 2.04s (± 0.31%) ~ 2.03s 2.05s p=0.627 n=6
Check Time 41.36s (± 0.30%) 41.39s (± 0.24%) ~ 41.24s 41.48s p=0.748 n=6
Emit Time 4.03s (± 1.22%) 3.96s (± 1.01%) -0.07s (- 1.65%) 3.89s 4.01s p=0.013 n=6
Total Time 53.78s (± 0.33%) 53.70s (± 0.23%) ~ 53.55s 53.82s p=0.128 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 259,215 259,218 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,867 105,868 +1 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 429,634k (± 0.03%) 429,611k (± 0.02%) ~ 429,570k 429,742k p=0.936 n=6
Parse Time 3.35s (± 0.53%) 3.36s (± 0.59%) ~ 3.34s 3.39s p=0.871 n=6
Bind Time 1.32s (± 1.24%) 1.33s (± 0.91%) ~ 1.31s 1.34s p=0.300 n=6
Check Time 18.09s (± 0.30%) 18.11s (± 0.17%) ~ 18.07s 18.15s p=0.520 n=6
Emit Time 1.62s (± 1.89%) 1.64s (± 0.51%) ~ 1.62s 1.64s p=0.452 n=6
Total Time 24.39s (± 0.30%) 24.44s (± 0.18%) ~ 24.39s 24.50s p=0.296 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 224,931 224,931 ~ ~ ~ p=1.000 n=6
Types 94,146 94,146 ~ ~ ~ p=1.000 n=6
Memory used 370,151k (± 0.03%) 370,137k (± 0.01%) ~ 370,069k 370,204k p=0.575 n=6
Parse Time 2.75s (± 1.08%) 2.76s (± 0.53%) ~ 2.74s 2.78s p=0.870 n=6
Bind Time 1.58s (± 1.06%) 1.58s (± 1.18%) ~ 1.56s 1.61s p=0.681 n=6
Check Time 15.66s (± 0.19%) 15.62s (± 0.16%) -0.04s (- 0.24%) 15.58s 15.64s p=0.028 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.99s (± 0.16%) 19.96s (± 0.07%) ~ 19.94s 19.97s p=0.062 n=6
vscode - node (v18.15.0, x64)
Errors 11 11 ~ ~ ~ p=1.000 n=6
Symbols 2,986,643 2,986,643 ~ ~ ~ p=1.000 n=6
Types 1,027,511 1,027,511 ~ ~ ~ p=1.000 n=6
Memory used 3,111,141k (± 0.00%) 3,111,087k (± 0.00%) ~ 3,111,031k 3,111,198k p=0.128 n=6
Parse Time 13.80s (± 0.34%) 13.83s (± 0.30%) ~ 13.78s 13.89s p=0.574 n=6
Bind Time 4.29s (± 0.50%) 4.33s (± 2.20%) ~ 4.27s 4.52s p=1.000 n=6
Check Time 79.24s (± 0.17%) 79.36s (± 0.49%) ~ 78.86s 79.98s p=0.689 n=6
Emit Time 20.50s (± 0.73%) 20.50s (± 0.52%) ~ 20.31s 20.61s p=1.000 n=6
Total Time 117.84s (± 0.21%) 118.01s (± 0.34%) ~ 117.70s 118.74s p=0.630 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 267,603 267,603 ~ ~ ~ p=1.000 n=6
Types 109,105 109,105 ~ ~ ~ p=1.000 n=6
Memory used 412,306k (± 0.01%) 412,379k (± 0.02%) ~ 412,292k 412,485k p=0.093 n=6
Parse Time 3.18s (± 0.65%) 3.18s (± 0.28%) ~ 3.17s 3.19s p=0.807 n=6
Bind Time 1.43s (± 0.72%) 1.43s (± 0.29%) ~ 1.42s 1.43s p=0.268 n=6
Check Time 14.26s (± 0.28%) 14.27s (± 0.57%) ~ 14.15s 14.35s p=0.630 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 18.88s (± 0.17%) 18.88s (± 0.42%) ~ 18.76s 18.97s p=0.687 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 511,803 511,803 ~ ~ ~ p=1.000 n=6
Types 162,088 162,088 ~ ~ ~ p=1.000 n=6
Memory used 448,938k (± 0.08%) 448,974k (± 0.09%) ~ 448,616k 449,383k p=0.936 n=6
Parse Time 3.91s (± 0.63%) 3.91s (± 0.56%) ~ 3.88s 3.94s p=1.000 n=6
Bind Time 1.45s (± 0.36%) 1.44s (± 0.72%) ~ 1.42s 1.45s p=0.070 n=6
Check Time 21.25s (± 0.21%) 21.21s (± 0.39%) ~ 21.09s 21.33s p=0.630 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 26.61s (± 0.15%) 26.56s (± 0.40%) ~ 26.40s 26.71s p=0.336 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

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

Something interesting changed - please have a look.

Details

ag-grid/ag-grid

31 of 110 projects failed to build with the old tsc and were ignored

enterprise-modules/viewport-row-model/tsconfig.watch.json

enterprise-modules/viewport-row-model/tsconfig.types.watch.json

enterprise-modules/status-bar/tsconfig.watch.json

enterprise-modules/status-bar/tsconfig.types.watch.json

enterprise-modules/sparklines/tsconfig.watch.json

enterprise-modules/sparklines/tsconfig.types.watch.json

enterprise-modules/side-bar/tsconfig.watch.json

enterprise-modules/side-bar/tsconfig.types.watch.json

enterprise-modules/set-filter/tsconfig.watch.json

enterprise-modules/set-filter/tsconfig.types.watch.json

enterprise-modules/server-side-row-model/tsconfig.watch.json

enterprise-modules/server-side-row-model/tsconfig.types.watch.json

enterprise-modules/row-grouping/tsconfig.watch.json

enterprise-modules/row-grouping/tsconfig.types.watch.json

enterprise-modules/rich-select/tsconfig.watch.json

enterprise-modules/rich-select/tsconfig.types.watch.json

enterprise-modules/range-selection/tsconfig.watch.json

enterprise-modules/range-selection/tsconfig.types.watch.json

enterprise-modules/multi-filter/tsconfig.watch.json

enterprise-modules/multi-filter/tsconfig.types.watch.json

enterprise-modules/master-detail/tsconfig.watch.json

enterprise-modules/master-detail/tsconfig.types.watch.json

enterprise-modules/filter-tool-panel/tsconfig.watch.json

enterprise-modules/filter-tool-panel/tsconfig.types.watch.json

enterprise-modules/core/tsconfig.watch.json

enterprise-modules/core/tsconfig.types.watch.json

enterprise-modules/advanced-filter/tsconfig.watch.json

enterprise-modules/advanced-filter/tsconfig.types.watch.json

community-modules/vue3/tsconfig.watch.json

community-modules/vue3/tsconfig.types.watch.json

community-modules/infinite-row-model/tsconfig.watch.json

community-modules/infinite-row-model/tsconfig.types.watch.json

community-modules/csv-export/tsconfig.watch.json

community-modules/csv-export/tsconfig.types.watch.json

community-modules/core/tsconfig.watch.json

community-modules/core/tsconfig.types.watch.json

community-modules/client-side-row-model/tsconfig.watch.json

community-modules/client-side-row-model/tsconfig.types.watch.json

compiler-explorer/compiler-explorer

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

static/tsconfig.json

desktop/desktop

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

tsconfig.json

sequelize/sequelize

13 of 16 projects failed to build with the old tsc and were ignored

packages/utils/tsconfig.json

ahejlsberg added a commit that referenced this pull request Jul 26, 2024
@ahejlsberg
Copy link
Member

I have just put up #59437 which I believe is the right fix for #50603 plus the inconsistencies related to unconstrained type parameters vs. type parameters constrained to {} | null | undefined. There are an awful lot of interacting parts here. In particular, it only becomes feasible to check that unconstrained generic types are possibly nullable in --strictNullChecks mode by first fixing the fact that obj shouldn't be null-checked in obj[key] when obj and key both have generic types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error on unconstrained type parameter in > comparison
7 participants