mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-18 12:21:37 -06:00
Force a gc before printing diagnostics
Use this together with `node --expose-gc` to get more stable results
This commit is contained in:
parent
a4bacf3bfa
commit
72c0961071
@ -322,6 +322,10 @@ namespace ts {
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics) {
|
||||
statistics = [];
|
||||
|
||||
// @ts-ignore
|
||||
if (typeof gc === "function") { gc(); }
|
||||
|
||||
const memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1;
|
||||
reportCountStatistic("Files", program.getSourceFiles().length);
|
||||
reportCountStatistic("Lines", countLines(program));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user