Skip to content

Conversation

@rbuckton
Copy link
Contributor

These nodes were added to attempt to preserve the emit behavior of an older version of the TypeScript compiler prior to the introduction of transforms. We're a long way away from TS 1.x at this point, and the complexity these nodes add aren't worth preserving specific emit as long as the resulting emit is compatible.

One thing of note is that in some cases we used to defer the emit of an export for a class until after static initializers or decorators have run. While that was intended to be consistent with native imports and exports when downleveling to CommonJS/System, our actual ES module emit fails to preserve this semantic. The only way to preserve this semantic consistently would be to wrap all downlevel classes that have statics/legacy decorators in IIFEs. However, IIFEs reduce readability and we've tried to avoid them unless absolutely necessary.

While it is technically feasible to access an undecorated class via an import with this change to CJS/System emit, it would be an exceedingly rare occurrence to do so accidentally. I think the slight non-conformance of the emit is worth the simplification of the AST and reduction in complexity for class-related transforms. Removing these marker nodes will also unblock the using declarations work.

If we find that we do want to adopt 100% semantic conformance for these exports, we can revisit wrapping such exported classes in IIFEs like we do for the new ES decorators emit.

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

Can you give an example of what semantic change this PR has? I'm having trouble coming up with something concrete before/after where you could access the undecorated class.

@rbuckton
Copy link
Contributor Author

An easier example would be downlevel emit for class static fields:

export class C {
  static x = 1;
}
// before:
// target: es2017
// module: commonjs
class C {
}
C.x = 1;
exports.C = C;

// target: es2017
// module: esnext
class C {
}
C.x = 1;
export { C };

// after:
// target: es2017
// module: commonjs
class C {
}
exports.C = C;
C.x = 1;

// target: es2017
// module: esnext
class C {
}
C.x = 1;
export { C };

The difference here is the ordering of C.x = 1 and exports.C = C. The new emit is more consistent with the current module: esnext emit, but the old emit was more correct. Native class fields and native exports would only initialize the export binding after the class is initialized.

The only way you can see the uninitialized (or undecorated) class is if you have a cycle in your imports and run code during initialization that references the exported version of the class:

// file.ts
import { C as C2 } from "./file";
export class C {
  static x = C2.y;
  static y = 2;
}

This isn't much different than the same code without the circular import, so it's not much of a footgun.

@rbuckton
Copy link
Contributor Author

It's important to note that export { C } is not executed as a statement. The export is essentially hoisted to the top of the file, so these two files are equivalent:

// a.ts
let x = 1;
export { x };

// b.ts
export { x };
let x = 1;

@jakebailey
Copy link
Member

Thanks for explaining! If it comes to it, how difficult is the change to make it fully semantically equivalent? I know you want this to unblock using, so from that perspective it seems fine, but I can say I'm slightly worried about esoteric codebases which may regress (like codebases as circular as ours).

I know esbuild's output is resilient to this, though I think that's because it defines module exports via defineProperty and thus can hoist everything like ESM first, then do the transform: https://jakebailey.dev/esbuild-playground/#Ly8gQGZpbGVuYW1lOiBjb25maWcuanNvbgp7CiAgImVudHJ5UG9pbnRzIjogWyIvaW5kZXgudHMiXSwKICAiZm9ybWF0IjogImNqcyIKfQoKLy8gQGZpbGVuYW1lOiBpbmRleC50cwpleHBvcnQgY2xhc3MgQyB7CiAgc3RhdGljIHggPSAxOwp9

@rbuckton
Copy link
Contributor Author

Thanks for explaining! If it comes to it, how difficult is the change to make it fully semantically equivalent? I know you want this to unblock using, so from that perspective it seems fine, but I can say I'm slightly worried about esoteric codebases which may regress (like codebases as circular as ours).

I know esbuild's output is resilient to this, though I think that's because it defines module exports via defineProperty and thus can hoist everything like ESM first, then do the transform: https://jakebailey.dev/esbuild-playground/#Ly8gQGZpbGVuYW1lOiBjb25maWcuanNvbgp7CiAgImVudHJ5UG9pbnRzIjogWyIvaW5kZXgudHMiXSwKICAiZm9ybWF0IjogImNqcyIKfQoKLy8gQGZpbGVuYW1lOiBpbmRleC50cwpleHBvcnQgY2xhc3MgQyB7CiAgc3RhdGljIHggPSAxOwp9

