Content-Length: 328227 | pFad | http://redirect.github.com/eslint/eslint/pull/19012/files/5bf5a47f8b9220bc9fa3679a5a6fab214dc2877e

CE perf: using Node.js compile cache by aladdin-add · Pull Request #19012 · eslint/eslint · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: using Node.js compile cache #19012

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

"use strict";

const mod = require("node:module");

// to use V8's code cache to speed up instantiation time
mod.enableCompileCache?.();

Comment on lines +12 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work for developers using the Node.js API and not CLI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's intentional - see #11921 (review)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍🏻 .

// must do this initialization *before* other requires in order to work
if (process.argv.includes("--debug")) {
require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,5 +305,17 @@ module.exports = [
rules: {
"expect-type/expect": "error"
}
},
{
name: "eslint/bin",
files: ["bin/eslint.js"],
rules: {

/*
* it was introduced in Node.js v22.8.0
* refs: https://nodejs.org/en/blog/release/v22.8.0#new-js-api-for-compile-cache
*/
"n/no-unsupported-features/node-builtins": [2, { ignores: ["module.enableCompileCache"] }]
aladdin-add marked this conversation as resolved.
Show resolved Hide resolved
}
}
];
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://redirect.github.com/eslint/eslint/pull/19012/files/5bf5a47f8b9220bc9fa3679a5a6fab214dc2877e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy