Don't trace bindSourceFile cache hits (#47602)

Writing the trace entry takes longer than returning the cached value.

Fixes #47565
This commit is contained in:
Andrew Casey 2022-01-25 14:57:17 -08:00 committed by GitHub
parent ba402e6b86
commit f84a67f29c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,14 +174,12 @@ namespace ts {
const binder = createBinder();
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
tracing?.push(tracing.Phase.Bind, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
performance.mark("beforeBind");
perfLogger.logStartBindFile("" + file.fileName);
binder(file, options);
perfLogger.logStopBindFile();
performance.mark("afterBind");
performance.measure("Bind", "beforeBind", "afterBind");
tracing?.pop();
}
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
@ -253,7 +251,9 @@ namespace ts {
Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
if (!file.locals) {
tracing?.push(tracing.Phase.Bind, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
bind(file);
tracing?.pop();
file.symbolCount = symbolCount;
file.classifiableNames = classifiableNames;
delayedBindJSDocTypedefTag();