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
Remove v8-compile-cache
#6904
Comments
Ref: #6901 |
I'm looking into this. This was inspired by ESLint: However, ESLint removed |
|
I tried a benchmark with the following script (saving 'use strict';
/* eslint-disable no-console */
const cp = require('child_process');
const Benchmark = require('benchmark');
const cmdArgs = ['../bin/stylelint.js', 'visual.css', '-c', 'visual-config.json'];
const cwd = __dirname;
const suite = new Benchmark.Suite('test v8-compile-cache', {
onStart() {
try {
cp.execFileSync('node', cmdArgs, { cwd });
} catch (e) {
if (e.status === 2) {
// ignore
} else {
throw e;
}
}
},
onComplete(event) {
const s = event.currentTarget;
const fastest = s.filter('fastest').map('name');
console.log(`Fastest is "${fastest}"`);
},
});
suite.add('enable cache', {
defer: true,
fn(deferred) {
const env = { ...process.env };
cp.execFile('node', cmdArgs, { cwd, env }, () => deferred.resolve());
},
onComplete(event) {
console.log(event.target.toString());
},
});
suite.add('disable cache', {
defer: true,
fn(deferred) {
const env = {
...process.env,
DISABLE_V8_COMPILE_CACHE: '1',
};
cp.execFile('node', cmdArgs, { cwd, env }, () => deferred.resolve());
},
onComplete(event) {
console.log(event.target.toString());
},
});
suite.run({ async: true }); Environment (M1 MacBook Pro): $ sw_vers
ProductName: macOS
ProductVersion: 13.3.1
ProductVersionExtra: (a)
BuildVersion: 22E772610a $ npm version
{
stylelint: '15.7.0',
npm: '9.6.7',
node: '20.2.0',
acorn: '8.8.2',
ada: '2.4.0',
ares: '1.19.0',
base64: '0.5.0',
brotli: '1.0.9',
cjs_module_lexer: '1.2.2',
cldr: '43.0',
icu: '73.1',
llhttp: '8.1.0',
modules: '115',
napi: '8',
nghttp2: '1.52.0',
nghttp3: '0.7.0',
ngtcp2: '0.8.1',
openssl: '3.0.8+quic',
simdutf: '3.2.9',
tz: '2023c',
undici: '5.22.0',
unicode: '15.0',
uv: '1.44.2',
uvwasi: '0.0.16',
v8: '11.3.244.8-node.9',
zlib: '1.2.13'
} Run: $ node scripts/benchmark-v8-compile-cache.js
enable cache x 3.82 ops/sec ±2.97% (23 runs sampled)
disable cache x 3.73 ops/sec ±2.67% (23 runs sampled)
Fastest is "enable cache" As a result, I found out that there are almost no differences on the latest Node.js 20.2.0. EDIT: This benchmark uses the |
Split from #6898
See also zertosh/v8-compile-cache#30
We've used
v8-compile-cache
for startup performance:stylelint/bin/stylelint.js
Lines 5 to 6 in 2413e8f
But #6898 exposed a problem with ESM and dynamic imports.
If there are no big performance penalties or concerns, we'd like to remove
v8-compile-cache
to prevent future issues.The text was updated successfully, but these errors were encountered: