Skip to content

Commit 4e04b75

Browse files
committed
Aligned mark names with values used by ts-perf.
1 parent c816244 commit 4e04b75

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ namespace ts {
8989
const binder = createBinder();
9090

9191
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
92-
performance.mark("bindStart");
92+
performance.mark("beforeBind");
9393
binder(file, options);
94-
performance.mark("bindEnd");
95-
performance.measure("Bind", "bindStart", "bindEnd");
94+
performance.mark("afterBind");
95+
performance.measure("Bind", "beforeBind", "afterBind");
9696
}
9797

9898
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17535,10 +17535,10 @@ namespace ts {
1753517535
}
1753617536

1753717537
function checkSourceFile(node: SourceFile) {
17538-
performance.mark("checkStart");
17538+
performance.mark("beforeCheck");
1753917539
checkSourceFileWorker(node);
17540-
performance.mark("checkEnd");
17541-
performance.measure("Check", "checkStart", "checkEnd");
17540+
performance.mark("afterCheck");
17541+
performance.measure("Check", "beforeCheck", "afterCheck");
1754217542
}
1754317543

1754417544
// Fully type check a source file and collect the relevant diagnostics.

src/compiler/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ namespace ts {
421421
}
422422

423423
export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false, scriptKind?: ScriptKind): SourceFile {
424-
performance.mark("parseStart");
424+
performance.mark("beforeParse");
425425
const result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);
426-
performance.mark("parseEnd");
427-
performance.measure("Parse", "parseStart", "parseEnd");
426+
performance.mark("afterParse");
427+
performance.measure("Parse", "beforeParse", "afterParse");
428428
return result;
429429
}
430430

src/compiler/program.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,10 @@ namespace ts {
857857
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile {
858858
let text: string;
859859
try {
860-
performance.mark("ioReadStart");
860+
performance.mark("beforeIORead");
861861
text = sys.readFile(fileName, options.charset);
862-
performance.mark("ioReadEnd");
863-
performance.measure("I/O Read", "ioReadStart", "ioReadEnd");
862+
performance.mark("afterIORead");
863+
performance.measure("I/O Read", "beforeIORead", "afterIORead");
864864
}
865865
catch (e) {
866866
if (onError) {
@@ -927,7 +927,7 @@ namespace ts {
927927

928928
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) {
929929
try {
930-
performance.mark("ioWriteStart");
930+
performance.mark("beforeIOWrite");
931931
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
932932

933933
if (isWatchSet(options) && sys.createHash && sys.getModifiedTime) {
@@ -937,8 +937,8 @@ namespace ts {
937937
sys.writeFile(fileName, data, writeByteOrderMark);
938938
}
939939

940-
performance.mark("ioWriteEnd");
941-
performance.measure("I/O Write", "ioWriteStart", "ioWriteEnd");
940+
performance.mark("afterIOWrite");
941+
performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
942942
}
943943
catch (e) {
944944
if (onError) {
@@ -1120,7 +1120,7 @@ namespace ts {
11201120
// Track source files that are source files found by searching under node_modules, as these shouldn't be compiled.
11211121
const sourceFilesFoundSearchingNodeModules = createMap<boolean>();
11221122

1123-
performance.mark("programStart");
1123+
performance.mark("beforeProgram");
11241124

11251125
host = host || createCompilerHost(options);
11261126

@@ -1218,8 +1218,8 @@ namespace ts {
12181218
};
12191219

12201220
verifyCompilerOptions();
1221-
performance.mark("programEnd");
1222-
performance.measure("Program", "programStart", "programEnd");
1221+
performance.mark("afterProgram");
1222+
performance.measure("Program", "beforeProgram", "afterProgram");
12231223

12241224
return program;
12251225

@@ -1462,15 +1462,15 @@ namespace ts {
14621462
// checked is to not pass the file to getEmitResolver.
14631463
const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile);
14641464

1465-
performance.mark("emitStart");
1465+
performance.mark("beforeEmit");
14661466

14671467
const emitResult = emitFiles(
14681468
emitResolver,
14691469
getEmitHost(writeFileCallback),
14701470
sourceFile);
14711471

1472-
performance.mark("emitEnd");
1473-
performance.measure("Emit", "emitStart", "emitEnd");
1472+
performance.mark("afterEmit");
1473+
performance.measure("Emit", "beforeEmit", "afterEmit");
14741474
return emitResult;
14751475
}
14761476

src/compiler/sourcemap.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ namespace ts {
242242
}
243243

244244
if (extendedDiagnostics) {
245-
performance.mark("sourcemapStart");
245+
performance.mark("beforeSourcemap");
246246
}
247247

248248
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
@@ -286,8 +286,8 @@ namespace ts {
286286
updateLastEncodedAndRecordedSpans();
287287

288288
if (extendedDiagnostics) {
289-
performance.mark("sourcemapEnd");
290-
performance.measure("Source Map", "sourcemapStart", "sourcemapEnd");
289+
performance.mark("afterSourcemap");
290+
performance.measure("Source Map", "beforeSourcemap", "afterSourcemap");
291291
}
292292
}
293293

0 commit comments

Comments
 (0)