mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Aligned mark names with values used by ts-perf.
This commit is contained in:
parent
c81624435a
commit
4e04b75d4b
@ -89,10 +89,10 @@ namespace ts {
|
||||
const binder = createBinder();
|
||||
|
||||
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
|
||||
performance.mark("bindStart");
|
||||
performance.mark("beforeBind");
|
||||
binder(file, options);
|
||||
performance.mark("bindEnd");
|
||||
performance.measure("Bind", "bindStart", "bindEnd");
|
||||
performance.mark("afterBind");
|
||||
performance.measure("Bind", "beforeBind", "afterBind");
|
||||
}
|
||||
|
||||
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
|
||||
@ -17535,10 +17535,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkSourceFile(node: SourceFile) {
|
||||
performance.mark("checkStart");
|
||||
performance.mark("beforeCheck");
|
||||
checkSourceFileWorker(node);
|
||||
performance.mark("checkEnd");
|
||||
performance.measure("Check", "checkStart", "checkEnd");
|
||||
performance.mark("afterCheck");
|
||||
performance.measure("Check", "beforeCheck", "afterCheck");
|
||||
}
|
||||
|
||||
// Fully type check a source file and collect the relevant diagnostics.
|
||||
|
||||
@ -421,10 +421,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false, scriptKind?: ScriptKind): SourceFile {
|
||||
performance.mark("parseStart");
|
||||
performance.mark("beforeParse");
|
||||
const result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes, scriptKind);
|
||||
performance.mark("parseEnd");
|
||||
performance.measure("Parse", "parseStart", "parseEnd");
|
||||
performance.mark("afterParse");
|
||||
performance.measure("Parse", "beforeParse", "afterParse");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -857,10 +857,10 @@ namespace ts {
|
||||
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile {
|
||||
let text: string;
|
||||
try {
|
||||
performance.mark("ioReadStart");
|
||||
performance.mark("beforeIORead");
|
||||
text = sys.readFile(fileName, options.charset);
|
||||
performance.mark("ioReadEnd");
|
||||
performance.measure("I/O Read", "ioReadStart", "ioReadEnd");
|
||||
performance.mark("afterIORead");
|
||||
performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
||||
}
|
||||
catch (e) {
|
||||
if (onError) {
|
||||
@ -927,7 +927,7 @@ namespace ts {
|
||||
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) {
|
||||
try {
|
||||
performance.mark("ioWriteStart");
|
||||
performance.mark("beforeIOWrite");
|
||||
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
|
||||
|
||||
if (isWatchSet(options) && sys.createHash && sys.getModifiedTime) {
|
||||
@ -937,8 +937,8 @@ namespace ts {
|
||||
sys.writeFile(fileName, data, writeByteOrderMark);
|
||||
}
|
||||
|
||||
performance.mark("ioWriteEnd");
|
||||
performance.measure("I/O Write", "ioWriteStart", "ioWriteEnd");
|
||||
performance.mark("afterIOWrite");
|
||||
performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
|
||||
}
|
||||
catch (e) {
|
||||
if (onError) {
|
||||
@ -1120,7 +1120,7 @@ namespace ts {
|
||||
// Track source files that are source files found by searching under node_modules, as these shouldn't be compiled.
|
||||
const sourceFilesFoundSearchingNodeModules = createMap<boolean>();
|
||||
|
||||
performance.mark("programStart");
|
||||
performance.mark("beforeProgram");
|
||||
|
||||
host = host || createCompilerHost(options);
|
||||
|
||||
@ -1218,8 +1218,8 @@ namespace ts {
|
||||
};
|
||||
|
||||
verifyCompilerOptions();
|
||||
performance.mark("programEnd");
|
||||
performance.measure("Program", "programStart", "programEnd");
|
||||
performance.mark("afterProgram");
|
||||
performance.measure("Program", "beforeProgram", "afterProgram");
|
||||
|
||||
return program;
|
||||
|
||||
@ -1462,15 +1462,15 @@ namespace ts {
|
||||
// checked is to not pass the file to getEmitResolver.
|
||||
const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile);
|
||||
|
||||
performance.mark("emitStart");
|
||||
performance.mark("beforeEmit");
|
||||
|
||||
const emitResult = emitFiles(
|
||||
emitResolver,
|
||||
getEmitHost(writeFileCallback),
|
||||
sourceFile);
|
||||
|
||||
performance.mark("emitEnd");
|
||||
performance.measure("Emit", "emitStart", "emitEnd");
|
||||
performance.mark("afterEmit");
|
||||
performance.measure("Emit", "beforeEmit", "afterEmit");
|
||||
return emitResult;
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +242,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (extendedDiagnostics) {
|
||||
performance.mark("sourcemapStart");
|
||||
performance.mark("beforeSourcemap");
|
||||
}
|
||||
|
||||
const sourceLinePos = getLineAndCharacterOfPosition(currentSourceFile, pos);
|
||||
@ -286,8 +286,8 @@ namespace ts {
|
||||
updateLastEncodedAndRecordedSpans();
|
||||
|
||||
if (extendedDiagnostics) {
|
||||
performance.mark("sourcemapEnd");
|
||||
performance.measure("Source Map", "sourcemapStart", "sourcemapEnd");
|
||||
performance.mark("afterSourcemap");
|
||||
performance.measure("Source Map", "beforeSourcemap", "afterSourcemap");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user