Skip to content

Disallow numeric literals with negative numbers - #55268

Merged
Ron Buckton (rbuckton) merged 2 commits into
microsoft:mainfrom
Andarist:disallow-negative-numbers-in-create-numeric-literal
Aug 7, 2023
Merged

Disallow numeric literals with negative numbers#55268
Ron Buckton (rbuckton) merged 2 commits into
microsoft:mainfrom
Andarist:disallow-negative-numbers-in-create-numeric-literal

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

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-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 4, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

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

}

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

Copy link
Copy Markdown
ContributorAuthor

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
constnumericValue=tokenFlags&TokenFlags.BinarySpecifier
? parseInt(tokenValue.slice(2),2)// skip "0b"
: tokenFlags&TokenFlags.OctalSpecifier
? parseInt(tokenValue.slice(2),8)// skip "0o"
: +tokenValue;
tokenValue=""+numericValue;
returnSyntaxKind.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
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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

Comment threadsrc/compiler/transformers/declarations.ts Outdated
}

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

Copy link
Copy Markdown
Contributor

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.

var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
>bin4 : number
>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity
>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@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

TypeScript Bot (typescript-bot) commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

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

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@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

TypeScript Bot (typescript-bot) commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@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
Copy Markdown
Contributor

Ron Buckton (@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
Copy Markdown
Contributor

Ron Buckton (@rbuckton)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..55268
Metricmain55268DeltaBestWorstp-value
Angular - node (v18.10.0, x64)
Memory used368,806k (± 0.01%)368,819k (± 0.01%)~368,784k368,845kp=0.575 n=6
Parse Time3.39s (± 0.68%)3.42s (± 0.73%)~3.37s3.44sp=0.122 n=6
Bind Time1.12s (± 1.04%)1.12s (± 0.36%)~1.12s1.13sp=0.858 n=6
Check Time9.01s (± 0.59%)9.01s (± 0.19%)~8.99s9.04sp=1.000 n=6
Emit Time7.54s (± 0.82%)7.55s (± 0.43%)~7.50s7.59sp=0.628 n=6
Total Time21.05s (± 0.51%)21.10s (± 0.22%)~21.04s21.15sp=0.230 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used192,981k (± 1.18%)192,069k (± 0.01%)~192,042k192,103kp=0.689 n=6
Parse Time1.51s (± 0.91%)1.51s (± 0.34%)~1.50s1.51sp=0.794 n=6
Bind Time0.78s (± 0.71%)0.77s (± 0.67%)~0.77s0.78sp=0.640 n=6
Check Time9.53s (± 0.57%)9.54s (± 0.42%)~9.47s9.57sp=0.872 n=6
Emit Time2.74s (± 0.94%)2.75s (± 0.87%)~2.71s2.77sp=0.466 n=6
Total Time14.55s (± 0.58%)14.57s (± 0.25%)~14.53s14.62sp=0.573 n=6
Monaco - node (v18.10.0, x64)
Memory used347,747k (± 0.01%)347,787k (± 0.01%)+39k (+ 0.01%)347,743k347,870kp=0.045 n=6
Parse Time2.62s (± 0.72%)2.62s (± 0.52%)~2.60s2.64sp=0.805 n=6
Bind Time1.01s (± 0.80%)1.01s (± 0.82%)~1.00s1.02sp=0.718 n=6
Check Time7.33s (± 0.78%)7.38s (± 0.28%)~7.36s7.42sp=0.126 n=6
Emit Time4.25s (± 1.08%)4.26s (± 0.93%)~4.21s4.32sp=0.687 n=6
Total Time15.21s (± 0.28%)15.28s (± 0.43%)+0.07s (+ 0.46%)15.17s15.37sp=0.045 n=6
TFS - node (v18.10.0, x64)
Memory used301,802k (± 0.00%)301,797k (± 0.01%)~301,749k301,824kp=0.936 n=6
Parse Time2.08s (± 1.11%)2.10s (± 0.98%)~2.07s2.12sp=0.224 n=6
Bind Time1.12s (± 0.88%)1.13s (± 0.74%)~1.11s1.13sp=0.588 n=6
Check Time6.66s (± 0.65%)6.70s (± 0.32%)~6.67s6.73sp=0.107 n=6
Emit Time3.86s (± 0.46%)3.88s (± 1.17%)~3.82s3.95sp=0.568 n=6
Total Time13.73s (± 0.41%)13.80s (± 0.18%)+0.08s (+ 0.56%)13.78s13.84sp=0.007 n=6
material-ui - node (v18.10.0, x64)
Memory used482,642k (± 0.01%)482,593k (± 0.01%)~482,565k482,637kp=0.149 n=6
Parse Time3.09s (± 2.22%)3.07s (± 2.95%)~2.95s3.14sp=0.870 n=6
Bind Time0.93s (± 3.78%)0.95s (± 5.99%)~0.91s1.03sp=0.558 n=6
Check Time17.41s (± 0.56%)17.46s (± 0.74%)~17.32s17.60sp=0.575 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time21.44s (± 0.40%)21.49s (± 0.64%)~21.33s21.66sp=0.471 n=6
xstate - node (v18.10.0, x64)
Memory used563,841k (± 0.02%)563,833k (± 0.02%)~563,728k564,038kp=0.810 n=6
Parse Time3.85s (± 0.91%)3.84s (± 0.73%)~3.81s3.89sp=0.627 n=6
Bind Time1.63s (± 0.51%)1.64s (± 0.92%)~1.62s1.66sp=0.162 n=6
Check Time2.79s (± 0.87%)2.80s (± 0.66%)~2.78s2.82sp=0.222 n=6
Emit Time0.08s (± 0.00%)0.08s (± 0.00%)~0.08s0.08sp=1.000 n=6
Total Time8.35s (± 0.70%)8.37s (± 0.48%)~8.33s8.43sp=0.936 n=6
Angular - node (v16.17.1, x64)
Memory used368,222k (± 0.00%)368,231k (± 0.00%)~368,216k368,258kp=0.332 n=6
Parse Time3.55s (± 0.48%)3.57s (± 0.55%)~3.54s3.59sp=0.222 n=6
Bind Time1.18s (± 0.44%)1.18s (± 0.88%)~1.17s1.20sp=0.794 n=6
Check Time9.78s (± 0.47%)9.77s (± 0.42%)~9.74s9.84sp=1.000 n=6
Emit Time7.97s (± 0.83%)8.00s (± 0.83%)~7.93s8.10sp=0.467 n=6
Total Time22.48s (± 0.25%)22.52s (± 0.45%)~22.43s22.71sp=0.575 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used193,819k (± 0.03%)193,855k (± 0.02%)~193,803k193,935kp=0.230 n=6
Parse Time1.59s (± 0.65%)1.60s (± 0.65%)~1.58s1.61sp=0.134 n=6
Bind Time0.82s (± 1.25%)0.83s (± 0.66%)~0.82s0.83sp=0.663 n=6
Check Time10.21s (± 0.45%)10.24s (± 0.62%)~10.18s10.35sp=0.422 n=6
Emit Time2.99s (± 0.58%)3.00s (± 1.45%)~2.96s3.06sp=1.000 n=6
Total Time15.61s (± 0.20%)15.66s (± 0.61%)~15.58s15.85sp=0.226 n=6
Monaco - node (v16.17.1, x64)
Memory used347,077k (± 0.01%)347,071k (± 0.00%)~347,058k347,086kp=0.810 n=6
Parse Time2.77s (± 0.29%)2.77s (± 0.40%)~2.76s2.79sp=0.448 n=6
Bind Time1.07s (± 0.48%)1.08s (± 0.38%)~1.07s1.08sp=0.112 n=6
Check Time8.04s (± 0.47%)8.07s (± 0.69%)~7.99s8.15sp=0.376 n=6
Emit Time4.47s (± 0.82%)4.47s (± 0.44%)~4.45s4.50sp=0.934 n=6
Total Time16.36s (± 0.26%)16.38s (± 0.48%)~16.30s16.50sp=0.872 n=6
TFS - node (v16.17.1, x64)
Memory used301,129k (± 0.01%)301,135k (± 0.01%)~301,087k301,156kp=0.575 n=6
Parse Time2.20s (± 0.67%)2.20s (± 0.50%)~2.19s2.22sp=0.803 n=6
Bind Time1.22s (± 1.24%)1.20s (± 1.23%)~1.18s1.22sp=0.073 n=6
Check Time7.37s (± 0.46%)7.37s (± 0.30%)~7.34s7.40sp=1.000 n=6
Emit Time4.32s (± 1.01%)4.34s (± 0.83%)~4.30s4.40sp=0.630 n=6
Total Time15.11s (± 0.34%)15.10s (± 0.33%)~15.04s15.19sp=0.809 n=6
material-ui - node (v16.17.1, x64)
Memory used481,865k (± 0.00%)481,905k (± 0.02%)~481,832k482,069kp=0.520 n=6
Parse Time3.27s (± 0.57%)3.25s (± 0.54%)~3.23s3.28sp=0.331 n=6
Bind Time0.95s (± 1.15%)0.95s (± 0.57%)~0.95s0.96sp=0.227 n=6
Check Time18.48s (± 0.99%)18.48s (± 0.33%)~18.39s18.55sp=0.470 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time22.70s (± 0.92%)22.69s (± 0.30%)~22.60s22.78sp=0.470 n=6
xstate - node (v16.17.1, x64)
Memory used561,502k (± 0.01%)561,389k (± 0.02%)~561,287k561,627kp=0.066 n=6
Parse Time4.01s (± 0.35%)4.01s (± 0.41%)~3.99s4.04sp=0.622 n=6
Bind Time1.74s (± 5.42%)1.71s (± 6.01%)~1.57s1.81sp=0.748 n=6
Check Time3.06s (± 3.08%)3.08s (± 3.17%)~3.00s3.26sp=0.422 n=6
Emit Time0.09s (± 0.00%)0.09s (± 0.00%)~0.09s0.09sp=1.000 n=6
Total Time8.90s (± 0.50%)8.91s (± 0.56%)~8.85s8.97sp=0.571 n=6
Angular - node (v14.21.3, x64)
Memory used362,161k (± 0.01%)362,144k (± 0.01%)~362,074k362,218kp=0.575 n=6
Parse Time3.72s (± 0.33%)3.73s (± 0.62%)~3.71s3.77sp=0.459 n=6
Bind Time1.22s (± 0.80%)1.22s (± 0.68%)~1.22s1.24sp=0.445 n=6
Check Time10.18s (± 0.35%)10.21s (± 0.60%)~10.15s10.29sp=0.748 n=6
Emit Time8.31s (± 0.45%)8.33s (± 0.73%)~8.27s8.40sp=0.747 n=6
Total Time23.44s (± 0.17%)23.49s (± 0.47%)~23.36s23.63sp=0.630 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used189,118k (± 0.01%)189,113k (± 0.01%)~189,087k189,133kp=0.810 n=6
Parse Time1.61s (± 0.47%)1.61s (± 0.51%)~1.60s1.62sp=0.306 n=6
Bind Time0.85s (± 0.96%)0.85s (± 0.48%)~0.84s0.85sp=0.584 n=6
Check Time10.36s (± 0.61%)10.40s (± 0.37%)~10.36s10.47sp=0.228 n=6
Emit Time3.12s (± 0.69%)3.13s (± 0.77%)~3.10s3.17sp=0.370 n=6
Total Time15.93s (± 0.46%)15.99s (± 0.35%)~15.93s16.09sp=0.170 n=6
Monaco - node (v14.21.3, x64)
Memory used342,073k (± 0.01%)342,071k (± 0.00%)~342,058k342,079kp=0.688 n=6
Parse Time2.81s (± 0.58%)2.80s (± 0.32%)~2.79s2.81sp=0.357 n=6
Bind Time1.10s (± 1.33%)1.10s (± 0.00%)~1.10s1.10sp=0.598 n=6
Check Time8.38s (± 0.71%)8.37s (± 0.65%)~8.29s8.46sp=0.806 n=6
Emit Time4.66s (± 0.81%)4.71s (± 0.94%)~4.66s4.78sp=0.053 n=6
Total Time16.95s (± 0.24%)16.98s (± 0.43%)~16.87s17.06sp=0.423 n=6
TFS - node (v14.21.3, x64)
Memory used296,202k (± 0.00%)296,207k (± 0.00%)~296,197k296,223kp=0.687 n=6
Parse Time2.42s (± 1.03%)2.43s (± 0.96%)~2.39s2.46sp=0.517 n=6
Bind Time1.08s (± 0.95%)1.08s (± 0.48%)~1.07s1.08sp=0.242 n=6
Check Time7.69s (± 0.59%)7.69s (± 0.40%)~7.65s7.74sp=0.574 n=6
Emit Time4.29s (± 0.61%)4.30s (± 0.46%)~4.28s4.33sp=0.333 n=6
Total Time15.48s (± 0.42%)15.50s (± 0.35%)~15.43s15.58sp=0.630 n=6
material-ui - node (v14.21.3, x64)
Memory used477,364k (± 0.01%)477,381k (± 0.00%)~477,370k477,404kp=0.378 n=6
Parse Time3.31s (± 0.48%)3.30s (± 0.30%)~3.29s3.31sp=0.157 n=6
Bind Time1.00s (± 0.55%)0.99s (± 0.64%)~0.98s1.00sp=0.201 n=6
Check Time19.27s (± 0.80%)19.36s (± 0.56%)~19.23s19.53sp=0.297 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time23.58s (± 0.66%)23.65s (± 0.46%)~23.54s23.81sp=0.468 n=6
xstate - node (v14.21.3, x64)
Memory used550,207k (± 0.00%)550,214k (± 0.01%)~550,164k550,250kp=0.873 n=6
Parse Time4.22s (± 0.49%)4.22s (± 0.68%)~4.19s4.26sp=0.808 n=6
Bind Time1.69s (± 0.99%)1.69s (± 1.75%)~1.63s1.71sp=0.505 n=6
Check Time3.11s (± 0.60%)3.10s (± 0.29%)~3.09s3.11sp=0.114 n=6
Emit Time0.09s (± 5.53%)0.09s (± 0.00%)~0.09s0.09sp=0.174 n=6
Total Time9.13s (± 0.44%)9.10s (± 0.38%)~9.06s9.15sp=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)
BenchmarkNameIterations
Current552686
Baselinemain6

