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

feat: add v8-compile-cache #4272

Merged
merged 1 commit into from Sep 10, 2019
Merged

feat: add v8-compile-cache #4272

merged 1 commit into from Sep 10, 2019

Conversation

vankop
Copy link
Member

@vankop vankop commented Sep 10, 2019

Which issue, if any, is this issue related to?

inspired by eslint/eslint#11921 =)

Is there anything in the PR that needs further explanation?

nothing

@jeddy3
Copy link
Member

jeddy3 commented Sep 10, 2019

It would be good to get some before and after benchmarks (like so), so we know the benefit of this change.

@vankop
Copy link
Member Author

vankop commented Sep 10, 2019

Don't now how it works exactly =)
For me

time node -e "require('./bin/stylelint')"

after several runs 0.2s

For code in master after several runs 0.23s
For latest npm package 0.3s

@alexander-akait
Copy link
Member

alexander-akait commented Sep 10, 2019

Try to run stylelint multiple times with multiple require and without

@vankop
Copy link
Member Author

vankop commented Sep 10, 2019

@evilebottnawi something like that

function measureRequire() {
  const t = process.hrtime();
  require("./bin/stylelint");
  console.log('stylelint: ' + process.hrtime(t)[1] / 1e+6);
}

const retry = fn => times => new Array(times).fill(0).forEach((_, i) => fn(i));

retry(measureRequire)(10);

???

@alexander-akait
Copy link
Member

Here example https://github.com/zertosh/v8-compile-cache/blob/master/bench/require-babel-core.js

@vankop
Copy link
Member Author

vankop commented Sep 10, 2019

Снимок экрана 2019-09-10 в 19 35 23

@vankop vankop mentioned this pull request Sep 10, 2019
6 tasks
@jeddy3
Copy link
Member

jeddy3 commented Sep 10, 2019

Are those the results from the PR branch or master?

@alexander-akait
Copy link
Member

@vankop just create suite WITH_CACHE (where true) and WITH_CACHE (where unspecific)

@vankop
Copy link
Member Author

vankop commented Sep 10, 2019

Sorry, did not understand at the beginning that I need to require code without v8-compile-cache

Снимок экрана 2019-09-10 в 19 56 15

Are those the results from the PR branch or master?

Master branch

@alexander-akait
Copy link
Member

Good perf on first run

@jeddy3
Copy link
Member

jeddy3 commented Sep 10, 2019

Yep, better on first run. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants