Skip to content

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

Merged
aladdin-add merged 3 commits intoeslint:masterfrom
aladdin-add:chore/v8-cache
Jul 3, 2019
Merged

Chore: add v8-compile-cache to speed up instantiation time#11921
aladdin-add merged 3 commits intoeslint:masterfrom
aladdin-add:chore/v8-cache

Conversation

@aladdin-add
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread lib/api.js Outdated
Copy link
Copy Markdown
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!

@platinumazure platinumazure requested a review from mysticatea July 2, 2019 15:14
Copy link
Copy Markdown
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
Copy Markdown
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.

5 participants