Skip to content

Commit f84a67f

Browse files
authored
Don't trace bindSourceFile cache hits (#47602)
Writing the trace entry takes longer than returning the cached value. Fixes #47565
1 parent ba402e6 commit f84a67f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/binder.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,12 @@ namespace ts {
174174
const binder = createBinder();
175175

176176
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
177-
tracing?.push(tracing.Phase.Bind, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
178177
performance.mark("beforeBind");
179178
perfLogger.logStartBindFile("" + file.fileName);
180179
binder(file, options);
181180
perfLogger.logStopBindFile();
182181
performance.mark("afterBind");
183182
performance.measure("Bind", "beforeBind", "afterBind");
184-
tracing?.pop();
185183
}
186184

187185
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
@@ -253,7 +251,9 @@ namespace ts {
253251
Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
254252

255253
if (!file.locals) {
254+
tracing?.push(tracing.Phase.Bind, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
256255
bind(file);
256+
tracing?.pop();
257257
file.symbolCount = symbolCount;
258258
file.classifiableNames = classifiableNames;
259259
delayedBindJSDocTypedefTag();

0 commit comments

Comments
 (0)