TSServer

Comparison Report - main..55268
Metricmain55268DeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,544ms (± 0.42%)2,536ms (± 0.17%)~2,532ms2,544msp=0.149 n=6
Req 2 - geterr5,430ms (± 0.33%)5,401ms (± 0.64%)~5,353ms5,433msp=0.336 n=6
Req 3 - references343ms (± 1.19%)339ms (± 0.22%)-4ms (- 1.21%)338ms340msp=0.011 n=6
Req 4 - navto289ms (± 0.81%)289ms (± 0.36%)~287ms290msp=1.000 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo86ms (± 0.94%)87ms (± 0.60%)~86ms87msp=0.523 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen2,619ms (± 0.88%)2,623ms (± 0.53%)~2,597ms2,639msp=0.810 n=6
Req 2 - geterr4,146ms (± 0.60%)4,147ms (± 0.51%)~4,120ms4,181msp=0.936 n=6
Req 3 - references356ms (± 0.41%)355ms (± 0.37%)~353ms357msp=0.560 n=6
Req 4 - navto290ms (± 0.68%)291ms (± 0.67%)~288ms293msp=0.280 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo88ms (± 1.37%)88ms (± 1.02%)~87ms89msp=0.437 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen3,082ms (± 0.22%)3,087ms (± 0.37%)~3,068ms3,099msp=0.375 n=6
Req 2 - geterr1,562ms (± 0.96%)1,637ms (± 6.80%)~1,540ms1,796msp=0.199 n=6
Req 3 - references115ms (± 2.38%)113ms (± 2.13%)~109ms115msp=0.195 n=6
Req 4 - navto369ms (± 0.38%)373ms (± 1.26%)~368ms380msp=0.124 n=6
Req 5 - completionInfo count2,872 (± 0.00%)2,872 (± 0.00%)~2,8722,872p=1.000 n=6
Req 5 - completionInfo383ms (± 1.80%)381ms (± 2.14%)~371ms393msp=0.685 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,623ms (± 0.84%)2,605ms (± 0.50%)~2,593ms2,629msp=0.128 n=6
Req 2 - geterr6,074ms (± 0.48%)6,056ms (± 0.46%)~6,034ms6,109msp=0.297 n=6
Req 3 - references356ms (± 1.10%)356ms (± 0.81%)~354ms361msp=0.932 n=6
Req 4 - navto287ms (± 1.35%)287ms (± 0.78%)~284ms289msp=0.746 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo83ms (± 3.89%)81ms (± 0.64%)~80ms81msp=0.070 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen2,797ms (± 0.34%)2,798ms (± 0.86%)~2,756ms2,820msp=0.377 n=6
Req 2 - geterr4,702ms (± 0.37%)4,684ms (± 0.27%)~4,674ms4,708msp=0.092 n=6
Req 3 - references362ms (± 0.57%)365ms (± 0.48%)~362ms367msp=0.073 n=6
Req 4 - navto281ms (± 0.65%)282ms (± 1.46%)~277ms287msp=0.744 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo78ms (± 4.12%)77ms (± 1.09%)~75ms77msp=0.788 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen3,218ms (± 0.34%)3,226ms (± 0.28%)~3,218ms3,240msp=0.072 n=6
Req 2 - geterr1,694ms (± 0.47%)1,694ms (± 0.58%)~1,683ms1,712msp=0.872 n=6
Req 3 - references130ms (± 6.91%)131ms (± 7.91%)~123ms144msp=0.625 n=6
Req 4 - navto355ms (± 0.58%)354ms (± 0.56%)~350ms356msp=0.460 n=6
Req 5 - completionInfo count2,872 (± 0.00%)2,872 (± 0.00%)~2,8722,872p=1.000 n=6
Req 5 - completionInfo405ms (± 0.96%)410ms (± 1.42%)~399ms415msp=0.050 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,767ms (± 0.83%)2,767ms (± 0.28%)~2,760ms2,781msp=0.810 n=6
Req 2 - geterr6,240ms (± 0.38%)6,241ms (± 0.67%)~6,169ms6,294msp=0.748 n=6
Req 3 - references362ms (± 1.19%)362ms (± 1.10%)~359ms370msp=0.809 n=6
Req 4 - navto290ms (± 0.94%)290ms (± 0.48%)~288ms291msp=0.681 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo105ms (± 7.75%)105ms (± 7.73%)~91ms111msp=0.511 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen2,942ms (± 0.40%)2,932ms (± 0.32%)~2,920ms2,948msp=0.128 n=6
Req 2 - geterr4,589ms (± 0.35%)4,590ms (± 0.73%)~4,560ms4,649msp=0.748 n=6
Req 3 - references375ms (± 0.35%)376ms (± 0.40%)~374ms378msp=0.511 n=6
Req 4 - navto294ms (± 0.73%)294ms (± 0.96%)~291ms298msp=0.935 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo85ms (± 3.56%)83ms (± 0.91%)~82ms84msp=0.054 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen3,510ms (± 0.54%)3,501ms (± 0.51%)~3,474ms3,523msp=0.470 n=6
Req 2 - geterr1,813ms (± 0.43%)1,817ms (± 0.81%)~1,801ms1,844msp=0.520 n=6
Req 3 - references151ms (± 4.33%)143ms (± 8.49%)~130ms154msp=0.134 n=6
Req 4 - navto387ms (± 0.41%)387ms (± 0.16%)~386ms388msp=0.799 n=6
Req 5 - completionInfo count2,872 (± 0.00%)2,872 (± 0.00%)~2,8722,872p=1.000 n=6
Req 5 - completionInfo423ms (± 1.58%)418ms (± 0.79%)~414ms422msp=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)
BenchmarkNameIterations
Current552686
Baselinemain6

Startup

Comparison Report - main..55268
Metricmain55268DeltaBestWorstp-value
tsc-startup - node (v16.17.1, x64)
Execution time142.68ms (± 0.21%)142.95ms (± 0.21%)+0.27ms (+ 0.19%)142.16ms147.22msp=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time222.04ms (± 0.18%)223.02ms (± 0.19%)+0.98ms (+ 0.44%)221.69ms230.25msp=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time223.68ms (± 0.21%)224.98ms (± 0.29%)+1.31ms (+ 0.58%)223.13ms234.92msp=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time206.30ms (± 0.30%)206.69ms (± 0.23%)+0.40ms (+ 0.19%)205.22ms210.72msp=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)
BenchmarkNameIterations
Current552686
Baselinemain6

Developer Information:

Download Benchmark

@typescript-bot

Copy link
Copy Markdown
Contributor

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

@rbuckton
Ron Buckton (rbuckton) merged commit f0c3c3f into microsoft:mainAug 7, 2023
Jake Bailey (jakebailey) added a commit to jakebailey/TypeScript that referenced this pull request Nov 15, 2023
Mateusz Burzyński (Andarist) added a commit to Andarist/TypeScript that referenced this pull request Nov 28, 2023
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Andarist@typescript-bot@rbuckton