ESBuild isn't conformant with the spec either, since C is reachable from outside of the module before static fields are initialized. In the spec, the binding is only reachable after the class is initialized. See https://tc39.es/ecma262/#sec-runtime-semantics-bindingclassdeclarationevaluation.

@jakebailey
Copy link
Member

Sure, but in that case, would it just be undefined rather than some partially completed value?

@rbuckton
Copy link
Contributor Author

If it comes to it, how difficult is the change to make it fully semantically equivalent?

Not difficult, but it requires an IIFE. We intentionally did not do that because we preferred emit like:

class C {}
C.x = 1;

over

let C = (() => {
  class C {}
  C.x = 1;
  return C;
})();

and I'm pretty sure that opinion hasn't changed much, at least for static fields.

@rbuckton
Copy link
Contributor Author

Sure, but in that case, would it just be undefined rather than some partially completed value?

For ESBuild? No, it would be in TDZ until class C {} is evaluated, then reachable but partially initialized until C.x = 1; is evaluated.

@jakebailey
Copy link
Member

Sure, but in that case, would it just be undefined rather than some partially completed value?

For ESBuild? No, it would be in TDZ until class C {} is evaluated, then reachable but partially initialized until C.x = 1; is evaluated.

It's var C = class {} in the esbuild output, so I don't think there's TDZ unless I'm missing something.

@rbuckton
Copy link
Contributor Author

If it comes to it, how difficult is the change to make it fully semantically equivalent?

Not difficult, but it requires an IIFE. We intentionally did not do that because we preferred emit like: [...]

Note though, that while it may be "not difficult", it is compounded for each new class feature, i.e.:

let C = (() => {
  let C = (() => {
    class C {}
    C.x = 1;
    return C;
  })();
  C = __decorate(C, [dec]);
  return C;
})();

@rbuckton
Copy link
Contributor Author

It's var C = class {} in the esbuild output, so I don't think there's TDZ unless I'm missing something.

I stand corrected on that count. But there are still three observable states:

  1. Not initialized
  2. Partially initialized
  3. Fully initialized

@jakebailey
Copy link
Member

Right, and the way to get into the "partially initialized" state would be to try and use the class inside itself such that you get it before C.x = ... runs?

But yeah, it's effectively no better than what this PR does in that case.

@rbuckton
Copy link
Contributor Author

Right, and the way to get into the "partially initialized" state would be to try and use the class inside itself such that you get it before C.x = ... runs?

Essentially, yes, which is why I said it would be exceedingly rare to end up in that state accidentally.

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Given the discussion, this seems okay to me, though one of the other reviewers probably need to take a look.

@rbuckton
Copy link
Contributor Author

@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 Apr 20, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 20, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 20, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Apr 20, 2023

Heya @rbuckton, I've started to run the perf test suite on this PR at 4aad347. 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/53901/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Package install failed"

Otherwise...

Everything looks good!

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

Bit weird that you could observe the non-decorated class downlevel in some cases now, but if we're willing to accept that (and it seems like we are), this looks fine.

PartiallyEmittedExpression,
CommaListExpression,
MergeDeclarationMarker,
EndOfDeclarationMarker,
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave these in but toss a @deprecated and maybe a comment saying they're unused, at least until such a time were we direly need to reclaim the numbers? It might just be a lil' odd if we reuse these syntax kind numbers in the future. It'd reduce the API changes to zero, anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that necessary? The types they represented were /** @internal */, and the number values for SyntaxKind change often.

@typescript-bot
Copy link
Collaborator

Heya @rbuckton, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@rbuckton
Copy link
Contributor Author

Bit weird that you could observe the non-decorated class downlevel in some cases now, but if we're willing to accept that (and it seems like we are), this looks fine.

