[go: nahoru, domu]

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 V8CacheOptions webpreference #23842

Merged
merged 2 commits into from
Jun 1, 2020
Merged

Conversation

deepak1556
Copy link
Member
@deepak1556 deepak1556 commented May 29, 2020

Description of Change

Refs microsoft/vscode#98682 (comment) for context

Checklist

Release Notes

Notes: V8CacheOptions is a new webpreference option to enforce code caching policy

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label May 29, 2020
@deepak1556 deepak1556 requested review from a team May 29, 2020 06:20
@bpasero
Copy link
Contributor
bpasero commented May 29, 2020

This is awesome, and my 2 cents are that Electron by default should cache on the first startup as much as possible because an Electron app deserves to be cached right from the beginning, as opposed to any website I visit.

Copy link
Contributor
@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

LGTM - just a small nit on capitalization.

docs/api/browser-window.md Outdated Show resolved Hide resolved
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label May 30, 2020
@deepak1556 deepak1556 merged commit f67aff2 into master Jun 1, 2020
@release-clerk
Copy link
release-clerk bot commented Jun 1, 2020

Release Notes Persisted

V8CacheOptions is a new webpreference option to enforce code caching policy

@trop
Copy link
Contributor
trop bot commented Jun 1, 2020

I have automatically backported this PR to "10-x-y", please check out #23867

@trop
Copy link
Contributor
trop bot commented Jun 1, 2020

I have automatically backported this PR to "9-x-y", please check out #23868

@trop trop bot removed the target/9-x-y label Jun 1, 2020
@trop
Copy link
Contributor
trop bot commented Jun 1, 2020

I have automatically backported this PR to "8-x-y", please check out #23869

@deepak1556
Copy link
Member Author

Couple of things to remember,

  • This flag only affects scripts served by chromium in the render process, scripts served by Node.js will not be affected.

  • If your app uses service workers to serve resources, then you need not use these flags. You will get the more aggressive code caching for free.

  • bypassHeatCheck is a sane default for all electron apps.

  • bypassHeatCheckAndEagerCompile should be used cautiously, depending on the amount of code being eagerly compiled and cached, it can cause increase in memory and add to GC pressure, also causes increased time in deserializing the cached data which translates to increased code load time and then there is bytecode flushing GC that will clear up inactive code, so most of the cached data may not end up being used.

@deepak1556
Copy link
Member Author

Should this be the default?

Electron 11 is set to be a quiet release, so we don't do any breaking changes in master at the moment. Will switch the default in near future.

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

Successfully merging this pull request may close these issues.

None yet

3 participants