Skip to content

Suggest simplifications for overzealous shifts #59519

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

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

weswigham
Copy link
Member

This PR adds a suggestion on bitwise shifts where the right side operand is evaluable (which is implicitly non-bigint) to be outside of the range -31 to 31 to simplify the shift down into that range. Doing so should make it a bit more obvious when you've accidentally exceeded the maximum shift available for a number. 😄

This suggestion is escalated to an error in the context of enum members, since that's where it's most likely an overshift may result in an unintentionally duplicated enum member that is otherwise silent.

So this:

1 << 32;

results in

suggestion TS6807: This operation can be simplified. This shift is identical to `1 << 0`.

while this:

enum A {
  M = 1 << 32,
}

results in

error TS6807: This operation can be simplified. This shift is identical to `1 << 0`.

This logic is applied for all the shift operators - <<, >>, >>>, <<=, >>=, and >>>=.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 2, 2024
@jakebailey
Copy link
Member

Can this me made a regular error temporarily to run user/topXYZ?

(I also sort of feel like we should make it a regular error in general...)

@weswigham
Copy link
Member Author

Oh boy a failing self-check build :)

Always error user/top600 results rolling in here.

@gabritto
Copy link
Member

gabritto commented Aug 2, 2024

Are there other common ways people can end up with two enum members of the same value by accident?

case SyntaxKind.GreaterThanGreaterThanGreaterThanToken:
case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken:
const rhsEval = evaluate(right);
if (typeof rhsEval.value === "number" && Math.abs(rhsEval.value) >= 32) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this convert the value to an integer or something?

Choose a reason for hiding this comment

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

The Math.abs also seems unnecessary - any value below 0 seems wrong and 1 << -1 == 1 << 31, 1 << -2 == 1 << 30 etc. so Math.abs "reverses" it.

Interestingly, 1 << -0.9 == 1 << 0 so I guess you want Math.trunc (or | 0) rather than Math.floor.

Copy link
Member Author

Choose a reason for hiding this comment

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

any value below 0 seems wrong

It's a useful shorthand. Similar to negative slice indices in python. Not doing an abs on the evaluated result here, either - just using it to measure the magnitude of the number to issue the error or not.

Should this convert the value to an integer or something?

Eh. Don't really need to. Fractional parts just get dropped anyway. Issuing an error on any fractional literal in a shift position would probably be fine (0.5 is the same as 0 for this operator after all), but I don't think it's particularly related to this range error.

@weswigham weswigham force-pushed the error-on-erroneous-shifts branch from 1ef0e40 to 70afb84 Compare August 13, 2024 22:47
@weswigham
Copy link
Member Author

Are there other common ways people can end up with two enum members of the same value by accident?

Other arithmetic errors in calculated enum values, perhaps, but it may also be intentional. Especially with flags enums and bitwise arithmetic - you may end up deriving two sets of flags that just so happen to resolve to the same thing via different means.

@gabritto
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 14, 2024

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

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 14, 2024

Hey @gabritto, 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/163271/artifacts?artifactName=tgz&fileId=1310AB3DCEF2C1F649FD78C22F21BFCD0584DC2D17A7C8E6BCDAE4B513AE08A802&fileName=/typescript-5.6.0-insiders.20240814.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.6.0-pr-59519-6".;

@gabritto
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 14, 2024

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

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

@typescript-bot
Copy link
Collaborator

Hey @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 Here are the results of running the user tests with tsc comparing main and refs/pull/59519/merge:

Everything looks good!

