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

Disallow numeric literals with negative numbers #55268

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Aug 4, 2023

This would prevent issues like this one (that was fixed by #55065 ).

Since a negative number is not a numeric literal, I think it's worth disallowing such AST nodes from being created.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 4, 2023
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@@ -2528,7 +2528,7 @@ export function transformGenerators(context: TransformationContext): (x: SourceF
labelExpressions = [];
}

const expression = factory.createNumericLiteral(-1);
const expression = factory.createNumericLiteral(Infinity);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This shows how createNumericLiteral is still a somewhat weird thing. Infinity is allowed because parsed numbers are "normalized" to text here:

else { // not a bigint, so can convert to number in simplified form
// Number() may not support 0b or 0o, so use parseInt() instead
const numericValue = tokenFlags & TokenFlags.BinarySpecifier
? parseInt(tokenValue.slice(2), 2) // skip "0b"
: tokenFlags & TokenFlags.OctalSpecifier
? parseInt(tokenValue.slice(2), 8) // skip "0o"
: +tokenValue;
tokenValue = "" + numericValue;
return SyntaxKind.NumericLiteral;

So a sufficiently long number in the input can be stringified to Infinity 🤷‍♂️ I find it weird an there is an issue about it that is labeled as a bug. While it doesn't mention Infinity case the issue there is basically related to the same "normalization".

This issue is certainly fixable but I'm not 100% sure if you'd really want to fix it.

Copy link
Member

Choose a reason for hiding this comment

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

Don't change this to Infinity since we really should consider that invalid as well. I'd just use a large value that we're unlikely to actually hit in a generator, something like 2 ** 32 - 1 (max uint32). The only reason it's set to -1 is to make it obvious something went wrong in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't change this to Infinity

Ye, I committed it this way specifically to add this PR comment 😅

since we really should consider that invalid as well.

Strong agree, I had versions of this work that forbid this as well but decided to roll them back and only start the conversation about this for now. I'm open to following up with further changes but it seems that the mentioned "normalization" of parsed numeric literals is relied upon in a couple of places. They can be adjusted but I'm not sure if this is something you'd like to do. In a way, it would be easiest to just drop this whole normalization altogether and just cast parsed text to string in those other places (to produce correct resolved property names etc).

I'd just use a large value that we're unlikely to actually hit in a generator, something like 2 ** 32 - 1 (max uint32).

pushed out a change with Number.MAX_SAFE_INTEGER

src/compiler/transformers/declarations.ts Outdated Show resolved Hide resolved
@@ -2528,7 +2528,7 @@ export function transformGenerators(context: TransformationContext): (x: SourceF
labelExpressions = [];
}

const expression = factory.createNumericLiteral(-1);
const expression = factory.createNumericLiteral(Infinity);
Copy link
Member

Choose a reason for hiding this comment

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

Don't change this to Infinity since we really should consider that invalid as well. I'd just use a large value that we're unlikely to actually hit in a generator, something like 2 ** 32 - 1 (max uint32). The only reason it's set to -1 is to make it obvious something went wrong in tests.

@@ -15,7 +15,7 @@ var bin3 = 0B1111111111111111111111111111111111111111111111110100101010000001011

var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
>bin4 : number
>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity
>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number
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 hope no one is relying on this.

@rbuckton
Copy link
Member

rbuckton commented Aug 4, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 4, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 4, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 4, 2023

Heya @rbuckton, I've started to run the perf test suite on this PR at 167a0ee. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 4, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-55268/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..55268
Metric main 55268 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 368,806k (± 0.01%) 368,819k (± 0.01%) ~ 368,784k 368,845k p=0.575 n=6
Parse Time 3.39s (± 0.68%) 3.42s (± 0.73%) ~ 3.37s 3.44s p=0.122 n=6
Bind Time 1.12s (± 1.04%) 1.12s (± 0.36%) ~ 1.12s 1.13s p=0.858 n=6
Check Time 9.01s (± 0.59%) 9.01s (± 0.19%) ~ 8.99s 9.04s p=1.000 n=6
Emit Time 7.54s (± 0.82%) 7.55s (± 0.43%) ~ 7.50s 7.59s p=0.628 n=6
Total Time 21.05s (± 0.51%) 21.10s (± 0.22%) ~ 21.04s 21.15s p=0.230 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 192,981k (± 1.18%) 192,069k (± 0.01%) ~ 192,042k 192,103k p=0.689 n=6
Parse Time 1.51s (± 0.91%) 1.51s (± 0.34%) ~ 1.50s 1.51s p=0.794 n=6
Bind Time 0.78s (± 0.71%) 0.77s (± 0.67%) ~ 0.77s 0.78s p=0.640 n=6
Check Time 9.53s (± 0.57%) 9.54s (± 0.42%) ~ 9.47s 9.57s p=0.872 n=6
Emit Time 2.74s (± 0.94%) 2.75s (± 0.87%) ~ 2.71s 2.77s p=0.466 n=6
Total Time 14.55s (± 0.58%) 14.57s (± 0.25%) ~ 14.53s 14.62s p=0.573 n=6
Monaco - node (v18.10.0, x64)
Memory used 347,747k (± 0.01%) 347,787k (± 0.01%) +39k (+ 0.01%) 347,743k 347,870k p=0.045 n=6
Parse Time 2.62s (± 0.72%) 2.62s (± 0.52%) ~ 2.60s 2.64s p=0.805 n=6
Bind Time 1.01s (± 0.80%) 1.01s (± 0.82%) ~ 1.00s 1.02s p=0.718 n=6
Check Time 7.33s (± 0.78%) 7.38s (± 0.28%) ~ 7.36s 7.42s p=0.126 n=6
Emit Time 4.25s (± 1.08%) 4.26s (± 0.93%) ~ 4.21s 4.32s p=0.687 n=6
Total Time 15.21s (± 0.28%) 15.28s (± 0.43%) +0.07s (+ 0.46%) 15.17s 15.37s p=0.045 n=6
TFS - node (v18.10.0, x64)
Memory used 301,802k (± 0.00%) 301,797k (± 0.01%) ~ 301,749k 301,824k p=0.936 n=6
Parse Time 2.08s (± 1.11%) 2.10s (± 0.98%) ~ 2.07s 2.12s p=0.224 n=6
Bind Time 1.12s (± 0.88%) 1.13s (± 0.74%) ~ 1.11s 1.13s p=0.588 n=6
Check Time 6.66s (± 0.65%) 6.70s (± 0.32%) ~ 6.67s 6.73s p=0.107 n=6
Emit Time 3.86s (± 0.46%) 3.88s (± 1.17%) ~ 3.82s 3.95s p=0.568 n=6
Total Time 13.73s (± 0.41%) 13.80s (± 0.18%) +0.08s (+ 0.56%) 13.78s 13.84s p=0.007 n=6
material-ui - node (v18.10.0, x64)
Memory used 482,642k (± 0.01%) 482,593k (± 0.01%) ~ 482,565k 482,637k p=0.149 n=6
Parse Time 3.09s (± 2.22%) 3.07s (± 2.95%) ~ 2.95s 3.14s p=0.870 n=6
Bind Time 0.93s (± 3.78%) 0.95s (± 5.99%) ~ 0.91s 1.03s p=0.558 n=6
Check Time 17.41s (± 0.56%) 17.46s (± 0.74%) ~ 17.32s 17.60s p=0.575 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.44s (± 0.40%) 21.49s (± 0.64%) ~ 21.33s 21.66s p=0.471 n=6
xstate - node (v18.10.0, x64)
Memory used 563,841k (± 0.02%) 563,833k (± 0.02%) ~ 563,728k 564,038k p=0.810 n=6
Parse Time 3.85s (± 0.91%) 3.84s (± 0.73%) ~ 3.81s 3.89s p=0.627 n=6
Bind Time 1.63s (± 0.51%) 1.64s (± 0.92%) ~ 1.62s 1.66s p=0.162 n=6
Check Time 2.79s (± 0.87%) 2.80s (± 0.66%) ~ 2.78s 2.82s p=0.222 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.35s (± 0.70%) 8.37s (± 0.48%) ~ 8.33s 8.43s p=0.936 n=6
Angular - node (v16.17.1, x64)
Memory used 368,222k (± 0.00%) 368,231k (± 0.00%) ~ 368,216k 368,258k p=0.332 n=6
Parse Time 3.55s (± 0.48%) 3.57s (± 0.55%) ~ 3.54s 3.59s p=0.222 n=6
Bind Time 1.18s (± 0.44%) 1.18s (± 0.88%) ~ 1.17s 1.20s p=0.794 n=6
Check Time 9.78s (± 0.47%) 9.77s (± 0.42%) ~ 9.74s 9.84s p=1.000 n=6
Emit Time 7.97s (± 0.83%) 8.00s (± 0.83%) ~ 7.93s 8.10s p=0.467 n=6
Total Time 22.48s (± 0.25%) 22.52s (± 0.45%) ~ 22.43s 22.71s p=0.575 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,819k (± 0.03%) 193,855k (± 0.02%) ~ 193,803k 193,935k p=0.230 n=6
Parse Time 1.59s (± 0.65%) 1.60s (± 0.65%) ~ 1.58s 1.61s p=0.134 n=6
Bind Time 0.82s (± 1.25%) 0.83s (± 0.66%) ~ 0.82s 0.83s p=0.663 n=6
Check Time 10.21s (± 0.45%) 10.24s (± 0.62%) ~ 10.18s 10.35s p=0.422 n=6
Emit Time 2.99s (± 0.58%) 3.00s (± 1.45%) ~ 2.96s 3.06s p=1.000 n=6
Total Time 15.61s (± 0.20%) 15.66s (± 0.61%) ~ 15.58s 15.85s p=0.226 n=6
Monaco - node (v16.17.1, x64)
Memory used 347,077k (± 0.01%) 347,071k (± 0.00%) ~ 347,058k 347,086k p=0.810 n=6
Parse Time 2.77s (± 0.29%) 2.77s (± 0.40%) ~ 2.76s 2.79s p=0.448 n=6
Bind Time 1.07s (± 0.48%) 1.08s (± 0.38%) ~ 1.07s 1.08s p=0.112 n=6
Check Time 8.04s (± 0.47%) 8.07s (± 0.69%) ~ 7.99s 8.15s p=0.376 n=6
Emit Time 4.47s (± 0.82%) 4.47s (± 0.44%) ~ 4.45s 4.50s p=0.934 n=6
Total Time 16.36s (± 0.26%) 16.38s (± 0.48%) ~ 16.30s 16.50s p=0.872 n=6
TFS - node (v16.17.1, x64)
Memory used 301,129k (± 0.01%) 301,135k (± 0.01%) ~ 301,087k 301,156k p=0.575 n=6
Parse Time 2.20s (± 0.67%) 2.20s (± 0.50%) ~ 2.19s 2.22s p=0.803 n=6
Bind Time 1.22s (± 1.24%) 1.20s (± 1.23%) ~ 1.18s 1.22s p=0.073 n=6
Check Time 7.37s (± 0.46%) 7.37s (± 0.30%) ~ 7.34s 7.40s p=1.000 n=6
Emit Time 4.32s (± 1.01%) 4.34s (± 0.83%) ~ 4.30s 4.40s p=0.630 n=6
Total Time 15.11s (± 0.34%) 15.10s (± 0.33%) ~ 15.04s 15.19s p=0.809 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,865k (± 0.00%) 481,905k (± 0.02%) ~ 481,832k 482,069k p=0.520 n=6
Parse Time 3.27s (± 0.57%) 3.25s (± 0.54%) ~ 3.23s 3.28s p=0.331 n=6
Bind Time 0.95s (± 1.15%) 0.95s (± 0.57%) ~ 0.95s 0.96s p=0.227 n=6
Check Time 18.48s (± 0.99%) 18.48s (± 0.33%) ~ 18.39s 18.55s p=0.470 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.70s (± 0.92%) 22.69s (± 0.30%) ~ 22.60s 22.78s p=0.470 n=6
xstate - node (v16.17.1, x64)
Memory used 561,502k (± 0.01%) 561,389k (± 0.02%) ~ 561,287k 561,627k p=0.066 n=6
Parse Time 4.01s (± 0.35%) 4.01s (± 0.41%) ~ 3.99s 4.04s p=0.622 n=6
Bind Time 1.74s (± 5.42%) 1.71s (± 6.01%) ~ 1.57s 1.81s p=0.748 n=6
Check Time 3.06s (± 3.08%) 3.08s (± 3.17%) ~ 3.00s 3.26s p=0.422 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.90s (± 0.50%) 8.91s (± 0.56%) ~ 8.85s 8.97s p=0.571 n=6
Angular - node (v14.21.3, x64)
Memory used 362,161k (± 0.01%) 362,144k (± 0.01%) ~ 362,074k 362,218k p=0.575 n=6
Parse Time 3.72s (± 0.33%) 3.73s (± 0.62%) ~ 3.71s 3.77s p=0.459 n=6
Bind Time 1.22s (± 0.80%) 1.22s (± 0.68%) ~ 1.22s 1.24s p=0.445 n=6
Check Time 10.18s (± 0.35%) 10.21s (± 0.60%) ~ 10.15s 10.29s p=0.748 n=6
Emit Time 8.31s (± 0.45%) 8.33s (± 0.73%) ~ 8.27s 8.40s p=0.747 n=6
Total Time 23.44s (± 0.17%) 23.49s (± 0.47%) ~ 23.36s 23.63s p=0.630 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 189,118k (± 0.01%) 189,113k (± 0.01%) ~ 189,087k 189,133k p=0.810 n=6
Parse Time 1.61s (± 0.47%) 1.61s (± 0.51%) ~ 1.60s 1.62s p=0.306 n=6
Bind Time 0.85s (± 0.96%) 0.85s (± 0.48%) ~ 0.84s 0.85s p=0.584 n=6
Check Time 10.36s (± 0.61%) 10.40s (± 0.37%) ~ 10.36s 10.47s p=0.228 n=6
Emit Time 3.12s (± 0.69%) 3.13s (± 0.77%) ~ 3.10s 3.17s p=0.370 n=6
Total Time 15.93s (± 0.46%) 15.99s (± 0.35%) ~ 15.93s 16.09s p=0.170 n=6
Monaco - node (v14.21.3, x64)
Memory used 342,073k (± 0.01%) 342,071k (± 0.00%) ~ 342,058k 342,079k p=0.688 n=6
Parse Time 2.81s (± 0.58%) 2.80s (± 0.32%) ~ 2.79s 2.81s p=0.357 n=6
Bind Time 1.10s (± 1.33%) 1.10s (± 0.00%) ~ 1.10s 1.10s p=0.598 n=6
Check Time 8.38s (± 0.71%) 8.37s (± 0.65%) ~ 8.29s 8.46s p=0.806 n=6
Emit Time 4.66s (± 0.81%) 4.71s (± 0.94%) ~ 4.66s 4.78s p=0.053 n=6
Total Time 16.95s (± 0.24%) 16.98s (± 0.43%) ~ 16.87s 17.06s p=0.423 n=6
TFS - node (v14.21.3, x64)
Memory used 296,202k (± 0.00%) 296,207k (± 0.00%) ~ 296,197k 296,223k p=0.687 n=6
Parse Time 2.42s (± 1.03%) 2.43s (± 0.96%) ~ 2.39s 2.46s p=0.517 n=6
Bind Time 1.08s (± 0.95%) 1.08s (± 0.48%) ~ 1.07s 1.08s p=0.242 n=6
Check Time 7.69s (± 0.59%) 7.69s (± 0.40%) ~ 7.65s 7.74s p=0.574 n=6
Emit Time 4.29s (± 0.61%) 4.30s (± 0.46%) ~ 4.28s 4.33s p=0.333 n=6
Total Time 15.48s (± 0.42%) 15.50s (± 0.35%) ~ 15.43s 15.58s p=0.630 n=6
material-ui - node (v14.21.3, x64)
Memory used 477,364k (± 0.01%) 477,381k (± 0.00%) ~ 477,370k 477,404k p=0.378 n=6
Parse Time 3.31s (± 0.48%) 3.30s (± 0.30%) ~ 3.29s 3.31s p=0.157 n=6
Bind Time 1.00s (± 0.55%) 0.99s (± 0.64%) ~ 0.98s 1.00s p=0.201 n=6
Check Time 19.27s (± 0.80%) 19.36s (± 0.56%) ~ 19.23s 19.53s p=0.297 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.58s (± 0.66%) 23.65s (± 0.46%) ~ 23.54s 23.81s p=0.468 n=6
xstate - node (v14.21.3, x64)
Memory used 550,207k (± 0.00%) 550,214k (± 0.01%) ~ 550,164k 550,250k p=0.873 n=6
Parse Time 4.22s (± 0.49%) 4.22s (± 0.68%) ~ 4.19s 4.26s p=0.808 n=6
Bind Time 1.69s (± 0.99%) 1.69s (± 1.75%) ~ 1.63s 1.71s p=0.505 n=6
Check Time 3.11s (± 0.60%) 3.10s (± 0.29%) ~ 3.09s 3.11s p=0.114 n=6
Emit Time 0.09s (± 5.53%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.174 n=6
Total Time 9.13s (± 0.44%) 9.10s (± 0.38%) ~ 9.06s 9.15s p=0.296 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
Benchmark Name Iterations
Current 55268 6
Baseline main 6

TSServer

Comparison Report - main..55268
Metric main 55268 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,544ms (± 0.42%) 2,536ms (± 0.17%) ~ 2,532ms 2,544ms p=0.149 n=6
Req 2 - geterr 5,430ms (± 0.33%) 5,401ms (± 0.64%) ~ 5,353ms 5,433ms p=0.336 n=6
Req 3 - references 343ms (± 1.19%) 339ms (± 0.22%) -4ms (- 1.21%) 338ms 340ms p=0.011 n=6
Req 4 - navto 289ms (± 0.81%) 289ms (± 0.36%) ~ 287ms 290ms p=1.000 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 86ms (± 0.94%) 87ms (± 0.60%) ~ 86ms 87ms p=0.523 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,619ms (± 0.88%) 2,623ms (± 0.53%) ~ 2,597ms 2,639ms p=0.810 n=6
Req 2 - geterr 4,146ms (± 0.60%) 4,147ms (± 0.51%) ~ 4,120ms 4,181ms p=0.936 n=6
Req 3 - references 356ms (± 0.41%) 355ms (± 0.37%) ~ 353ms 357ms p=0.560 n=6
Req 4 - navto 290ms (± 0.68%) 291ms (± 0.67%) ~ 288ms 293ms p=0.280 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 88ms (± 1.37%) 88ms (± 1.02%) ~ 87ms 89ms p=0.437 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,082ms (± 0.22%) 3,087ms (± 0.37%) ~ 3,068ms 3,099ms p=0.375 n=6
Req 2 - geterr 1,562ms (± 0.96%) 1,637ms (± 6.80%) ~ 1,540ms 1,796ms p=0.199 n=6
Req 3 - references 115ms (± 2.38%) 113ms (± 2.13%) ~ 109ms 115ms p=0.195 n=6
Req 4 - navto 369ms (± 0.38%) 373ms (± 1.26%) ~ 368ms 380ms p=0.124 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 383ms (± 1.80%) 381ms (± 2.14%) ~ 371ms 393ms p=0.685 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,623ms (± 0.84%) 2,605ms (± 0.50%) ~ 2,593ms 2,629ms p=0.128 n=6
Req 2 - geterr 6,074ms (± 0.48%) 6,056ms (± 0.46%) ~ 6,034ms 6,109ms p=0.297 n=6
Req 3 - references 356ms (± 1.10%) 356ms (± 0.81%) ~ 354ms 361ms p=0.932 n=6
Req 4 - navto 287ms (± 1.35%) 287ms (± 0.78%) ~ 284ms 289ms p=0.746 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 83ms (± 3.89%) 81ms (± 0.64%) ~ 80ms 81ms p=0.070 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,797ms (± 0.34%) 2,798ms (± 0.86%) ~ 2,756ms 2,820ms p=0.377 n=6
Req 2 - geterr 4,702ms (± 0.37%) 4,684ms (± 0.27%) ~ 4,674ms 4,708ms p=0.092 n=6
Req 3 - references 362ms (± 0.57%) 365ms (± 0.48%) ~ 362ms 367ms p=0.073 n=6
Req 4 - navto 281ms (± 0.65%) 282ms (± 1.46%) ~ 277ms 287ms p=0.744 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 78ms (± 4.12%) 77ms (± 1.09%) ~ 75ms 77ms p=0.788 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,218ms (± 0.34%) 3,226ms (± 0.28%) ~ 3,218ms 3,240ms p=0.072 n=6
Req 2 - geterr 1,694ms (± 0.47%) 1,694ms (± 0.58%) ~ 1,683ms 1,712ms p=0.872 n=6
Req 3 - references 130ms (± 6.91%) 131ms (± 7.91%) ~ 123ms 144ms p=0.625 n=6
Req 4 - navto 355ms (± 0.58%) 354ms (± 0.56%) ~ 350ms 356ms p=0.460 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 405ms (± 0.96%) 410ms (± 1.42%) ~ 399ms 415ms p=0.050 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,767ms (± 0.83%) 2,767ms (± 0.28%) ~ 2,760ms 2,781ms p=0.810 n=6
Req 2 - geterr 6,240ms (± 0.38%) 6,241ms (± 0.67%) ~ 6,169ms 6,294ms p=0.748 n=6
Req 3 - references 362ms (± 1.19%) 362ms (± 1.10%) ~ 359ms 370ms p=0.809 n=6
Req 4 - navto 290ms (± 0.94%) 290ms (± 0.48%) ~ 288ms 291ms p=0.681 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 105ms (± 7.75%) 105ms (± 7.73%) ~ 91ms 111ms p=0.511 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,942ms (± 0.40%) 2,932ms (± 0.32%) ~ 2,920ms 2,948ms p=0.128 n=6
Req 2 - geterr 4,589ms (± 0.35%) 4,590ms (± 0.73%) ~ 4,560ms 4,649ms p=0.748 n=6
Req 3 - references 375ms (± 0.35%) 376ms (± 0.40%) ~ 374ms 378ms p=0.511 n=6
Req 4 - navto 294ms (± 0.73%) 294ms (± 0.96%) ~ 291ms 298ms p=0.935 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 (± 3.56%) 83ms (± 0.91%) ~ 82ms 84ms p=0.054 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,510ms (± 0.54%) 3,501ms (± 0.51%) ~ 3,474ms 3,523ms p=0.470 n=6
Req 2 - geterr 1,813ms (± 0.43%) 1,817ms (± 0.81%) ~ 1,801ms 1,844ms p=0.520 n=6
Req 3 - references 151ms (± 4.33%) 143ms (± 8.49%) ~ 130ms 154ms p=0.134 n=6
Req 4 - navto 387ms (± 0.41%) 387ms (± 0.16%) ~ 386ms 388ms p=0.799 n=6
Req 5 - completionInfo count 2,872 (± 0.00%) 2,872 (± 0.00%) ~ 2,872 2,872 p=1.000 n=6
Req 5 - completionInfo 423ms (± 1.58%) 418ms (± 0.79%) ~ 414ms 422ms p=0.298 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
Benchmark Name Iterations
Current 55268 6
Baseline main 6

Startup

Comparison Report - main..55268
Metric main 55268 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.68ms (± 0.21%) 142.95ms (± 0.21%) +0.27ms (+ 0.19%) 142.16ms 147.22ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 222.04ms (± 0.18%) 223.02ms (± 0.19%) +0.98ms (+ 0.44%) 221.69ms 230.25ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 223.68ms (± 0.21%) 224.98ms (± 0.29%) +1.31ms (+ 0.58%) 223.13ms 234.92ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 206.30ms (± 0.30%) 206.69ms (± 0.23%) +0.40ms (+ 0.19%) 205.22ms 210.72ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-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
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 55268 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

Hey @rbuckton, the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

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

Successfully merging this pull request may close these issues.

3 participants