Skip to content
Permalink
Browse files

perf(compiler): speed up bootstrap time for `isolatedModules:true` (#…

…2055)

Initializing `LanguageService` with fetching only `.d.ts` files
  • Loading branch information
ahnpnl committed Oct 23, 2020
1 parent a726c44 commit 230b5ddbee55357d25dd190cd45aa8a30d7f31e0
Showing with 9,132 additions and 9,714 deletions.
  1. +3 −3 e2e/__external-repos__/custom-typings/package.json
  2. +302 −358 e2e/__external-repos__/custom-typings/yarn.lock
  3. +2 −0 e2e/__external-repos__/memory-usage/.gitignore
  4. +9 −0 e2e/__external-repos__/memory-usage/jest.config.js
  5. +40 −0 e2e/__external-repos__/memory-usage/package.json
  6. +4 −0 e2e/__external-repos__/memory-usage/src/app.module.ts
  7. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test1.spec.ts
  8. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test10.spec.ts
  9. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test11.spec.ts
  10. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test12.spec.ts
  11. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test2.spec.ts
  12. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test3.spec.ts
  13. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test4.spec.ts
  14. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test5.spec.ts
  15. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test6.spec.ts
  16. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test7.spec.ts
  17. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test8.spec.ts
  18. +11 −0 e2e/__external-repos__/memory-usage/test/force-gc/test9.spec.ts
  19. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test1.spec.ts
  20. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test10.spec.ts
  21. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test11.spec.ts
  22. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test12.spec.ts
  23. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test2.spec.ts
  24. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test3.spec.ts
  25. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test4.spec.ts
  26. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test5.spec.ts
  27. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test6.spec.ts
  28. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test7.spec.ts
  29. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test8.spec.ts
  30. +25 −0 e2e/__external-repos__/memory-usage/test/with-nest/test9.spec.ts
  31. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test1.spec.ts
  32. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test10.spec.ts
  33. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test11.spec.ts
  34. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test12.spec.ts
  35. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test2.spec.ts
  36. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test3.spec.ts
  37. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test4.spec.ts
  38. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test5.spec.ts
  39. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test6.spec.ts
  40. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test7.spec.ts
  41. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test8.spec.ts
  42. +7 −0 e2e/__external-repos__/memory-usage/test/without-nest/test9.spec.ts
  43. +19 −0 e2e/__external-repos__/memory-usage/tsconfig.json
  44. +26 −0 e2e/__external-repos__/memory-usage/tsconfig.spec.json
  45. +4,319 −0 e2e/__external-repos__/memory-usage/yarn.lock
  46. +3 −4 e2e/__external-repos__/path-mapping/package.json
  47. +298 −354 e2e/__external-repos__/path-mapping/yarn.lock
  48. +3 −2 e2e/__external-repos__/simple-project-references/package.json
  49. +298 −354 e2e/__external-repos__/simple-project-references/yarn.lock
  50. +2 −2 e2e/__external-repos__/simple/with-dependency/package.json
  51. +298 −354 e2e/__external-repos__/simple/with-dependency/yarn.lock
  52. +3 −4 e2e/__external-repos__/yarn-workspace-composite/package.json
  53. +298 −354 e2e/__external-repos__/yarn-workspace-composite/yarn.lock
  54. +382 −1,530 e2e/__templates__/default/package-lock.json
  55. +3 −3 e2e/__templates__/default/package.json
  56. +950 −2,419 e2e/__templates__/with-babel-7-string-config/package-lock.json
  57. +6 −6 e2e/__templates__/with-babel-7-string-config/package.json
  58. +950 −2,419 e2e/__templates__/with-babel-7/package-lock.json
  59. +6 −6 e2e/__templates__/with-babel-7/package.json
  60. +382 −1,530 e2e/__templates__/with-unsupported-version/package-lock.json
  61. +3 −3 e2e/__templates__/with-unsupported-version/package.json
  62. +1 −0 scripts/lib/paths.js
  63. +6 −9 src/compiler/language-service.ts
@@ -5,9 +5,9 @@
"test": "jest"
},
"devDependencies": {
"@types/jest": "^26.0.14",
"@types/jquery": "^3.5.2",
"jest": "^26.5.2",
"@types/jest": "^26.0.15",
"@types/jquery": "^3.5.3",
"jest": "^26.6.0",
"jquery": "^3.5.1",
"typescript": "^4.0.3"
},

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
node_modules
*.log
@@ -0,0 +1,9 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: {
'ts-jest': {
tsconfig: "tsconfig.spec.json"
}
}
};
@@ -0,0 +1,40 @@
{
"name": "memory-usage",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"test": "jest --no-cache --runInBand --logHeapUsage ./test"
},
"volta": {
"node": "12.18.3"
},
"wantedDependencies": {
"@nestjs/common": "latest",
"@nestjs/core": "latest",
"@nestjs/platform-express": "latest",
"@nestjs/testing": "latest",
"@types/jest": "latest",
"@types/lodash": "latest",
"jest": "latest",
"lodash": "latest",
"reflect-metadata": "latest",
"rxjs": "latest",
"typescript": "latest",
"weak-napi": "latest"
},
"devDependencies": {
"@nestjs/common": "^7.4.4",
"@nestjs/core": "^7.4.4",
"@nestjs/platform-express": "^7.4.4",
"@nestjs/testing": "^7.4.4",
"@types/jest": "^26.0.15",
"@types/lodash": "^4.14.162",
"jest": "^26.6.0",
"lodash": "^4.17.20",
"reflect-metadata": "^0.1.13",
"rxjs": "^6.6.3",
"typescript": "^4.0.3",
"weak-napi": "^2.0.2"
}
}
@@ -0,0 +1,4 @@
import { Module } from "@nestjs/common";

@Module({})
export class AppModule {}
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test1", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test10", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test11", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test12", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test2", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test3", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test4", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test5", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test6", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test7", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test8", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,11 @@
import { range } from "lodash";

describe("test9", () => {
afterAll(() => {
global.gc();
})

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test1", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test10", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test11", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test12", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test2", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test3", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});
@@ -0,0 +1,25 @@
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { range } from "lodash";
import { AppModule } from "../../src/app.module";

describe("test4", () => {
let app: NestExpressApplication;

beforeAll(async () => {
const testingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();

const app = testingModule.createNestApplication<NestExpressApplication>();
await app.init();
});

afterAll(async () => {
await app.close();
});

test.each(range(0, 100))("%i", () => {
expect(true).toBe(true);
});
});

2 comments on commit 230b5dd

@Jeffkeen7

This comment has been minimized.

Copy link

@Jeffkeen7 Jeffkeen7 replied Oct 26, 2020

Got em

@Jeffkeen7

This comment has been minimized.

Copy link

@Jeffkeen7 Jeffkeen7 replied Oct 26, 2020

This is awesome

Please sign in to comment.
You can’t perform that action at this time.