@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 193,578k (± 0.93%) 192,349k (± 0.01%) ~ 192,322k 192,376k p=0.378 n=6
Parse Time 1.30s (± 0.75%) 1.31s (± 0.57%) ~ 1.30s 1.32s p=0.300 n=6
Bind Time 0.71s 0.71s ~ ~ ~ p=1.000 n=6
Check Time 9.55s (± 0.75%) 9.57s (± 0.29%) ~ 9.53s 9.61s p=0.377 n=6
Emit Time 2.72s (± 0.59%) 2.73s (± 0.46%) ~ 2.71s 2.74s p=0.323 n=6
Total Time 14.28s (± 0.48%) 14.31s (± 0.12%) ~ 14.29s 14.34s p=0.374 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,757 945,757 ~ ~ ~ p=1.000 n=6
Types 410,045 410,045 ~ ~ ~ p=1.000 n=6
Memory used 1,222,560k (± 0.00%) 1,222,534k (± 0.00%) ~ 1,222,479k 1,222,592k p=0.230 n=6
Parse Time 6.65s (± 0.29%) 6.67s (± 0.36%) ~ 6.63s 6.70s p=0.291 n=6
Bind Time 1.87s (± 0.44%) 1.86s (± 0.22%) ~ 1.86s 1.87s p=0.109 n=6
Check Time 31.05s (± 0.53%) 31.01s (± 0.52%) ~ 30.83s 31.28s p=0.936 n=6
Emit Time 15.02s (± 0.47%) 14.98s (± 1.13%) ~ 14.68s 15.17s p=0.936 n=6
Total Time 54.58s (± 0.36%) 54.52s (± 0.40%) ~ 54.28s 54.92s p=0.689 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,491,186 2,491,186 ~ ~ ~ p=1.000 n=6
Types 1,013,424 1,013,424 ~ ~ ~ p=1.000 n=6
Memory used 2,498,579k (± 0.00%) 2,498,623k (± 0.00%) ~ 2,498,540k 2,498,671k p=0.173 n=6
Parse Time 9.27s (± 0.44%) 9.27s (± 0.40%) ~ 9.20s 9.30s p=0.678 n=6
Bind Time 2.18s (± 0.85%) 2.17s (± 0.45%) ~ 2.16s 2.18s p=0.230 n=6
Check Time 75.62s (± 0.64%) 76.07s (± 0.31%) ~ 75.75s 76.45s p=0.066 n=6
Emit Time 0.66s (±138.87%) 0.28s (± 1.45%) ~ 0.28s 0.29s p=0.248 n=6
Total Time 87.73s (± 1.14%) 87.79s (± 0.29%) ~ 87.49s 88.22s p=0.471 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,145 1,231,260 +115 (+ 0.01%) ~ ~ p=0.001 n=6
Types 264,256 264,286 +30 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,352,002k (± 0.02%) 2,352,691k (± 0.02%) +690k (+ 0.03%) 2,352,174k 2,353,185k p=0.031 n=6
Parse Time 4.99s (± 0.99%) 4.99s (± 1.00%) ~ 4.92s 5.05s p=0.936 n=6
Bind Time 1.87s (± 0.86%) 1.89s (± 0.91%) ~ 1.87s 1.91s p=0.101 n=6
Check Time 34.59s (± 0.23%) 34.74s (± 0.34%) +0.15s (+ 0.44%) 34.54s 34.86s p=0.031 n=6
Emit Time 3.33s (± 1.05%) 3.40s (± 4.38%) ~ 3.30s 3.69s p=0.810 n=6
Total Time 44.79s (± 0.24%) 45.02s (± 0.52%) +0.23s (+ 0.52%) 44.80s 45.46s p=0.045 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,145 1,231,260 +115 (+ 0.01%) ~ ~ p=0.001 n=6
Types 264,256 264,286 +30 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,426,440k (± 0.02%) 2,426,619k (± 0.01%) ~ 2,426,322k 2,427,179k p=0.810 n=6
Parse Time 6.18s (± 0.86%) 6.21s (± 0.71%) ~ 6.13s 6.25s p=0.298 n=6
Bind Time 2.01s (± 1.08%) 2.03s (± 1.36%) ~ 1.99s 2.07s p=0.169 n=6
Check Time 41.14s (± 0.45%) 41.49s (± 0.56%) +0.35s (+ 0.85%) 41.15s 41.73s p=0.024 n=6
Emit Time 4.04s (± 1.11%) 4.16s (± 5.47%) ~ 3.99s 4.46s p=0.936 n=6
Total Time 53.38s (± 0.36%) 53.90s (± 0.23%) +0.51s (+ 0.96%) 53.68s 54.04s p=0.008 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,898 256,901 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,585 105,594 +9 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 429,217k (± 0.02%) 429,304k (± 0.04%) ~ 429,161k 429,635k p=0.298 n=6
Parse Time 3.37s (± 0.62%) 3.34s (± 0.35%) -0.03s (- 0.84%) 3.32s 3.35s p=0.048 n=6
Bind Time 1.31s (± 1.01%) 1.32s (± 0.93%) ~ 1.30s 1.33s p=0.383 n=6
Check Time 18.05s (± 0.20%) 18.11s (± 0.43%) ~ 17.99s 18.23s p=0.092 n=6
Emit Time 1.66s (± 1.36%) 1.65s (± 0.83%) ~ 1.64s 1.67s p=0.806 n=6
Total Time 24.39s (± 0.22%) 24.41s (± 0.30%) ~ 24.31s 24.52s p=0.520 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 225,018 225,018 ~ ~ ~ p=1.000 n=6
Types 94,245 94,245 ~ ~ ~ p=1.000 n=6
Memory used 370,206k (± 0.02%) 370,163k (± 0.02%) ~ 370,042k 370,266k p=0.378 n=6
Parse Time 3.45s (± 0.40%) 3.44s (± 0.39%) ~ 3.43s 3.46s p=0.737 n=6
Bind Time 1.93s (± 0.51%) 1.93s (± 0.91%) ~ 1.90s 1.95s p=0.615 n=6
Check Time 19.40s (± 0.26%) 19.44s (± 0.30%) ~ 19.36s 19.52s p=0.260 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.78s (± 0.18%) 24.81s (± 0.26%) ~ 24.73s 24.89s p=0.376 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 3,001,474 3,001,474 ~ ~ ~ p=1.000 n=6
Types 1,034,016 1,034,016 ~ ~ ~ p=1.000 n=6
Memory used 3,126,612k (± 0.00%) 3,126,641k (± 0.00%) ~ 3,126,567k 3,126,765k p=0.423 n=6
Parse Time 13.88s (± 0.41%) 13.92s (± 0.17%) ~ 13.88s 13.95s p=0.127 n=6
Bind Time 4.33s (± 2.11%) 4.30s (± 0.19%) ~ 4.29s 4.31s p=0.618 n=6
Check Time 79.51s (± 0.12%) 79.89s (± 0.41%) +0.38s (+ 0.48%) 79.60s 80.45s p=0.008 n=6
Emit Time 20.45s (± 0.55%) 20.54s (± 0.67%) ~ 20.32s 20.70s p=0.173 n=6
Total Time 118.17s (± 0.18%) 118.65s (± 0.33%) +0.49s (+ 0.41%) 118.23s 119.21s p=0.031 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 274,423 274,423 ~ ~ ~ p=1.000 n=6
Types 111,852 111,852 ~ ~ ~ p=1.000 n=6
Memory used 420,961k (± 0.02%) 420,896k (± 0.02%) ~ 420,810k 420,998k p=0.575 n=6
Parse Time 3.93s (± 0.23%) 3.97s (± 0.25%) +0.04s (+ 0.98%) 3.96s 3.98s p=0.004 n=6
Bind Time 1.73s (± 1.19%) 1.73s (± 1.27%) ~ 1.69s 1.75s p=0.932 n=6
Check Time 17.15s (± 0.38%) 17.25s (± 0.29%) +0.10s (+ 0.56%) 17.17s 17.30s p=0.030 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.82s (± 0.35%) 22.95s (± 0.19%) +0.13s (+ 0.58%) 22.87s 22.98s p=0.016 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 533,930 533,930 ~ ~ ~ p=1.000 n=6
Types 176,095 176,095 ~ ~ ~ p=1.000 n=6
Memory used 479,226k (± 0.01%) 479,228k (± 0.00%) ~ 479,209k 479,246k p=0.630 n=6
Parse Time 4.24s (± 0.58%) 4.25s (± 0.73%) ~ 4.20s 4.28s p=0.808 n=6
Bind Time 1.54s (± 1.36%) 1.55s (± 0.82%) ~ 1.53s 1.56s p=0.453 n=6
Check Time 22.32s (± 0.21%) 22.23s (± 0.12%) -0.08s (- 0.37%) 22.19s 22.27s p=0.006 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.10s (± 0.13%) 28.03s (± 0.08%) -0.07s (- 0.24%) 28.00s 28.05s p=0.005 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

