File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ namespace ts {
114
114
getIdentifierCount: () => sum(host.getSourceFiles(), "identifierCount"),
115
115
getSymbolCount: () => sum(host.getSourceFiles(), "symbolCount") + symbolCount,
116
116
getTypeCount: () => typeCount,
117
+ getRelationCacheSizes: () => ({
118
+ assignable: assignableRelation.size,
119
+ identity: identityRelation.size,
120
+ subtype: subtypeRelation.size,
121
+ }),
117
122
isUndefinedSymbol: symbol => symbol === undefinedSymbol,
118
123
isArgumentsSymbol: symbol => symbol === argumentsSymbol,
119
124
isUnknownSymbol: symbol => symbol === unknownSymbol,
Original file line number Diff line number Diff line change @@ -927,6 +927,7 @@ namespace ts {
927
927
getIdentifierCount : ( ) => getDiagnosticsProducingTypeChecker ( ) . getIdentifierCount ( ) ,
928
928
getSymbolCount : ( ) => getDiagnosticsProducingTypeChecker ( ) . getSymbolCount ( ) ,
929
929
getTypeCount : ( ) => getDiagnosticsProducingTypeChecker ( ) . getTypeCount ( ) ,
930
+ getRelationCacheSizes : ( ) => getDiagnosticsProducingTypeChecker ( ) . getRelationCacheSizes ( ) ,
930
931
getFileProcessingDiagnostics : ( ) => fileProcessingDiagnostics ,
931
932
getResolvedTypeReferenceDirectives : ( ) => resolvedTypeReferenceDirectives ,
932
933
isSourceFileFromExternalLibrary,
Original file line number Diff line number Diff line change @@ -2961,6 +2961,7 @@ namespace ts {
2961
2961
/* @internal */ getIdentifierCount ( ) : number ;
2962
2962
/* @internal */ getSymbolCount ( ) : number ;
2963
2963
/* @internal */ getTypeCount ( ) : number ;
2964
+ /* @internal */ getRelationCacheSizes ( ) : { assignable : number , identity : number , subtype : number } ;
2964
2965
2965
2966
/* @internal */ getFileProcessingDiagnostics ( ) : DiagnosticCollection ;
2966
2967
/* @internal */ getResolvedTypeReferenceDirectives ( ) : Map < ResolvedTypeReferenceDirective | undefined > ;
@@ -3246,6 +3247,7 @@ namespace ts {
3246
3247
/* @internal */ getIdentifierCount ( ) : number ;
3247
3248
/* @internal */ getSymbolCount ( ) : number ;
3248
3249
/* @internal */ getTypeCount ( ) : number ;
3250
+ /* @internal */ getRelationCacheSizes ( ) : { assignable : number , identity : number , subtype : number } ;
3249
3251
3250
3252
/* @internal */ isArrayType ( type : Type ) : boolean ;
3251
3253
/* @internal */ isTupleType ( type : Type ) : boolean ;
Original file line number Diff line number Diff line change @@ -340,6 +340,10 @@ namespace ts {
340
340
const checkTime = performance . getDuration ( "Check" ) ;
341
341
const emitTime = performance . getDuration ( "Emit" ) ;
342
342
if ( compilerOptions . extendedDiagnostics ) {
343
+ const caches = program . getRelationCacheSizes ( ) ;
344
+ reportCountStatistic ( "Assignability cache size" , caches . assignable ) ;
345
+ reportCountStatistic ( "Identity cache size" , caches . identity ) ;
346
+ reportCountStatistic ( "Subtype cache size" , caches . subtype ) ;
343
347
performance . forEachMeasure ( ( name , duration ) => reportTimeStatistic ( `${ name } time` , duration ) ) ;
344
348
}
345
349
else {
You can’t perform that action at this time.
0 commit comments