Contact emails
Summary
Create V8 contexts from a snapshot file. It will make the initializations of V8 contexts for 1.6-3 times faster. (design doc, issue 617892)
Motivation
LocalWindowProxy::initialize() is a very performance sensitive method, because it is called per frame per extension. If Chromium has 10 extensions and opens a page including 10 iframes, it is called more than 100 times.
V8 context snapshot is a set of snapshot images of function templates and V8 contexts. We will make it at build time, and then create new function templates or contexts from the image in client processes. On our experiments, this routine runs 1.6-3 times faster than creating contexts from scratch, and it allows us to improve performance in new ways.
Interoperability and Compatibility Risk
None.
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
It does not support Chrome OS for now, but we will support it soon.
Requesting approval to ship?
No
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA%2BESgZCrtMnX-REqViTRwAuXJNOA%3DYuZT0%3DF%2BkGMq%2Bew%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGbLiFkddj_Eu6vP-PKuDZizZ8_o%2BCbc1PZ9p%3D1-Qj_jCU3pA%40mail.gmail.com.
It's not entirely obvious to me from the data presented that this is an overall win on Android. 10ms is not an enormous win in the context of loading, and it's gaining that via tradeoff rather than Pareto optimization. The APK size concern alone is a major concern for us, and also I'm also concerned about a possible effect on RAM, and also that we might be waiting on disk I/O on a separate thread you didn't measure (which might more than cancel the win).It seems like the main goal of this project is to address the pathological extensions problem. Since Chrome for Android doesn't support extensions, I suggest decoupling the decision to ship on desktop and Android. Likely the current data is good enough to ship on desktop, but Android will require more debate/data-gathering and it's possible we will never want to ship this there.
On Wed, Jul 12, 2017 at 4:39 AM, Nico Weber <tha...@chromium.org> wrote:It sounds like this adds 1.6MB to binary size, which is precious on Android. Is it possible to reduce the size hit, or to mitigate it by removing some existing system no longer needed with this new tech?To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGbLiFkddj_Eu6vP-PKuDZizZ8_o%2BCbc1PZ9p%3D1-Qj_jCU3pA%40mail.gmail.com.--On Jul 12, 2017 12:12 AM, "Hitoshi Yoshida" <pe...@chromium.org> wrote:--Contact emails
Summary
Create V8 contexts from a snapshot file. It will make the initializations of V8 contexts for 1.6-3 times faster. (design doc, issue 617892)
Motivation
LocalWindowProxy::initialize() is a very performance sensitive method, because it is called per frame per extension. If Chromium has 10 extensions and opens a page including 10 iframes, it is called more than 100 times.
V8 context snapshot is a set of snapshot images of function templates and V8 contexts. We will make it at build time, and then create new function templates or contexts from the image in client processes. On our experiments, this routine runs 1.6-3 times faster than creating contexts from scratch, and it allows us to improve performance in new ways.
Interoperability and Compatibility Risk
None.Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
It does not support Chrome OS for now, but we will support it soon.
Requesting approval to ship?
No
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA%2BESgZCrtMnX-REqViTRwAuXJNOA%3DYuZT0%3DF%2BkGMq%2Bew%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXBtSauqaqzTDxkBSS3NHY8HTxhLOwF75T%3DjS1bfqVzD2g%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALjhuifbxeUpHK4LMvw9LSrY%3Dy87zorBNsWQGV00CQ7YpQNQrA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALjhuifbxeUpHK4LMvw9LSrY%3Dy87zorBNsWQGV00CQ7YpQNQrA%40mail.gmail.com.
Congrats on landing!
I don't think I was aware of this particular email thread. There seems to be a misconception about snapshot size.
The full snapshot takes about 1.6mb, but that's mostly the startup snapshot to initialize the isolate. The context snapshot merely takes 60kb. There can be more than one context snapshot, with each Additional one taking 60kb, or more depending on its content.
I think that an additional 60kb is acceptable even for low end devices and Android. To put into perspective: the startup snapshot contains some builtin code that are in the same order of magnitude. The impact of the snapshot is even more pronounced on low end devices.
Cheers,
Yang
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALjhuifbxeUpHK4LMvw9LSrY%3Dy87zorBNsWQGV00CQ7YpQNQrA%40mail.gmail.com.
Congrats on landing!
I don't think I was aware of this particular email thread. There seems to be a misconception about snapshot size.
The full snapshot takes about 1.6mb, but that's mostly the startup snapshot to initialize the isolate. The context snapshot merely takes 60kb. There can be more than one context snapshot, with each Additional one taking 60kb, or more depending on its content.
I think that an additional 60kb is acceptable even for low end devices and Android. To put into perspective: the startup snapshot contains some builtin code that are in the same order of magnitude. The impact of the snapshot is even more pronounced on low end devices.
Cheers,
Yang
On Fri, Jul 28, 2017, 11:10 Kentaro Hara <har...@chromium.org> wrote:I saw your CL finally landed on ToT! Combined with other optimizations we've already landed, the V8 context initialization became >3 times faster :D
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFSTc_jcEGgmrZWxrrYbeQ%2B5fOPaA%2Bz5c0cyp2WBDKSXaCPh8w%40mail.gmail.com.
Congrats on landing!
I don't think I was aware of this particular email thread. There seems to be a misconception about snapshot size.
The full snapshot takes about 1.6mb, but that's mostly the startup snapshot to initialize the isolate. The context snapshot merely takes 60kb. There can be more than one context snapshot, with each Additional one taking 60kb, or more depending on its content.
I think that an additional 60kb is acceptable even for low end devices and Android. To put into perspective: the startup snapshot contains some builtin code that are in the same order of magnitude. The impact of the snapshot is even more pronounced on low end devices.
Cheers,
Yang
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALjhuifbxeUpHK4LMvw9LSrY%3Dy87zorBNsWQGV00CQ7YpQNQrA%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
I'm surprised to hear that you are using an independent snapshot file. You should be able to simply extend the existing snapshot file with additional contexts and templates. These should not take a lot of space in comparison to the startup snapshot, which contains a lot of context-independent things, for example close to 1mb of code objects. These things are redundant if you ship two snapshot files.
Anyways, if you have questions, please let me know!
Cheers,
Yang
Cheers,
Yang
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALjhuifbxeUpHK4LMvw9LSrY%3Dy87zorBNsWQGV00CQ7YpQNQrA%40mail.gmail.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ef9f926f-4328-4f67-b30a-229c4f7712f0%40chromium.org.
Following your instruction I successfully tried the feature, and found the improvement very promising. Nice work done!
I’d like to have a try enabling this on ChromeOS. Before I start I have two more questions, which hope you can kindly answer:
1. Have you considered generating snapshot at browser’s first startup, instead of build time?
This can resolve many issues, like ChromeOS building/cross building/Android binary size…etc., in exchange of an extended first startup time, which is not very obvious on desktop (<0.1s).
Is there anything blocking doing this, or a slow startup not acceptable, or building snapshot generator into Chrome too complex?
2. What do you think could be the better way to resolve the building dependency? Here’s what’s on my mind:
a. Adding required library into ChromeOS chroot build environment to make it work like a normal Linux building environment
b. Reducing deps in tools/v8_context_snapshot/BUILD.gn, as I’m pretty sure it doesn’t need all of Blink & V8
1. Yes, it was an option to build the snapshot at each user-side, and I think it a doable way.
We decided to deliver a built snapshot because it is easy to make a program.
AFAIK, we have no blocking issues, but I feel it a heavy task. Action items are following.
- Check if a snapshot already exists. If it doesn't or it is old enough, we have to remake it.
- We have to make a routine to communicate between browser process and a renderer process to write down a snapshot file.
- Only browser process can create a file.
- A renderer is needed to work with Blink component.
2. if you would like to use snapshot on ChromeOS with current system, I feel (b) is better, while (a) is easy to work for.
I have no other idea to resolve the issue.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA%2BESgZCrtMnX-REqViTRwAuXJNOA%3DYuZT0%3DF%2BkGMq%2Bew%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXCcmpzBQshAibnL%2BdVOuCE7DP16%2BXmA8qYODKfJrG%2Bekg%40mail.gmail.com.
Currently v8_context_snapshot.bin is created if use_v8_context_snapshot is true.It is set true by default depending on the build environment (see v8_context_snapshot.gni) but you can set it false in gn args.IIUC, most trybots do not build blink twice, because they are not cross-build bots or setting use_v8_context_snapshot false.However, in near future, we want to enable this feature also on Android, and it must increase compile time for x1.5.(Some my WIP CLs show that compile time will become 46 min. from 29 min on android_n5x_swarming_rel.)So it worth discussing what the default value of use_v8_context_snapshot should be.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEoffTBRVXGMPnJBbG-dGv6YoURtwCmfqbbnonP%3DPCC%3DHXJt6w%40mail.gmail.com.
Currently v8_context_snapshot.bin is created if use_v8_context_snapshot is true.It is set true by default depending on the build environment (see v8_context_snapshot.gni) but you can set it false in gn args.IIUC, most trybots do not build blink twice, because they are not cross-build bots or setting use_v8_context_snapshot false.However, in near future, we want to enable this feature also on Android, and it must increase compile time for x1.5.(Some my WIP CLs show that compile time will become 46 min. from 29 min on android_n5x_swarming_rel.)So it worth discussing what the default value of use_v8_context_snapshot should be.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA5%2BNuNUWs677pOAVWfWbsbFjSJx-G5yG64WAFjJ1g5yw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA5%2BNuNUWs677pOAVWfWbsbFjSJx-G5yG64WAFjJ1g5yw%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA5%2BNuNUWs677pOAVWfWbsbFjSJx-G5yG64WAFjJ1g5yw%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
--Kentaro Hara, Tokyo, Japan
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXCbJTJDMEB7OaWv3XhQi%2BJ_E9i%3D0-AV0nEwBt18jVAYyw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA5%2BNuNUWs677pOAVWfWbsbFjSJx-G5yG64WAFjJ1g5yw%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
Isn't it already enabled for release desktop builds? I thought from up-thread it was only disabled for Android, CrOS, and cross-builds.
Isn't it already enabled for release desktop builds? I thought from up-thread it was only disabled for Android, CrOS, and cross-builds.
If this requires us to compile Blink twice, I think it's probably not worth it to enable for Android release builds, just like we wouldn't enable PGO or LTO by default.-- DirkOn Mon, Mar 19, 2018 at 11:12 AM, Ojan Vafai <oj...@chromium.org> wrote:Is there an eventual path towards enabling this for release builds and desktop? A lot of people do local performance testing on release builds, so it's best if the differences between release and official are as minimal as possible to avoid performance testing on something too different from what we see in the wild.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXA5%2BNuNUWs677pOAVWfWbsbFjSJx-G5yG64WAFjJ1g5yw%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJnxdXCbJTJDMEB7OaWv3XhQi%2BJ_E9i%3D0-AV0nEwBt18jVAYyw%40mail.gmail.com.
Nice feature, i have a quick questions on enabled this feature?Just for my learning purpose Can we disabled it for linux too?
Thanks for updating Yuki, i see after using the use_v8_context_snapshot = false flag, the v8_context_snapshot.bin file not getting generated in the out/Release.1. But when I am running the content_shell without this file getting the following error?#
# Fatal error in , line 0
# Failed to deserialize the V8 snapshot blob. This can mean that the snapshot blob file is corrupted or missing.
Also not seeing any reduction in the size of my .so file, that means disabling v8_context_snapshot will help not depending on v8_context_snapshot.bin file any more, and this is the only win?
Yes, I am building it with that flag, i am able to build the code but it's failing to run.
did you see any size reduction in the content_shell binary? after disabling it.
ok so after disabling the snapshot image we no longer depending onv8_context_snapshot.bin ? Is that correct?