mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user