Skip to content

Commit 70b5fb8

Browse files
committed
Print per-file transformation times to stderr
1 parent 57e2fe0 commit 70b5fb8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/compiler/transformer.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,16 @@ namespace ts {
222222
state = TransformationState.Initialized;
223223

224224
// Transform each node.
225-
const transformed = map(nodes, allowDtsFiles ? transformation : transformRoot);
225+
const transformed: T[] = [];
226+
for (const node of nodes) {
227+
const start = timestamp();
228+
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
229+
const end = timestamp();
230+
const path = (node as any as SourceFile).path;
231+
if (path) {
232+
console.error(`Transformed ${path} in ${end - start}ms`);
233+
}
234+
}
226235

227236
// prevent modification of the lexical environment.
228237
state = TransformationState.Completed;

0 commit comments

Comments
 (0)