Skip to content

Conversation

@Andarist
Copy link
Contributor

fixes #53109

I'm not 100% sure of this change but I can't find why a non-aliased mapped type would have to be rewritten. The PR that introduced this rewriting also mentions explicitly that it's about "inlined mapped types" (PR here) so I think that the ones that are already inline can be just left as-is.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 12, 2023
return isMappedTypeWithKeyofConstraintDeclaration(type)
&& !(getModifiersTypeFromMappedType(type).flags & TypeFlags.TypeParameter);
&& !(getModifiersTypeFromMappedType(type).flags & TypeFlags.TypeParameter)
&& !!type.aliasSymbol;
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't have anything to do with the alias symbol as by the time we're trying to print with this function, the alias symbol has already been discarded as an option for printing the mapped type. Instead, what we care about is if the type will be picked up as a homomorphic type variable (or not). Type parameters always are, so were a conservative initial choice - it's generally safe to wrap anything else which is still recognized as a homomorphic type variable up and present it as a type parameter, too - all you get is unnecessarily verbose printback sometimes. Instead of checking the alias symbol here (which seems pretty unrelated), you want to check, rather than if the modifiers type is still a type parameter, if an index on the modifiers type still produces a homomorphic type variable. In this case, an index of a mapped type just returns the inner mapped type's constraint type, which can then be unwrapped, so it is recognized as homomorphic. So, instead of the simple, conservative !(getModifiersTypeFromMappedType(type).flags & TypeFlags.TypeParameter) check, you want something to more closely mirror getHomomorphicTypeVariable's conditions like

                let index: Type;
                return isMappedTypeWithKeyofConstraintDeclaration(type)
                    && (index = getIndexType(getModifiersTypeFromMappedType(type)), !(index.flags & TypeFlags.Index && (index as IndexType).type.flags & TypeFlags.TypeParameter)))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied the suggested change but it reverted the change to the emit of this thing (TS playground):

export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export declare type PartialProperties<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
export function doSomething_Actual<T extends {
    prop: string;
}>(a: T) {
    const x: { [P in keyof PartialProperties<T, "prop">]: PartialProperties<T, "prop">[P]; } = null as any;
    return x;
}

Does this one have to be rewritten? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Probably not, since, in that case, I don't think PartialProperties is homomorphic, so the wrapping mapped type shouldn't be either. Right now we're using isMappedTypeWithKeyofConstraintDeclaration as a proxy for was-this-declared-as-homomorphic - we probably need to swap that out for something a bit more accurate, too. Potentially the same check we're doing on type but on type.target (and negated)?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, it's not actually homomorphic -

doSomething_Actual<{prop: string, propb: string} | {prop: string, propa: string}>(null as any);

ends up with type

{
    prop?: string | undefined;
}

so we just need to tighten up that side of the check, too.

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 particular mapped type doesn't have a .target property - I might have misunderstood your recommendation for the proposed changes but for now, I've chosen to just avoid rewriting in case of !type.target. I think this is correct (it yields the expected result for this case and the rest of the test suite) but maybe I'm missing some further details.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, that's perfect - if the mapped type doesn't have a .target, then leaving it as-is is always correct - it's still it's declared form, uninstantiated.

@Andarist Andarist changed the title Avoid rewriting mapped types that are already inline Avoid rewriting homomorphic mapped types with homomorphic instantiations Mar 15, 2023
@Andarist Andarist requested a review from weswigham March 15, 2023 08:59
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.

Yeah, let's replace the isMappedTypeWithKeyofConstraintDeclaration check with something that more accurately checks if the declared type was homomorphic (eg, by doing the same check we do to see if type is homomorphic, but on type.target) - that should be the last piece needed here, I think.

Comment on lines 6627 to 6632
function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type: MappedType) {
return isMappedTypeWithKeyofConstraintDeclaration(type)
&& !(getModifiersTypeFromMappedType(type).flags & TypeFlags.TypeParameter);
if (!type.target || !isMappedTypeWithKeyofConstraintDeclaration(type)) {
return false;
}
const index = getIndexType(getModifiersTypeFromMappedType(type));
return !(index.flags & TypeFlags.Index && (index as IndexType).type.flags & TypeFlags.TypeParameter);
Copy link
Member

Choose a reason for hiding this comment

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

So I was thinking something like

function isMappedTypeHomomorphic(type: MappedType) {
    return !!getHomomorphicTypeVariable(type);
}

function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type: MappedType) {
    return !type.target ? false : isMappedTypeHomomorphic(type.target) && !isMappedTypeHomomorphic(type);
}

