From 8cd7adc1a1729182d230d1cd90765a16913a25b3 Mon Sep 17 00:00:00 2001 From: "weiran.zsd" Date: Sat, 29 Jun 2019 18:42:23 +0800 Subject: [PATCH 1/3] Chore: add v8-compile-cache to speed up instantiation time v8-compile-cache attaches a require hook to use V8's code cache to speed up instantiation time. The "code cache" is the work of parsing and compiling done by V8. --- lib/api.js | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/api.js b/lib/api.js index 40a5cc9fa5c..eb7c6809df6 100644 --- a/lib/api.js +++ b/lib/api.js @@ -5,6 +5,7 @@ "use strict"; +require("v8-compile-cache"); // to use V8's code cache to speed up instantiation time const { CLIEngine } = require("./cli-engine"); const { Linter } = require("./linter"); const { RuleTester } = require("./rule-tester"); diff --git a/package.json b/package.json index a1c3aa0d595..068b4e1858a 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,8 @@ "strip-ansi": "^5.2.0", "strip-json-comments": "^3.0.1", "table": "^5.2.3", - "text-table": "^0.2.0" + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "devDependencies": { "@babel/core": "^7.4.3", From 60ccfa29c4e6a70df1749a72a3125ed85e55d378 Mon Sep 17 00:00:00 2001 From: "weiran.zsd" Date: Sat, 29 Jun 2019 19:12:12 +0800 Subject: [PATCH 2/3] add v8-compile-cache in bin/eslint.js --- bin/eslint.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/eslint.js b/bin/eslint.js index b6b14d3a2ba..061e94767f0 100755 --- a/bin/eslint.js +++ b/bin/eslint.js @@ -9,6 +9,9 @@ "use strict"; +// to use V8's code cache to speed up instantiation time +require("v8-compile-cache"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ From 8b10d3e43ac22d0443f6e64147808c682a4caebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Tue, 2 Jul 2019 22:11:14 +0800 Subject: [PATCH 3/3] Update api.js --- lib/api.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/api.js b/lib/api.js index eb7c6809df6..40a5cc9fa5c 100644 --- a/lib/api.js +++ b/lib/api.js @@ -5,7 +5,6 @@ "use strict"; -require("v8-compile-cache"); // to use V8's code cache to speed up instantiation time const { CLIEngine } = require("./cli-engine"); const { Linter } = require("./linter"); const { RuleTester } = require("./rule-tester");