mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'transforms-fixPerformance' into transforms-visitEachChildPerf
This commit is contained in:
commit
5d4e47fa2f
11 files changed
+75
-215
No files matched your search
@@ -783,9 +783,9 @@ namespace ts {
|
||||
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile {
|
||||
let text: string;
|
||||
try {
|
||||
performance.mark("ioReadStart");
|
||||
const ioReadStart = performance.mark();
|
||||
text = sys.readFile(fileName, options.charset);
|
||||
performance.measure("ioReadTime", "ioReadStart");
|
||||
performance.measure("ioReadTime", ioReadStart);
|
||||
}
|
||||
catch (e) {
|
||||
if (onError) {
|
||||
@@ -852,7 +852,7 @@ namespace ts {
|
||||
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) {
|
||||
try {
|
||||
performance.mark("ioWriteStart");
|
||||
const ioWriteStart = performance.mark();
|
||||
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
|
||||
|
||||
if (isWatchSet(options) && sys.createHash && sys.getModifiedTime) {
|
||||
@@ -862,7 +862,7 @@ namespace ts {
|
||||
sys.writeFile(fileName, data, writeByteOrderMark);
|
||||
}
|
||||
|
||||
performance.measure("ioWriteTime", "ioWriteStart");
|
||||
performance.measure("ioWriteTime", ioWriteStart);
|
||||
}
|
||||
catch (e) {
|
||||
if (onError) {
|
||||
@@ -997,7 +997,7 @@ namespace ts {
|
||||
let resolvedTypeReferenceDirectives: Map<ResolvedTypeReferenceDirective> = {};
|
||||
let fileProcessingDiagnostics = createDiagnosticCollection();
|
||||
|
||||
performance.mark("programStart");
|
||||
const programStart = performance.mark();
|
||||
|
||||
host = host || createCompilerHost(options);
|
||||
|
||||
@@ -1094,7 +1094,7 @@ namespace ts {
|
||||
|
||||
verifyCompilerOptions();
|
||||
|
||||
performance.measure("programTime", "programStart");
|
||||
performance.measure("programTime", programStart);
|
||||
|
||||
return program;
|
||||
|
||||
@@ -1335,7 +1335,7 @@ namespace ts {
|
||||
// checked is to not pass the file to getEmitResolver.
|
||||
const emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile);
|
||||
|
||||
performance.mark("emitStart");
|
||||
const emitStart = performance.mark();
|
||||
|
||||
// TODO(rbuckton): remove USE_TRANSFORMS condition when we switch to transforms permanently.
|
||||
let useLegacyEmitter = options.useLegacyEmitter;
|
||||
@@ -1349,7 +1349,7 @@ namespace ts {
|
||||
getEmitHost(writeFileCallback),
|
||||
sourceFile);
|
||||
|
||||
performance.measure("emitTime", "emitStart");
|
||||
performance.measure("emitTime", emitStart);
|
||||
|
||||
return emitResult;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user