perf(compiler): speed up watch mode (#19275)

- don’t regenerate code for .d.ts files when
  an oldProgram is passed to `createProgram`
- cache `fileExists` / `getSourceFile` / `readFile` in watch mode
- refactor tests to share common code in `test_support`
- support `—diagnostic` command line to print total time
  used per watch mode compilation.
PR Close #19275
This commit is contained in:
Tobias Bosch
2017-09-19 11:43:34 -07:00
committed by Igor Minar
parent ad7251c8bb
commit 6665d76fbb
11 changed files with 622 additions and 346 deletions

View File

@ -39,7 +39,7 @@ describe('NgCompilerHost', () => {
ngHost = createNgHost({files}),
}: {files?: Directory, options?: CompilerOptions, ngHost?: CompilerHost} = {}) {
return new TsCompilerAotCompilerTypeCheckHostAdapter(
['/tmp/index.ts'], options, ngHost, new MetadataCollector(), codeGenerator);
['/tmp/index.ts'], options, ngHost, new MetadataCollector(), codeGenerator, new Map());
}
describe('fileNameToModuleName', () => {