Expose call count for instantiateType in extendedDiagnostics (#36797)

* Expose call count for instantiateType in extendedDiagnostics

* Update API baselines
This commit is contained in:
Andrew Casey 2020-02-26 12:55:28 -08:00 committed by GitHub
parent 3d63401b20
commit b424f36e9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 0 deletions

View File

@ -298,6 +298,7 @@ namespace ts {
let typeCount = 0;
let symbolCount = 0;
let enumCount = 0;
let totalInstantiationCount = 0;
let instantiationCount = 0;
let instantiationDepth = 0;
let constraintDepth = 0;
@ -348,6 +349,7 @@ namespace ts {
getIdentifierCount: () => sum(host.getSourceFiles(), "identifierCount"),
getSymbolCount: () => sum(host.getSourceFiles(), "symbolCount") + symbolCount,
getTypeCount: () => typeCount,
getInstantiationCount: () => totalInstantiationCount,
getRelationCacheSizes: () => ({
assignable: assignableRelation.size,
identity: identityRelation.size,
@ -13775,6 +13777,7 @@ namespace ts {
error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
return errorType;
}
totalInstantiationCount++;
instantiationCount++;
instantiationDepth++;
const result = instantiateTypeWorker(type, mapper);

View File

@ -946,6 +946,7 @@ namespace ts {
getIdentifierCount: () => getDiagnosticsProducingTypeChecker().getIdentifierCount(),
getSymbolCount: () => getDiagnosticsProducingTypeChecker().getSymbolCount(),
getTypeCount: () => getDiagnosticsProducingTypeChecker().getTypeCount(),
getInstantiationCount: () => getDiagnosticsProducingTypeChecker().getInstantiationCount(),
getRelationCacheSizes: () => getDiagnosticsProducingTypeChecker().getRelationCacheSizes(),
getFileProcessingDiagnostics: () => fileProcessingDiagnostics,
getResolvedTypeReferenceDirectives: () => resolvedTypeReferenceDirectives,

View File

@ -3235,6 +3235,7 @@ namespace ts {
getIdentifierCount(): number;
getSymbolCount(): number;
getTypeCount(): number;
getInstantiationCount(): number;
getRelationCacheSizes(): { assignable: number, identity: number, subtype: number, strictSubtype: number };
/* @internal */ getFileProcessingDiagnostics(): DiagnosticCollection;
@ -3557,6 +3558,7 @@ namespace ts {
/* @internal */ getIdentifierCount(): number;
/* @internal */ getSymbolCount(): number;
/* @internal */ getTypeCount(): number;
/* @internal */ getInstantiationCount(): number;
/* @internal */ getRelationCacheSizes(): { assignable: number, identity: number, subtype: number, strictSubtype: number };
/* @internal */ isArrayType(type: Type): boolean;

View File

@ -639,6 +639,7 @@ namespace ts {
reportCountStatistic("Identifiers", program.getIdentifierCount());
reportCountStatistic("Symbols", program.getSymbolCount());
reportCountStatistic("Types", program.getTypeCount());
reportCountStatistic("Instantiations", program.getInstantiationCount());
if (memoryUsed >= 0) {
reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");

View File

@ -1952,6 +1952,7 @@ declare namespace ts {
getIdentifierCount(): number;
getSymbolCount(): number;
getTypeCount(): number;
getInstantiationCount(): number;
getRelationCacheSizes(): {
assignable: number;
identity: number;

View File

@ -1952,6 +1952,7 @@ declare namespace ts {
getIdentifierCount(): number;
getSymbolCount(): number;
getTypeCount(): number;
getInstantiationCount(): number;
getRelationCacheSizes(): {
assignable: number;
identity: number;