Looks easier to reason about a bit, too, by replacing the complex check I proposed before with a direct getHomomorphicTypeVariable call on the type and its' target.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice, this is definitely is easier to reason about 👍 pushed out the suggested change

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.

let's just double check the tests...

@weswigham
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 20, 2023

Heya @weswigham, I've started to run the diff-based top-repos suite on this PR at 4b6afba. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 20, 2023

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 20, 2023

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 20, 2023

Heya @weswigham, I've started to run the perf test suite on this PR at 4b6afba. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..53215
Metric main 53215 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 361,706k (± 0.01%) 361,704k (± 0.01%) ~ 361,672k 361,730k p=1.000 n=6
Parse Time 3.38s (± 0.48%) 3.38s (± 0.69%) ~ 3.35s 3.42s p=1.000 n=6
Bind Time 1.12s (± 0.67%) 1.12s (± 0.49%) ~ 1.11s 1.12s p=0.137 n=6
Check Time 8.66s (± 0.42%) 8.68s (± 0.45%) ~ 8.65s 8.73s p=0.744 n=6
Emit Time 7.48s (± 0.76%) 7.43s (± 0.62%) ~ 7.37s 7.51s p=0.170 n=6
Total Time 20.64s (± 0.34%) 20.61s (± 0.41%) ~ 20.52s 20.77s p=0.573 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 193,702k (± 1.57%) 191,843k (± 1.19%) ~ 190,861k 196,522k p=0.230 n=6
Parse Time 1.51s (± 1.00%) 1.51s (± 0.50%) ~ 1.50s 1.52s p=0.864 n=6
Bind Time 0.77s (± 1.42%) 0.76s (± 0.54%) ~ 0.76s 0.77s p=0.100 n=6
Check Time 9.43s (± 0.92%) 9.43s (± 0.38%) ~ 9.39s 9.48s p=0.630 n=6
Emit Time 2.73s (± 0.60%) 2.72s (± 0.55%) ~ 2.71s 2.74s p=0.284 n=6
Total Time 14.44s (± 0.73%) 14.43s (± 0.33%) ~ 14.37s 14.48s p=0.748 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,257k (± 0.01%) 346,256k (± 0.01%) ~ 346,218k 346,271k p=0.810 n=6
Parse Time 2.60s (± 0.75%) 2.59s (± 0.69%) ~ 2.57s 2.62s p=0.330 n=6
Bind Time 1.01s (± 0.81%) 1.01s (± 0.81%) ~ 1.00s 1.02s p=1.000 n=6
Check Time 7.07s (± 0.54%) 7.04s (± 0.42%) ~ 6.99s 7.08s p=0.090 n=6
Emit Time 4.25s (± 1.07%) 4.23s (± 0.43%) ~ 4.21s 4.25s p=0.629 n=6
Total Time 14.93s (± 0.55%) 14.87s (± 0.27%) ~ 14.83s 14.93s p=0.108 n=6
TFS - node (v18.10.0, x64)
Memory used 300,462k (± 0.01%) 300,448k (± 0.01%) ~ 300,420k 300,482k p=0.378 n=6
Parse Time 2.05s (± 0.57%) 2.08s (± 1.30%) +0.03s (+ 1.46%) 2.06s 2.13s p=0.018 n=6
Bind Time 1.14s (± 0.90%) 1.14s (± 0.66%) ~ 1.13s 1.15s p=0.437 n=6
Check Time 6.50s (± 0.32%) 6.55s (± 0.38%) +0.05s (+ 0.82%) 6.53s 6.60s p=0.006 n=6
Emit Time 3.88s (± 1.30%) 3.87s (± 0.81%) ~ 3.84s 3.91s p=0.935 n=6
Total Time 13.56s (± 0.32%) 13.64s (± 0.18%) +0.07s (+ 0.54%) 13.61s 13.68s p=0.024 n=6
material-ui - node (v18.10.0, x64)
Memory used 477,134k (± 0.01%) 477,214k (± 0.01%) +80k (+ 0.02%) 477,162k 477,264k p=0.031 n=6
Parse Time 3.02s (± 3.20%) 3.05s (± 1.36%) ~ 2.98s 3.10s p=0.686 n=6
Bind Time 0.99s (± 8.59%) 0.94s (± 7.30%) ~ 0.91s 1.08s p=0.455 n=6
Check Time 17.01s (± 0.75%) 16.91s (± 0.80%) ~ 16.79s 17.17s p=0.230 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 21.01s (± 0.65%) 20.90s (± 0.82%) ~ 20.76s 21.23s p=0.230 n=6
xstate - node (v18.10.0, x64)
Memory used 552,916k (± 0.01%) 552,923k (± 0.01%) ~ 552,830k 553,031k p=0.689 n=6
Parse Time 3.76s (± 0.58%) 3.78s (± 0.48%) ~ 3.76s 3.81s p=0.101 n=6
Bind Time 1.70s (± 0.30%) 1.70s (± 0.58%) ~ 1.69s 1.71s p=0.931 n=6
Check Time 2.75s (± 1.14%) 2.75s (± 0.15%) ~ 2.74s 2.75s p=0.929 n=6
Emit Time 0.08s (± 4.99%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=0.405 n=6
Total Time 8.31s (± 0.46%) 8.32s (± 0.20%) ~ 8.30s 8.35s p=0.514 n=6
Angular - node (v16.17.1, x64)
Memory used 361,045k (± 0.01%) 361,058k (± 0.01%) ~ 361,022k 361,103k p=0.336 n=6
Parse Time 3.52s (± 0.78%) 3.53s (± 0.89%) ~ 3.48s 3.57s p=0.747 n=6
Bind Time 1.19s (± 0.69%) 1.18s (± 0.83%) ~ 1.17s 1.20s p=0.282 n=6
Check Time 9.47s (± 0.48%) 9.47s (± 0.26%) ~ 9.44s 9.51s p=1.000 n=6
Emit Time 7.93s (± 0.71%) 7.93s (± 0.45%) ~ 7.88s 7.99s p=0.630 n=6
Total Time 22.11s (± 0.43%) 22.11s (± 0.24%) ~ 22.05s 22.21s p=0.572 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 193,656k (± 0.92%) 192,566k (± 0.03%) ~ 192,490k 192,656k p=0.689 n=6
Parse Time 1.60s (± 0.56%) 1.58s (± 2.24%) ~ 1.54s 1.62s p=0.806 n=6
Bind Time 0.82s (± 0.63%) 0.82s (± 1.20%) ~ 0.81s 0.84s p=0.504 n=6
Check Time 10.17s (± 0.90%) 10.12s (± 0.49%) ~ 10.08s 10.22s p=0.170 n=6
Emit Time 3.00s (± 1.11%) 2.99s (± 0.75%) ~ 2.96s 3.03s p=0.871 n=6
Total Time 15.59s (± 0.60%) 15.52s (± 0.31%) ~ 15.47s 15.60s p=0.091 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,573k (± 0.00%) 345,558k (± 0.00%) -15k (- 0.00%) 345,539k 345,579k p=0.045 n=6
Parse Time 2.73s (± 0.78%) 2.73s (± 0.68%) ~ 2.71s 2.76s p=0.806 n=6
Bind Time 1.10s (± 1.06%) 1.08s (± 0.48%) -0.02s (- 1.37%) 1.08s 1.09s p=0.014 n=6
Check Time 7.71s (± 0.13%) 7.70s (± 0.46%) ~ 7.64s 7.74s p=0.373 n=6
Emit Time 4.47s (± 0.75%) 4.48s (± 0.41%) ~ 4.46s 4.50s p=0.746 n=6
Total Time 16.02s (± 0.19%) 16.00s (± 0.38%) ~ 15.94s 16.09s p=0.422 n=6
TFS - node (v16.17.1, x64)
Memory used 299,785k (± 0.01%) 299,818k (± 0.01%) ~ 299,754k 299,853k p=0.093 n=6
Parse Time 2.16s (± 0.54%) 2.17s (± 0.75%) ~ 2.16s 2.20s p=0.115 n=6
Bind Time 1.23s (± 0.66%) 1.24s (± 0.79%) ~ 1.23s 1.25s p=0.498 n=6
Check Time 7.19s (± 0.56%) 7.17s (± 0.30%) ~ 7.15s 7.21s p=0.260 n=6
Emit Time 4.36s (± 1.21%) 4.34s (± 1.11%) ~ 4.29s 4.41s p=0.687 n=6
Total Time 14.94s (± 0.53%) 14.93s (± 0.22%) ~ 14.89s 14.97s p=1.000 n=6
material-ui - node (v16.17.1, x64)
Memory used 476,430k (± 0.01%) 476,467k (± 0.02%) ~ 476,399k 476,616k p=0.470 n=6
Parse Time 3.22s (± 0.57%) 3.21s (± 1.02%) ~ 3.15s 3.25s p=1.000 n=6
Bind Time 0.95s (± 0.54%) 0.96s (± 1.61%) ~ 0.95s 0.99s p=0.523 n=6
Check Time 17.93s (± 0.42%) 17.86s (± 0.39%) ~ 17.80s 17.97s 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 22.10s (± 0.38%) 22.03s (± 0.36%) ~ 21.94s 22.14s p=0.147 n=6
xstate - node (v16.17.1, x64)
Memory used 550,520k (± 0.01%) 550,562k (± 0.02%) ~ 550,479k 550,726k p=0.471 n=6
Parse Time 3.95s (± 0.35%) 3.95s (± 0.35%) ~ 3.93s 3.96s p=1.000 n=6
Bind Time 1.81s (± 0.54%) 1.79s (± 0.71%) -0.02s (- 1.01%) 1.78s 1.81s p=0.029 n=6
Check Time 2.99s (± 0.68%) 2.99s (± 0.80%) ~ 2.97s 3.03s p=1.000 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.83s (± 0.38%) 8.82s (± 0.41%) ~ 8.78s 8.87s p=0.469 n=6
Angular - node (v14.15.1, x64)
Memory used 354,915k (± 0.01%) 354,903k (± 0.01%) ~ 354,852k 354,971k p=0.810 n=6
Parse Time 3.61s (± 0.83%) 3.62s (± 0.67%) ~ 3.58s 3.65s p=1.000 n=6
Bind Time 1.24s (± 0.66%) 1.23s (± 0.42%) ~ 1.23s 1.24s p=0.523 n=6
Check Time 9.81s (± 0.47%) 9.84s (± 0.25%) ~ 9.81s 9.87s p=0.261 n=6
Emit Time 8.39s (± 1.09%) 8.34s (± 0.71%) ~ 8.24s 8.40s p=0.630 n=6
Total Time 23.06s (± 0.58%) 23.02s (± 0.28%) ~ 22.90s 23.07s p=1.000 n=6
Compiler-Unions - node (v14.15.1, x64)
Memory used 187,777k (± 0.01%) 187,791k (± 0.01%) ~ 187,760k 187,818k p=0.149 n=6
Parse Time 1.60s (± 0.56%) 1.60s (± 0.52%) ~ 1.59s 1.61s p=0.339 n=6
Bind Time 0.85s (± 1.73%) 0.85s (± 1.43%) ~ 0.84s 0.87s p=0.383 n=6
Check Time 10.28s (± 0.54%) 10.28s (± 0.68%) ~ 10.17s 10.36s p=1.000 n=6
Emit Time 3.13s (± 0.56%) 3.13s (± 1.19%) ~ 3.10s 3.19s p=0.567 n=6
Total Time 15.86s (± 0.36%) 15.86s (± 0.47%) ~ 15.72s 15.94s p=0.936 n=6
Monaco - node (v14.15.1, x64)
Memory used 340,548k (± 0.01%) 340,551k (± 0.00%) ~ 340,527k 340,562k p=1.000 n=6
Parse Time 2.83s (± 0.48%) 2.83s (± 0.37%) ~ 2.82s 2.85s p=0.804 n=6
Bind Time 1.10s (± 0.68%) 1.10s (± 0.81%) ~ 1.09s 1.11s p=0.798 n=6
Check Time 8.11s (± 0.26%) 8.14s (± 0.41%) ~ 8.10s 8.18s p=0.105 n=6
Emit Time 4.70s (± 0.58%) 4.68s (± 0.46%) ~ 4.65s 4.70s p=0.324 n=6
Total Time 16.75s (± 0.18%) 16.76s (± 0.35%) ~ 16.69s 16.83s p=0.936 n=6
TFS - node (v14.15.1, x64)
Memory used 294,890k (± 0.00%) 294,887k (± 0.00%) ~ 294,874k 294,902k p=0.630 n=6
Parse Time 2.39s (± 0.57%) 2.40s (± 1.17%) ~ 2.37s 2.44s p=0.370 n=6
Bind Time 1.07s (± 0.78%) 1.07s (± 0.59%) ~ 1.06s 1.08s p=0.226 n=6
Check Time 7.54s (± 0.49%) 7.52s (± 0.60%) ~ 7.47s 7.59s p=0.469 n=6
Emit Time 4.28s (± 0.39%) 4.29s (± 0.90%) ~ 4.24s 4.34s p=0.935 n=6
Total Time 15.27s (± 0.40%) 15.28s (± 0.30%) ~ 15.22s 15.35s p=0.872 n=6
material-ui - node (v14.15.1, x64)
Memory used 471,958k (± 0.01%) 471,982k (± 0.00%) ~ 471,956k 471,996k p=0.128 n=6
Parse Time 3.36s (± 0.44%) 3.35s (± 0.49%) ~ 3.33s 3.37s p=0.144 n=6
Bind Time 1.00s (± 0.83%) 1.00s (± 0.89%) ~ 0.99s 1.01s p=0.339 n=6
Check Time 18.91s (± 0.49%) 18.84s (± 0.41%) ~ 18.74s 18.95s p=0.296 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.28s (± 0.34%) 23.19s (± 0.43%) ~ 23.07s 23.34s p=0.173 n=6
xstate - node (v14.15.1, x64)
Memory used 539,126k (± 0.00%) 539,143k (± 0.00%) ~ 539,112k 539,163k p=0.170 n=6
Parse Time 4.22s (± 0.49%) 4.21s (± 0.39%) ~ 4.19s 4.23s p=0.328 n=6
Bind Time 1.67s (± 0.31%) 1.66s (± 0.38%) -0.01s (- 0.80%) 1.65s 1.67s p=0.009 n=6
Check Time 3.15s (± 0.68%) 3.12s (± 0.55%) ~ 3.09s 3.14s p=0.062 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 9.13s (± 0.23%) 9.08s (± 0.47%) -0.05s (- 0.58%) 9.02s 9.13s p=0.030 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.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53215 6
Baseline main 6

TSServer

Comparison Report - main..53215
Metric main 53215 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,401ms (± 0.61%) 2,405ms (± 0.51%) ~ 2,384ms 2,418ms p=0.809 n=6
Req 2 - geterr 5,395ms (± 0.49%) 5,387ms (± 0.25%) ~ 5,377ms 5,414ms p=0.873 n=6
Req 3 - references 337ms (± 0.31%) 339ms (± 1.57%) ~ 336ms 350ms p=0.346 n=6
Req 4 - navto 280ms (± 0.54%) 282ms (± 0.32%) ~ 281ms 283ms p=0.054 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 77ms (± 5.63%) 71ms (± 7.76%) ~ 66ms 78ms p=0.063 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,538ms (± 1.04%) 2,528ms (± 0.45%) ~ 2,515ms 2,543ms p=0.689 n=6
Req 2 - geterr 4,046ms (± 0.58%) 4,044ms (± 0.66%) ~ 4,009ms 4,069ms p=0.689 n=6
Req 3 - references 351ms (± 0.78%) 355ms (± 1.05%) ~ 349ms 360ms p=0.050 n=6
Req 4 - navto 293ms (± 0.97%) 294ms (± 0.51%) ~ 293ms 297ms p=0.292 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 (± 6.39%) 77ms (± 4.71%) ~ 74ms 83ms p=0.742 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,011ms (± 0.43%) 3,016ms (± 0.42%) ~ 3,005ms 3,036ms p=0.574 n=6
Req 2 - geterr 1,578ms (± 1.28%) 1,557ms (± 2.20%) ~ 1,500ms 1,589ms p=0.688 n=6
Req 3 - references 107ms (± 1.02%) 107ms (± 0.76%) ~ 106ms 108ms p=0.666 n=6
Req 4 - navto 355ms (± 0.29%) 355ms (± 0.45%) ~ 353ms 357ms p=0.867 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 394ms (± 4.43%) 386ms (± 1.56%) ~ 376ms 391ms p=0.378 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,498ms (± 0.62%) 2,500ms (± 0.34%) ~ 2,490ms 2,509ms p=0.810 n=6
Req 2 - geterr 5,807ms (± 0.53%) 5,777ms (± 0.58%) ~ 5,742ms 5,834ms p=0.173 n=6
Req 3 - references 349ms (± 0.65%) 350ms (± 0.53%) ~ 348ms 353ms p=0.226 n=6
Req 4 - navto 279ms (± 1.49%) 279ms (± 1.37%) ~ 273ms 284ms 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 75ms (± 0.73%) 74ms (± 1.02%) ~ 73ms 75ms p=0.137 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,682ms (± 0.60%) 2,688ms (± 0.63%) ~ 2,662ms 2,706ms p=0.630 n=6
Req 2 - geterr 4,378ms (± 0.41%) 4,370ms (± 0.64%) ~ 4,335ms 4,402ms p=0.689 n=6
Req 3 - references 358ms (± 0.99%) 358ms (± 0.38%) ~ 356ms 360ms p=0.326 n=6
Req 4 - navto 290ms (± 0.75%) 292ms (± 0.80%) ~ 289ms 295ms p=0.221 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 77ms (± 3.17%) 76ms (± 3.38%) ~ 74ms 81ms p=0.607 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,164ms (± 0.60%) 3,174ms (± 0.32%) ~ 3,159ms 3,187ms p=0.471 n=6
Req 2 - geterr 1,749ms (± 0.81%) 1,753ms (± 1.09%) ~ 1,716ms 1,766ms p=0.520 n=6
Req 3 - references 114ms (± 1.65%) 113ms (± 0.72%) ~ 112ms 114ms p=0.934 n=6
Req 4 - navto 340ms (± 0.34%) 340ms (± 0.49%) ~ 338ms 342ms p=0.804 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 395ms (± 0.30%) 393ms (± 1.02%) ~ 388ms 398ms p=0.806 n=6
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,603ms (± 0.91%) 2,601ms (± 0.30%) ~ 2,591ms 2,609ms p=0.575 n=6
Req 2 - geterr 6,205ms (± 0.29%) 6,192ms (± 0.59%) ~ 6,144ms 6,252ms p=0.336 n=6
Req 3 - references 363ms (± 0.54%) 363ms (± 0.94%) ~ 359ms 367ms p=0.936 n=6
Req 4 - navto 277ms (± 0.42%) 279ms (± 0.94%) ~ 277ms 284ms p=0.119 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 102ms (± 0.88%) 100ms (± 4.00%) ~ 92ms 103ms p=0.273 n=6
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,822ms (± 0.71%) 2,823ms (± 0.51%) ~ 2,805ms 2,845ms p=1.000 n=6
Req 2 - geterr 4,486ms (± 0.65%) 4,528ms (± 1.56%) ~ 4,482ms 4,671ms p=0.173 n=6
Req 3 - references 410ms (± 6.65%) 395ms (± 6.76%) ~ 371ms 429ms p=1.000 n=6
Req 4 - navto 289ms (± 1.06%) 290ms (± 1.25%) ~ 285ms 294ms p=0.748 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 87ms (± 7.44%) 79ms (± 7.50%) ~ 75ms 87ms p=0.111 n=6
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 3,461ms (± 0.49%) 3,450ms (± 0.50%) ~ 3,430ms 3,472ms p=0.261 n=6
Req 2 - geterr 1,878ms (± 1.15%) 1,887ms (± 0.72%) ~ 1,874ms 1,910ms p=0.521 n=6
Req 3 - references 128ms (± 1.34%) 129ms (± 1.60%) ~ 126ms 131ms p=0.323 n=6
Req 4 - navto 370ms (± 0.58%) 370ms (± 0.50%) ~ 368ms 373ms p=0.680 n=6
Req 5 - completionInfo count 2,861 (± 0.00%) 2,861 (± 0.00%) ~ 2,861 2,861 p=1.000 n=6
Req 5 - completionInfo 411ms (± 1.01%) 414ms (± 1.08%) ~ 408ms 420ms p=0.468 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.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 53215 6
Baseline main 6

Startup

Comparison Report - main..53215
Metric main 53215 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 144.56ms (± 0.37%) 141.85ms (± 0.17%) -2.71ms (- 1.87%) 141.16ms 144.49ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 232.00ms (± 0.25%) 227.34ms (± 0.18%) -4.66ms (- 2.01%) 226.36ms 232.96ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 232.96ms (± 0.19%) 229.00ms (± 0.21%) -3.96ms (- 1.70%) 228.08ms 240.15ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 212.98ms (± 0.24%) 209.66ms (± 0.15%) -3.32ms (- 1.56%) 208.79ms 216.52ms p=0.000 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 53215 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top-repos suite comparing main and refs/pull/53215/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @weswigham, it looks like the DT test run failed. Please check the log for more details.
You can check the log here.

@weswigham weswigham merged commit f078ab0 into microsoft:main Mar 21, 2023
@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

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Required in [K in keyof Required<T>] differ when using arrow function and normal function

3 participants