As I said up-thread, you can already observe them when using --module esnext (or --module nodenext) due to the mechanics of export { C }

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

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..53901
Metric main 53901 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 365,758k (± 0.01%) 365,760k (± 0.01%) ~ 365,716k 365,815k p=0.688 n=6
Parse Time 3.40s (± 0.74%) 3.40s (± 0.84%) ~ 3.37s 3.44s p=0.627 n=6
Bind Time 1.11s (± 0.57%) 1.11s (± 0.46%) ~ 1.11s 1.12s p=0.386 n=6
Check Time 8.70s (± 0.52%) 8.75s (± 0.39%) +0.06s (+ 0.65%) 8.73s 8.82s p=0.044 n=6
Emit Time 7.45s (± 0.70%) 7.43s (± 0.71%) ~ 7.37s 7.50s p=0.629 n=6
Total Time 20.66s (± 0.29%) 20.70s (± 0.50%) ~ 20.62s 20.88s p=0.422 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 190,987k (± 0.01%) 191,912k (± 1.19%) ~ 190,944k 196,588k p=1.000 n=6
Parse Time 1.50s (± 0.60%) 1.50s (± 0.78%) ~ 1.48s 1.51s p=0.933 n=6
Bind Time 0.77s (± 0.53%) 0.77s (± 0.97%) ~ 0.76s 0.78s p=1.000 n=6
Check Time 9.56s (± 0.84%) 9.63s (± 0.64%) ~ 9.53s 9.69s p=0.170 n=6
Emit Time 2.72s (± 0.79%) 2.76s (± 0.90%) +0.04s (+ 1.59%) 2.73s 2.80s p=0.015 n=6
Total Time 14.55s (± 0.44%) 14.66s (± 0.53%) +0.11s (+ 0.78%) 14.55s 14.75s p=0.036 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,501k (± 0.01%) 346,484k (± 0.01%) ~ 346,458k 346,535k p=0.470 n=6
Parse Time 2.60s (± 0.99%) 2.57s (± 1.17%) ~ 2.53s 2.61s p=0.146 n=6
Bind Time 1.01s (± 1.02%) 1.01s (± 0.88%) ~ 1.00s 1.02s p=0.673 n=6
Check Time 7.11s (± 0.31%) 7.19s (± 0.51%) +0.08s (+ 1.13%) 7.15s 7.24s p=0.005 n=6
Emit Time 4.21s (± 1.11%) 4.26s (± 0.95%) ~ 4.22s 4.31s p=0.053 n=6
Total Time 14.93s (± 0.38%) 15.03s (± 0.46%) +0.10s (+ 0.67%) 14.91s 15.11s p=0.044 n=6
TFS - node (v18.10.0, x64)
Memory used 300,749k (± 0.01%) 300,700k (± 0.01%) -49k (- 0.02%) 300,668k 300,723k p=0.013 n=6
Parse Time 2.05s (± 1.11%) 2.06s (± 1.00%) ~ 2.02s 2.08s p=0.368 n=6
Bind Time 1.14s (± 0.66%) 1.13s (± 0.87%) ~ 1.12s 1.14s p=0.102 n=6
Check Time 6.54s (± 0.55%) 6.60s (± 0.36%) +0.06s (+ 0.89%) 6.58s 6.64s p=0.024 n=6
Emit Time 3.89s (± 0.80%) 3.90s (± 0.74%) ~ 3.87s 3.94s p=0.629 n=6
Total Time 13.62s (± 0.40%) 13.69s (± 0.40%) ~ 13.62s 13.76s p=0.053 n=6
material-ui - node (v18.10.0, x64)
Memory used 482,298k (± 0.01%) 482,280k (± 0.02%) ~ 482,186k 482,387k p=0.810 n=6
Parse Time 3.11s (± 0.56%) 3.09s (± 0.43%) -0.02s (- 0.70%) 3.08s 3.11s p=0.039 n=6
Bind Time 0.91s (± 0.98%) 0.91s (± 0.90%) ~ 0.90s 0.92s p=0.550 n=6
Check Time 16.83s (± 0.85%) 16.87s (± 0.76%) ~ 16.77s 17.11s p=0.936 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.85s (± 0.73%) 20.87s (± 0.67%) ~ 20.76s 21.14s p=0.810 n=6
xstate - node (v18.10.0, x64)
Memory used 562,987k (± 0.02%) 563,057k (± 0.01%) ~ 563,000k 563,142k p=0.298 n=6
Parse Time 3.85s (± 0.42%) 3.85s (± 0.27%) ~ 3.84s 3.87s p=0.512 n=6
Bind Time 1.64s (± 0.84%) 1.66s (± 1.36%) ~ 1.62s 1.68s p=0.122 n=6
Check Time 2.81s (± 0.49%) 2.79s (± 1.27%) ~ 2.74s 2.84s p=0.250 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.38s (± 0.31%) 8.38s (± 0.59%) ~ 8.32s 8.45s p=0.686 n=6
Angular - node (v16.17.1, x64)
Memory used 365,175k (± 0.01%) 365,178k (± 0.02%) ~ 365,103k 365,269k p=0.748 n=6
Parse Time 3.53s (± 0.56%) 3.54s (± 0.59%) ~ 3.51s 3.57s p=0.683 n=6
Bind Time 1.18s (± 0.44%) 1.18s (± 0.00%) ~ 1.18s 1.18s p=0.174 n=6
Check Time 9.55s (± 0.39%) 9.59s (± 0.69%) ~ 9.48s 9.65s p=0.260 n=6
Emit Time 7.94s (± 0.74%) 7.98s (± 0.95%) ~ 7.88s 8.10s p=0.334 n=6
Total Time 22.20s (± 0.33%) 22.29s (± 0.54%) ~ 22.09s 22.46s p=0.054 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,663k (± 0.03%) 193,059k (± 0.51%) ~ 192,542k 195,079k p=0.689 n=6
Parse Time 1.59s (± 1.32%) 1.59s (± 1.90%) ~ 1.53s 1.61s p=1.000 n=6
Bind Time 0.83s (± 0.76%) 0.83s (± 0.99%) ~ 0.82s 0.84s p=0.432 n=6
Check Time 10.23s (± 0.58%) 10.25s (± 0.77%) ~ 10.17s 10.38s p=0.688 n=6
Emit Time 2.98s (± 0.98%) 3.02s (± 0.39%) +0.04s (+ 1.23%) 3.00s 3.03s p=0.023 n=6
Total Time 15.63s (± 0.47%) 15.68s (± 0.56%) ~ 15.55s 15.81s p=0.423 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,776k (± 0.01%) 345,792k (± 0.00%) ~ 345,777k 345,804k p=0.229 n=6
Parse Time 2.73s (± 0.43%) 2.73s (± 0.60%) ~ 2.71s 2.75s p=0.568 n=6
Bind Time 1.08s (± 0.50%) 1.09s (± 0.77%) ~ 1.07s 1.09s p=0.855 n=6
Check Time 7.84s (± 0.61%) 7.87s (± 0.47%) ~ 7.82s 7.92s p=0.229 n=6
Emit Time 4.46s (± 0.77%) 4.44s (± 0.56%) ~ 4.42s 4.48s p=0.681 n=6
Total Time 16.10s (± 0.39%) 16.13s (± 0.46%) ~ 16.02s 16.22s p=0.575 n=6
TFS - node (v16.17.1, x64)
Memory used 300,056k (± 0.01%) 300,059k (± 0.01%) ~ 300,030k 300,091k p=0.936 n=6
Parse Time 2.15s (± 0.54%) 2.16s (± 0.68%) ~ 2.15s 2.18s p=0.242 n=6
Bind Time 1.23s (± 1.08%) 1.24s (± 0.85%) ~ 1.22s 1.25s p=0.314 n=6
Check Time 7.22s (± 0.34%) 7.24s (± 0.51%) ~ 7.19s 7.30s p=0.189 n=6
Emit Time 4.36s (± 1.06%) 4.38s (± 0.49%) ~ 4.37s 4.42s p=0.361 n=6
Total Time 14.97s (± 0.47%) 15.02s (± 0.37%) ~ 14.96s 15.12s p=0.334 n=6
material-ui - node (v16.17.1, x64)
Memory used 481,572k (± 0.01%) 481,559k (± 0.01%) ~ 481,515k 481,587k p=0.230 n=6
Parse Time 3.26s (± 0.19%) 3.25s (± 0.32%) ~ 3.24s 3.27s p=0.203 n=6
Bind Time 0.94s (± 1.41%) 0.94s (± 0.43%) ~ 0.93s 0.94s p=0.446 n=6
Check Time 17.91s (± 1.02%) 17.95s (± 0.86%) ~ 17.76s 18.14s p=0.873 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.11s (± 0.83%) 22.14s (± 0.67%) ~ 21.96s 22.32s p=0.810 n=6
xstate - node (v16.17.1, x64)
Memory used 560,528k (± 0.01%) 560,586k (± 0.01%) ~ 560,506k 560,675k p=0.173 n=6
Parse Time 3.99s (± 0.65%) 4.00s (± 0.65%) ~ 3.96s 4.04s p=0.629 n=6
Bind Time 1.77s (± 0.50%) 1.77s (± 0.31%) ~ 1.77s 1.78s p=0.341 n=6
Check Time 3.03s (± 0.64%) 3.05s (± 0.60%) ~ 3.03s 3.08s p=0.102 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.89s (± 0.52%) 8.92s (± 0.40%) ~ 8.88s 8.97s p=0.293 n=6
Angular - node (v14.21.3, x64)
Memory used 359,178k (± 0.00%) 359,175k (± 0.00%) ~ 359,169k 359,186k p=0.748 n=6
Parse Time 3.68s (± 0.79%) 3.68s (± 0.33%) ~ 3.67s 3.70s p=0.317 n=6
Bind Time 1.21s (± 1.12%) 1.22s (± 0.52%) ~ 1.21s 1.23s p=0.108 n=6
Check Time 9.93s (± 0.48%) 10.04s (± 0.30%) +0.10s (+ 1.04%) 9.99s 10.08s p=0.005 n=6
Emit Time 8.29s (± 1.03%) 8.40s (± 1.27%) ~ 8.27s 8.56s p=0.077 n=6
Total Time 23.12s (± 0.49%) 23.34s (± 0.50%) +0.22s (+ 0.94%) 23.20s 23.51s p=0.020 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 187,996k (± 0.02%) 188,032k (± 0.02%) ~ 187,973k 188,092k p=0.128 n=6
Parse Time 1.61s (± 0.52%) 1.61s (± 0.75%) ~ 1.60s 1.63s p=0.276 n=6
Bind Time 0.85s (± 0.00%) 0.85s (± 0.48%) ~ 0.84s 0.85s p=0.405 n=6
Check Time 10.39s (± 0.47%) 10.37s (± 0.63%) ~ 10.26s 10.45s p=0.936 n=6
Emit Time 3.14s (± 1.13%) 3.16s (± 0.85%) ~ 3.12s 3.20s p=0.286 n=6
Total Time 15.98s (± 0.33%) 16.00s (± 0.45%) ~ 15.91s 16.11s p=0.936 n=6
Monaco - node (v14.21.3, x64)
Memory used 340,865k (± 0.01%) 340,876k (± 0.01%) ~ 340,828k 340,901k p=0.230 n=6
Parse Time 2.80s (± 0.35%) 2.80s (± 0.29%) ~ 2.79s 2.81s p=0.862 n=6
Bind Time 1.10s (± 1.36%) 1.11s (± 0.89%) ~ 1.10s 1.12s p=0.601 n=6
Check Time 8.13s (± 0.43%) 8.19s (± 0.22%) +0.06s (+ 0.72%) 8.17s 8.22s p=0.006 n=6
Emit Time 4.68s (± 1.01%) 4.69s (± 0.70%) ~ 4.64s 4.73s p=0.808 n=6
Total Time 16.71s (± 0.41%) 16.78s (± 0.29%) ~ 16.73s 16.85s p=0.092 n=6
TFS - node (v14.21.3, x64)
Memory used 295,246k (± 0.00%) 295,244k (± 0.00%) ~ 295,231k 295,255k p=0.872 n=6
Parse Time 2.39s (± 1.04%) 2.39s (± 0.89%) ~ 2.37s 2.43s p=0.808 n=6
Bind Time 1.07s (± 0.76%) 1.07s (± 0.76%) ~ 1.06s 1.08s p=1.000 n=6
Check Time 7.52s (± 0.58%) 7.56s (± 0.34%) ~ 7.53s 7.59s p=0.064 n=6
Emit Time 4.29s (± 0.54%) 4.38s (± 0.62%) +0.09s (+ 2.06%) 4.35s 4.41s p=0.005 n=6
Total Time 15.27s (± 0.49%) 15.39s (± 0.35%) +0.13s (+ 0.84%) 15.32s 15.46s p=0.010 n=6
material-ui - node (v14.21.3, x64)
Memory used 477,150k (± 0.00%) 477,152k (± 0.00%) ~ 477,132k 477,169k p=0.689 n=6
Parse Time 3.35s (± 0.31%) 3.34s (± 0.44%) ~ 3.31s 3.35s p=0.310 n=6
Bind Time 1.01s (± 0.81%) 1.00s (± 0.51%) ~ 1.00s 1.01s p=0.235 n=6
Check Time 18.77s (± 0.48%) 18.87s (± 0.55%) ~ 18.67s 18.96s p=0.128 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.13s (± 0.34%) 23.21s (± 0.46%) ~ 23.01s 23.31s p=0.173 n=6
xstate - node (v14.21.3, x64)
Memory used 549,550k (± 0.01%) 549,528k (± 0.00%) ~ 549,496k 549,558k p=0.298 n=6
Parse Time 4.29s (± 2.00%) 4.22s (± 0.55%) ~ 4.18s 4.25s p=0.261 n=6
Bind Time 1.58s (± 4.44%) 1.61s (± 2.29%) ~ 1.57s 1.66s p=0.627 n=6
Check Time 3.18s (± 0.67%) 3.20s (± 0.32%) ~ 3.18s 3.21s p=0.124 n=6
Emit Time 0.09s (± 5.76%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=0.071 n=6
Total Time 9.14s (± 0.58%) 9.12s (± 0.64%) ~ 9.04s 9.19s p=0.298 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 53901 6
Baseline main 6

TSServer

Comparison Report - main..53901
Metric main 53901 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,559ms (± 1.20%) 2,542ms (± 0.38%) ~ 2,529ms 2,555ms p=0.294 n=6
Req 2 - geterr 5,641ms (± 2.02%) 5,725ms (± 0.61%) ~ 5,674ms 5,758ms p=0.128 n=6
Req 3 - references 342ms (± 0.95%) 344ms (± 0.40%) ~ 342ms 346ms p=0.511 n=6
Req 4 - navto 284ms (± 0.72%) 283ms (± 0.58%) ~ 280ms 285ms p=0.215 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 79ms (±11.55%) 85ms (± 0.96%) ~ 83ms 85ms p=0.214 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,644ms (± 0.26%) 2,656ms (± 0.72%) ~ 2,633ms 2,681ms p=0.471 n=6
Req 2 - geterr 4,249ms (± 0.57%) 4,291ms (± 0.70%) +42ms (+ 0.98%) 4,256ms 4,329ms p=0.031 n=6
Req 3 - references 348ms (± 0.73%) 349ms (± 0.42%) ~ 347ms 350ms p=0.277 n=6
Req 4 - navto 289ms (± 0.36%) 289ms (± 0.52%) ~ 288ms 292ms p=0.867 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 62ms (± 1.21%) 62ms (± 0.83%) ~ 62ms 63ms p=0.784 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,074ms (± 0.40%) 3,067ms (± 0.55%) ~ 3,038ms 3,085ms p=0.470 n=6
Req 2 - geterr 1,615ms (± 0.95%) 1,624ms (± 1.55%) ~ 1,595ms 1,652ms p=0.521 n=6
Req 3 - references 108ms (± 1.94%) 106ms (± 1.14%) ~ 105ms 108ms p=0.167 n=6
Req 4 - navto 363ms (± 0.41%) 364ms (± 0.52%) ~ 362ms 367ms p=0.615 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 374ms (± 2.37%) 379ms (± 1.95%) ~ 365ms 385ms p=0.335 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,666ms (± 0.80%) 2,681ms (± 1.08%) ~ 2,639ms 2,724ms p=0.261 n=6
Req 2 - geterr 6,137ms (± 0.49%) 6,124ms (± 1.82%) ~ 5,898ms 6,192ms p=0.471 n=6
Req 3 - references 353ms (± 1.08%) 354ms (± 1.00%) ~ 349ms 358ms p=0.466 n=6
Req 4 - navto 285ms (± 0.52%) 283ms (± 0.69%) ~ 280ms 285ms p=0.150 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 85ms (± 7.22%) 81ms (± 5.58%) ~ 73ms 87ms p=0.935 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,829ms (± 0.64%) 2,833ms (± 0.79%) ~ 2,792ms 2,853ms p=0.630 n=6
Req 2 - geterr 4,619ms (± 0.46%) 4,627ms (± 2.00%) ~ 4,441ms 4,685ms p=0.128 n=6
Req 3 - references 363ms (± 0.65%) 366ms (± 1.30%) ~ 362ms 375ms p=0.373 n=6
Req 4 - navto 284ms (± 0.95%) 283ms (± 1.34%) ~ 278ms 289ms p=0.567 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 67ms (± 1.21%) 68ms (± 1.11%) ~ 67ms 69ms p=0.383 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,217ms (± 0.41%) 3,230ms (± 0.16%) ~ 3,221ms 3,236ms p=0.093 n=6
Req 2 - geterr 1,757ms (± 0.85%) 1,769ms (± 0.58%) ~ 1,757ms 1,784ms p=0.173 n=6
Req 3 - references 121ms (± 1.34%) 127ms (± 6.53%) ~ 120ms 143ms p=0.052 n=6
Req 4 - navto 342ms (± 0.63%) 343ms (± 0.77%) ~ 339ms 347ms p=0.466 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 398ms (± 1.39%) 399ms (± 0.84%) ~ 395ms 403ms p=0.629 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,780ms (± 0.64%) 2,779ms (± 0.37%) ~ 2,766ms 2,791ms p=1.000 n=6
Req 2 - geterr 6,298ms (± 0.39%) 6,305ms (± 0.52%) ~ 6,247ms 6,340ms p=0.575 n=6
Req 3 - references 365ms (± 1.10%) 369ms (± 1.42%) ~ 363ms 376ms p=0.293 n=6
Req 4 - navto 292ms (± 1.06%) 290ms (± 0.69%) ~ 288ms 293ms p=0.318 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 98ms (± 7.67%) 99ms (± 4.69%) ~ 92ms 103ms p=0.627 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,958ms (± 0.56%) 2,951ms (± 0.45%) ~ 2,934ms 2,972ms p=0.575 n=6
Req 2 - geterr 4,516ms (± 0.34%) 4,543ms (± 0.30%) +27ms (+ 0.60%) 4,528ms 4,562ms p=0.008 n=6
Req 3 - references 374ms (± 0.43%) 376ms (± 0.50%) ~ 373ms 378ms p=0.168 n=6
Req 4 - navto 295ms (± 0.63%) 296ms (± 0.66%) ~ 293ms 298ms p=0.681 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 76ms (± 1.80%) 76ms (± 1.18%) ~ 75ms 77ms p=0.803 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,463ms (± 1.13%) 3,459ms (± 0.82%) ~ 3,409ms 3,491ms p=0.575 n=6
Req 2 - geterr 1,849ms (± 1.21%) 1,871ms (± 0.42%) ~ 1,859ms 1,880ms p=0.078 n=6
Req 3 - references 128ms (± 2.45%) 145ms (± 9.16%) +16ms (+12.73%) 132ms 163ms p=0.008 n=6
Req 4 - navto 396ms (± 0.90%) 396ms (± 0.85%) ~ 392ms 402ms p=1.000 n=6
Req 5 - completionInfo count 2,862 (± 0.00%) 2,862 (± 0.00%) ~ 2,862 2,862 p=1.000 n=6
Req 5 - completionInfo 430ms (± 1.50%) 430ms (± 2.67%) ~ 407ms 438ms p=0.629 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 53901 6
Baseline main 6

Startup

Comparison Report - main..53901
Metric main 53901 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 142.15ms (± 0.20%) 142.14ms (± 0.22%) ~ 141.35ms 147.28ms p=0.190 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 220.90ms (± 0.18%) 220.86ms (± 0.20%) -0.03ms (- 0.02%) 219.88ms 228.49ms p=0.007 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 222.19ms (± 0.14%) 222.16ms (± 0.15%) -0.02ms (- 0.01%) 221.24ms 226.75ms p=0.020 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 203.92ms (± 0.16%) 203.93ms (± 0.21%) ~ 203.09ms 214.13ms p=0.145 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-135-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 53901 6
Baseline main 6

Developer Information:

Download Benchmark

@rbuckton rbuckton merged commit 36b6325 into main Apr 21, 2023
@rbuckton rbuckton deleted the remove-EndOfDeclarationMarker branch April 21, 2023 21:21
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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