@gabritto
Copy link
Member

@typescript-bot perf test this faster

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 14, 2024

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

Command Status Results
perf test this faster ✅ Started 👀 Results

@weswigham weswigham merged commit 1250b48 into microsoft:main Aug 14, 2024
32 checks passed
@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,983k (± 0.74%) 194,132k (± 1.01%) ~ 192,296k 195,947k p=0.471 n=6
Parse Time 1.30s (± 0.94%) 1.31s (± 0.79%) ~ 1.29s 1.32s p=0.931 n=6
Bind Time 0.71s 0.71s ~ ~ ~ p=1.000 n=6
Check Time 9.54s (± 0.42%) 9.58s (± 0.43%) ~ 9.52s 9.63s p=0.169 n=6
Emit Time 2.73s (± 0.40%) 2.70s (± 1.66%) ~ 2.63s 2.75s p=0.368 n=6
Total Time 14.29s (± 0.30%) 14.30s (± 0.47%) ~ 14.20s 14.37s p=0.810 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 945,757 945,757 ~ ~ ~ p=1.000 n=6
Types 410,045 410,045 ~ ~ ~ p=1.000 n=6
Memory used 1,222,541k (± 0.00%) 1,222,512k (± 0.00%) ~ 1,222,451k 1,222,569k p=0.336 n=6
Parse Time 6.65s (± 0.47%) 6.64s (± 0.56%) ~ 6.58s 6.67s p=0.220 n=6
Bind Time 1.87s (± 0.40%) 1.86s (± 0.44%) ~ 1.85s 1.87s p=0.383 n=6
Check Time 31.09s (± 0.40%) 31.11s (± 0.47%) ~ 30.97s 31.36s p=0.810 n=6
Emit Time 14.92s (± 1.18%) 14.93s (± 0.37%) ~ 14.85s 15.02s p=1.000 n=6
Total Time 54.53s (± 0.39%) 54.54s (± 0.31%) ~ 54.34s 54.82s p=1.000 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,491,186 2,491,186 ~ ~ ~ p=1.000 n=6
Types 1,013,424 1,013,424 ~ ~ ~ p=1.000 n=6
Memory used 2,498,653k (± 0.01%) 2,498,687k (± 0.01%) ~ 2,498,514k 2,498,810k p=0.630 n=6
Parse Time 10.95s (± 0.50%) 10.94s (± 0.34%) ~ 10.87s 10.97s p=0.469 n=6
Bind Time 2.61s (± 0.46%) 2.61s (± 0.68%) ~ 2.59s 2.63s p=0.804 n=6
Check Time 89.75s (± 0.44%) 90.05s (± 0.84%) ~ 88.85s 90.97s p=0.298 n=6
Emit Time 0.33s (± 1.23%) 0.33s (± 1.91%) ~ 0.32s 0.34s p=0.673 n=6
Total Time 103.64s (± 0.39%) 103.92s (± 0.71%) ~ 102.77s 104.90s p=0.423 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,145 1,231,260 +115 (+ 0.01%) ~ ~ p=0.001 n=6
Types 264,256 264,286 +30 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,352,283k (± 0.01%) 2,352,608k (± 0.02%) ~ 2,352,190k 2,353,290k p=0.173 n=6
Parse Time 4.99s (± 1.15%) 4.98s (± 0.76%) ~ 4.94s 5.02s p=0.936 n=6
Bind Time 1.87s (± 1.25%) 1.88s (± 1.21%) ~ 1.84s 1.90s p=0.684 n=6
Check Time 34.68s (± 0.25%) 34.75s (± 0.56%) ~ 34.41s 34.90s p=0.378 n=6
Emit Time 3.33s (± 1.05%) 3.35s (± 0.59%) ~ 3.32s 3.38s p=0.261 n=6
Total Time 44.88s (± 0.21%) 44.96s (± 0.45%) ~ 44.62s 45.13s p=0.229 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,231,145 1,231,260 +115 (+ 0.01%) ~ ~ p=0.001 n=6
Types 264,256 264,286 +30 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 2,426,612k (± 0.03%) 2,427,275k (± 0.02%) ~ 2,426,909k 2,428,464k p=0.093 n=6
Parse Time 5.17s (± 0.71%) 5.14s (± 0.50%) ~ 5.11s 5.17s p=0.297 n=6
Bind Time 1.69s (± 0.53%) 1.68s (± 0.50%) ~ 1.68s 1.70s p=0.339 n=6
Check Time 35.05s (± 0.24%) 35.21s (± 0.14%) +0.15s (+ 0.44%) 35.15s 35.30s p=0.008 n=6
Emit Time 3.46s (± 4.19%) 3.37s (± 1.22%) ~ 3.32s 3.42s p=0.471 n=6
Total Time 45.38s (± 0.27%) 45.41s (± 0.20%) ~ 45.35s 45.54s p=0.336 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 256,898 256,901 +3 (+ 0.00%) ~ ~ p=0.001 n=6
Types 105,585 105,594 +9 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 429,343k (± 0.05%) 429,287k (± 0.02%) ~ 429,227k 429,425k p=0.873 n=6
Parse Time 3.37s (± 0.51%) 3.37s (± 0.62%) ~ 3.34s 3.39s p=0.739 n=6
Bind Time 1.30s (± 2.03%) 1.31s (± 1.28%) ~ 1.29s 1.33s p=0.739 n=6
Check Time 18.07s (± 0.17%) 18.06s (± 0.22%) ~ 18.01s 18.09s p=0.744 n=6
Emit Time 1.66s (± 1.24%) 1.65s (± 2.14%) ~ 1.62s 1.72s p=0.255 n=6
Total Time 24.41s (± 0.18%) 24.39s (± 0.16%) ~ 24.34s 24.45s p=0.572 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 35 35 ~ ~ ~ p=1.000 n=6
Symbols 225,018 225,018 ~ ~ ~ p=1.000 n=6
Types 94,245 94,245 ~ ~ ~ p=1.000 n=6
Memory used 370,180k (± 0.03%) 370,142k (± 0.01%) ~ 370,079k 370,229k p=0.810 n=6
Parse Time 3.46s (± 1.15%) 3.43s (± 0.67%) ~ 3.40s 3.46s p=0.332 n=6
Bind Time 1.93s (± 1.24%) 1.92s (± 0.63%) ~ 1.91s 1.94s p=0.360 n=6
Check Time 19.38s (± 0.22%) 19.35s (± 0.42%) ~ 19.24s 19.45s p=0.936 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.76s (± 0.17%) 24.71s (± 0.41%) ~ 24.59s 24.84s p=0.573 n=6
vscode - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 3,001,474 3,001,474 ~ ~ ~ p=1.000 n=6
Types 1,034,016 1,034,016 ~ ~ ~ p=1.000 n=6
Memory used 3,126,569k (± 0.00%) 3,126,589k (± 0.00%) ~ 3,126,480k 3,126,732k p=0.688 n=6
Parse Time 13.82s (± 0.35%) 13.88s (± 0.24%) ~ 13.83s 13.93s p=0.065 n=6
Bind Time 4.25s (± 0.64%) 4.30s (± 2.05%) ~ 4.26s 4.48s p=0.569 n=6
Check Time 78.83s (± 0.13%) 79.40s (± 0.46%) +0.57s (+ 0.73%) 78.97s 79.98s p=0.005 n=6
Emit Time 20.30s (± 0.43%) 20.39s (± 0.58%) ~ 20.26s 20.54s p=0.261 n=6
Total Time 117.20s (± 0.12%) 117.97s (± 0.42%) +0.77s (+ 0.65%) 117.33s 118.72s p=0.008 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 274,423 274,423 ~ ~ ~ p=1.000 n=6
Types 111,852 111,852 ~ ~ ~ p=1.000 n=6
Memory used 421,011k (± 0.03%) 420,911k (± 0.02%) ~ 420,793k 420,985k p=0.230 n=6
Parse Time 4.89s (± 0.27%) 4.88s (± 0.50%) ~ 4.85s 4.92s p=0.624 n=6
Bind Time 2.13s (± 0.69%) 2.13s (± 0.49%) ~ 2.11s 2.14s p=0.413 n=6
Check Time 21.21s (± 0.52%) 21.37s (± 0.51%) +0.17s (+ 0.79%) 21.18s 21.48s p=0.030 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.23s (± 0.42%) 28.38s (± 0.40%) +0.15s (+ 0.54%) 28.18s 28.50s p=0.045 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 533,930 533,930 ~ ~ ~ p=1.000 n=6
Types 176,095 176,095 ~ ~ ~ p=1.000 n=6
Memory used 479,196k (± 0.01%) 479,162k (± 0.01%) ~ 479,098k 479,209k p=0.378 n=6
Parse Time 3.41s (± 0.61%) 3.39s (± 0.24%) ~ 3.38s 3.40s p=0.284 n=6
Bind Time 1.26s (± 0.60%) 1.26s (± 1.17%) ~ 1.23s 1.27s p=0.604 n=6
Check Time 17.96s (± 0.22%) 18.03s (± 0.28%) +0.08s (+ 0.44%) 17.98s 18.11s p=0.016 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 22.62s (± 0.24%) 22.69s (± 0.31%) ~ 22.59s 22.78s p=0.149 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

@gabritto
Copy link
Member

@weswigham there seems to be a slight increase in check times for our codebase but also for vscode, webpack and xstate. Any ideas of why that could be? Do we now issue more suggestions on those repos? Is it just the extra work of evaluating operators?

@typescript-bot
Copy link
Collaborator

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

Everything looks good!

@weswigham
Copy link
Member Author

Yeah, just a little bit of extra work evaluating the shifts, I imagine. vscode has... 470 left shifts, and a handful of right shifts and rotates. I don't think any actually trigger the suggestion.

@sandersn sandersn removed this from PR Backlog Apr 22, 2025
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.

5 participants