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

Chore: add v8-compile-cache to speed up instantiation time #11921

Merged
merged 3 commits into from Jul 3, 2019

Conversation

aladdin-add
Copy link
Member

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.

What is the purpose of this pull request? (put an "X" next to item)

[x] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)
I've make a perf test:
before:
image

after:
image

node: v12.4.0
os: macos 10.14.5 (18F132)
cpu: 2.5 GHz Intel Core i7
mem: 16 GB 2133 MHz LPDDR3

Is there anything you'd like reviewers to focus on?

is this something we want to add?

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.
@aladdin-add aladdin-add added infrastructure Relates to the tools used in the ESLint development process core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 29, 2019
Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution.

I have a suggestion that we should use the cache only in our CLI. A library should not have side effects that change the application behavior globally.

lib/api.js Outdated Show resolved Hide resolved
Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion infrastructure Relates to the tools used in the ESLint development process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants