New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 783124 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocked on:
issue 769203



Sign in to add a comment

Improve V8 code caching

Project Member Reported by leszeks@chromium.org, Nov 9 2017

Issue description

This is a tracking bug for V8/Blink code caching improvements

We have observed V8 code caching to have a low hit rate (~20%), and experiments suggest that more aggressive caching improves warm startup performance.

We are currently looking to:

1. Investigate current cache behaviour with UMA (chromium:769203).
2. Look into improving serialization/deserialization performance.
3. Consider changing caching heuristics, when caching is performed, or change the contents of the cache in some other way, to improve warm page load performance and/or decrease jank from compilation.
 
Cc: kenjibaheux@chromium.org
Components: Blink>JavaScript
Labels: -Type-Bug -Pri-3 Pri-2 Type-Feature
Status: Available (was: Untriaged)
I implemented an experiment here for creating the snapshot after execution: https://chromium-review.googlesource.com/c/v8/v8/+/758587

I think Mythri improved on this with a cleaner implementation. Mythri, do you have any updates or data on that?
Yes, I am working on V8 side changes and upload a cl today or tomorrow. I am planning to put this behind a flag.  Hiroshige pointed out that on the blink side, currently we do not allow revalidation of the cache till we compile the top level code because if we receive the serialized code after revalidating the cache it may cause some problems. Hence, to ensure correctness we have to extend this period (where we do not allow revalidation of cache) to a point after we execute and request the code cache. Hiroshige will work on the changes related to the revalidation period of cache. This only happens in some edge cases, so I can still collect some numbers related to code caching after execution sometime this week. I will also have a blink side cl ready and wait for hiroshige's changes for the revalidation before landing it.
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/5d4a090377978b881215c8575b063250a69dc406

commit 5d4a090377978b881215c8575b063250a69dc406
Author: Mythri <mythria@chromium.org>
Date: Wed Nov 29 13:38:03 2017

Add support to produce code cache after execute.

Adds new API function to request code cache. Earlier code cache was
produced along with compile requests. This new API allows us to request
code cache after executing. Also adds support in the code serializer to
serialize after executing the script.

Bug: chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id7b972a2b4c8dcf7a6d9f5ea210890ae968320bd
Reviewed-on: https://chromium-review.googlesource.com/781767
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49717}
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/include/v8.h
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/api.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/compiler.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/d8.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/d8.h
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/objects.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/objects/code-inl.h
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/objects/code.h
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/objects/script.h
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/snapshot/code-serializer.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/src/snapshot/deserializer.cc
[modify] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/test/cctest/test-serialize.cc
[add] https://crrev.com/5d4a090377978b881215c8575b063250a69dc406/test/mjsunit/serialize-after-execute.js

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4

commit 5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4
Author: Michael Achenbach <machenbach@chromium.org>
Date: Wed Nov 29 14:59:11 2017

Revert "Add support to produce code cache after execute."

This reverts commit 5d4a090377978b881215c8575b063250a69dc406.

Reason for revert: Speculative revert due to timeouts on testing with
--isolates:
https://build.chromium.org/p/client.v8/builders/V8%20Linux/builds/21889
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20debug/builds/18138

Original change's description:
> Add support to produce code cache after execute.
> 
> Adds new API function to request code cache. Earlier code cache was
> produced along with compile requests. This new API allows us to request
> code cache after executing. Also adds support in the code serializer to
> serialize after executing the script.
> 
> Bug: chromium:783124
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: Id7b972a2b4c8dcf7a6d9f5ea210890ae968320bd
> Reviewed-on: https://chromium-review.googlesource.com/781767
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Mythri Alle <mythria@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#49717}

TBR=ulan@chromium.org,rmcilroy@chromium.org,yangguo@chromium.org,mythria@chromium.org

Change-Id: Id9e0285e73bbc3ea3908b4b7bbf6599e4f7cd76e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/796870
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49722}
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/include/v8.h
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/api.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/compiler.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/d8.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/d8.h
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/objects.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/objects/code-inl.h
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/objects/code.h
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/objects/script.h
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/snapshot/code-serializer.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/src/snapshot/deserializer.cc
[modify] https://crrev.com/5ff7af939e3e5dbcaaabd5a8490f63eac30a65a4/test/cctest/test-serialize.cc
[delete] https://crrev.com/27fd921a28c886e5396b29e2b2f9bd8d12ab6a4b/test/mjsunit/serialize-after-execute.js

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/dae20b0df641d7c6c3b5bbca3755c69bde236275

commit dae20b0df641d7c6c3b5bbca3755c69bde236275
Author: Mythri <mythria@chromium.org>
Date: Fri Dec 01 14:02:47 2017

Reland "Add support to produce code cache after execute"

Adds new API function to request code cache. Earlier code cache was
produced along with compile requests. This new API allows us to request
code cache after executing. Also adds support in the code serializer to
serialize after executing the script.

Bug: chromium:783124, chromium:789694 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id4e6a967e176e3e979dc4ccb9a37a353c70c3890
Reviewed-on: https://chromium-review.googlesource.com/797036
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49793}
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/include/v8.h
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/api.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/compiler.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/d8.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/d8.h
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/objects.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/objects/code-inl.h
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/objects/code.h
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/objects/script.h
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/snapshot/code-serializer.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/src/snapshot/deserializer.cc
[modify] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/test/cctest/test-serialize.cc
[add] https://crrev.com/dae20b0df641d7c6c3b5bbca3755c69bde236275/test/mjsunit/serialize-after-execute.js

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/03b4d39133b23118c9a7c50c32e3297212b4f3fc

commit 03b4d39133b23118c9a7c50c32e3297212b4f3fc
Author: Mythri <mythria@chromium.org>
Date: Mon Dec 04 16:25:47 2017

Fix a race condition when accessing code_cache_map_ in d8

code_cache_map_ is used to store the serialized code that could
be consumed in the subsequent runs. This is a std::map which is not
thread safe. So protect this with mutex to avoid any race conditions
when executing in multiple isolates in parallel.

Bug: chromium:783124
Change-Id: Ie58402b8547cf3e83716b8d97d98a298745e487f
Reviewed-on: https://chromium-review.googlesource.com/806334
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49837}
[modify] https://crrev.com/03b4d39133b23118c9a7c50c32e3297212b4f3fc/src/d8.cc
[modify] https://crrev.com/03b4d39133b23118c9a7c50c32e3297212b4f3fc/src/d8.h

So now that we have an API that supports producing the cache after execution, this occurred to me: it is not guaranteed that code that we have compiled survives until we produce the code cache. The script object only weakly holds onto shared function infos. So by the time execution has completed, it is likely that some functions, including the top-level function, have been garbage collected and won't end up in the code cache.

It's a bit better for when we deserialize, since the top-level function holds strongly onto inner functions, which hold onto nested inner functions, etc. That is assuming that we indeed have the full tree starting from the top-level function.
So maybe we need to turn Script::shared_function_infos into a strong list for cases where we are interested in serialization, and only later turn it into a weak list.
As discussed offline, for the initial approach of producing the code cache after the top level execute, we still hold onto the v8::Script (not the v8::internal::Script) object strongly on the blink side. v8::Script is the JSFunction for the top level code which holds the shared_function_info which I think would keep the nested shared_function_infos live. So, this would not be a problem for just producing cache right after execute. When we want to delay the code caching even further, (may be during the idle time or asynchronously) then we may have the case, where GC has removed some functions. Though I think for that case, we should either hold onto the top level shared_function_info strongly on the blink side (may be in the idle / asynchronous task) till we produce the cache or don't request the cache if it has been GC'ed. 
Project Member

Comment 13 by bugdroid1@chromium.org, Dec 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/80ec64200d9f0783e7b8988aad43960d7ec3d36b

commit 80ec64200d9f0783e7b8988aad43960d7ec3d36b
Author: Mythri <mythria@chromium.org>
Date: Fri Dec 15 15:28:07 2017

Add support for tracing and counters for CreateCodeCache


Bug: chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: If2b5d8030d2a8c86c67cb460632a41a11e2c4371
Reviewed-on: https://chromium-review.googlesource.com/828978
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50131}
[modify] https://crrev.com/80ec64200d9f0783e7b8988aad43960d7ec3d36b/src/api.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Jan 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8ca7772351ed6ab24ea211a40eaab45737d74f17

commit 8ca7772351ed6ab24ea211a40eaab45737d74f17
Author: Mythri Alle <mythria@chromium.org>
Date: Tue Jan 02 13:11:04 2018

Add default case option in switch statement in CompileOptionsString

Now V8 has an API to request code cache. Earlier, we had to request
code cache along with compile requests. Since we have an explicit API
to request code cache, we want to decouple compile and code caching.
As a part of this, we want to change v8::ScriptCompiler::CompileOptions
by removing kProduceCodeCache, kProduceFullCodeCache and adding
kCompileEager. To smoothly integrate these changes into chromium,
introducing a default case in the switch statements using
CompileOptions. This will be removed once the V8 roll that adds these
options is rolled into chromium.

Bug: chromium:783124
Change-Id: Ia4e72e2a00f72f81e21949f6e892250bf4bfb7c5
Reviewed-on: https://chromium-review.googlesource.com/831951
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526468}
[modify] https://crrev.com/8ca7772351ed6ab24ea211a40eaab45737d74f17/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp

Project Member

Comment 15 by bugdroid1@chromium.org, Jan 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/c5eb79e6aab8d320eb6481dfdf6c463ec8bf5472

commit c5eb79e6aab8d320eb6481dfdf6c463ec8bf5472
Author: Mythri <mythria@chromium.org>
Date: Wed Jan 03 11:20:24 2018

Add new options to CompileOptions and NoCacheReason

Now that we have an API to request code cache, we want to decouple
compilation from serialization. As a first step, we will add CompileEager
option (used when we want to produce full code cache) and
DeferredProduceCodeOption to NoCacheReason. This is so that we can
properly bucket the compilation time and collect statistics about the
cache behaviour. Once, blink and node start using the new API, we can
remove the code to produce code cache from the compilation.

Bug: chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I35dbb6b0af39940450d412ff75b769603398b2f6
Reviewed-on: https://chromium-review.googlesource.com/828977
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50336}
[modify] https://crrev.com/c5eb79e6aab8d320eb6481dfdf6c463ec8bf5472/include/v8.h
[modify] https://crrev.com/c5eb79e6aab8d320eb6481dfdf6c463ec8bf5472/src/compiler.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Jan 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/9a3cd042cd85b3a6f06aa592954bcd2cd1cee70d

commit 9a3cd042cd85b3a6f06aa592954bcd2cd1cee70d
Author: Mythri <mythria@chromium.org>
Date: Mon Jan 08 11:21:37 2018

Fix checks to consider the new ScriptCompiler::kEagerCompile option

Bug: chromium:783124
Change-Id: Ie420be3ad05583d8ad999ab1e13e89ada4774028
Reviewed-on: https://chromium-review.googlesource.com/850674
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50398}
[modify] https://crrev.com/9a3cd042cd85b3a6f06aa592954bcd2cd1cee70d/src/compiler.cc
[modify] https://crrev.com/9a3cd042cd85b3a6f06aa592954bcd2cd1cee70d/src/parsing/background-parsing-task.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Jan 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/76067d1c63e1e6b2ba456059c78532a748f8f41a

commit 76067d1c63e1e6b2ba456059c78532a748f8f41a
Author: Mythri Alle <mythria@chromium.org>
Date: Mon Jan 22 17:23:23 2018

Use explicit API to request code cache.

V8 used to produce code cache along with the compile requests depending
on the options provided by Blink. Now, V8 has a separate API to request
code cache. Use the new API to request code cache. This also enables to
request the code cache after execute or at a different point from the
blink side. It need not be tied to the compile anymore.

Bug: chromium:783124
Change-Id: Id21e615fcb9b1f526f9b179e3a23f06070ed2a1c
Reviewed-on: https://chromium-review.googlesource.com/829035
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530901}
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache-expected.txt
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
[modify] https://crrev.com/76067d1c63e1e6b2ba456059c78532a748f8f41a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Jan 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f35da1e67a72557eece061711241cc10e1572e22

commit f35da1e67a72557eece061711241cc10e1572e22
Author: Hiroshige Hayashizaki <hiroshige@chromium.org>
Date: Tue Jan 30 05:58:32 2018

Decouple CachedMetadataHandler from Resource

This CL removes a reference from CachedMetadataHandlerImpl to
Resource, and instead captures necessary data from Resource
when CachedMetadataHandlerImpl is created, i.e. when a response
is received.

This is to make CachedMetadataHandler and Resource independent,
so that CachedMetadataHandler can be used even when the
corresponding Resource is garbage-collected or revalidated,
for Issue 783124.

This CL causes a behavior change in CachedMetadataHandler::Encoding():
Previously, it returned the final encoding that reflected the
encoding detection by the response body.
After this CL, it returns the encoding at the time of
ResponseReceived() that doesn't reflect the encoding detection
(by UTF BOMs in the case of scripts).
This shouldn't affect the correctness, because if the encoding at
the time of ResponseReceived() is the same, then the final encoding
should be also the same (provided the response content is the same).

This might cause different Encoding()s are returned for the same
final encoding and thus affect memory/performance, but this is
expected to be quite rare because UTF BOMs are quite rare.

Bug:  784875 , 783124
Change-Id: I0b72fafc54537fae93c90d1abf3bddf4e094add8
Reviewed-on: https://chromium-review.googlesource.com/791494
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532784}
[modify] https://crrev.com/f35da1e67a72557eece061711241cc10e1572e22/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Jan 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce90a370697dc1017b17d3928ebf01eedcf72c62

commit ce90a370697dc1017b17d3928ebf01eedcf72c62
Author: Mythri Alle <mythria@chromium.org>
Date: Tue Jan 30 14:12:35 2018

Add a feature to enable code caching after execute

This feature is to run a finch experiment to measure the performance
of requesting code cache after execute.

Bug: chromium:783124
Change-Id: I7cc90c3f341c19e3727ad84903a774f8197663f2
Reviewed-on: https://chromium-review.googlesource.com/829093
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532856}
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/content/child/runtime_features.cc
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/content/public/common/content_features.cc
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/content/public/common/content_features.h
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/third_party/WebKit/Source/platform/runtime_enabled_features.json5
[modify] https://crrev.com/ce90a370697dc1017b17d3928ebf01eedcf72c62/third_party/WebKit/public/platform/WebRuntimeFeatures.h

Project Member

Comment 20 by bugdroid1@chromium.org, Feb 21 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/5a68df2ab528ae8248806ae4fe7f8b52a14f731c

commit 5a68df2ab528ae8248806ae4fe7f8b52a14f731c
Author: Mythri <mythria@chromium.org>
Date: Wed Feb 21 09:51:31 2018

Remove support for unused compile options.

We don't use parser caches anymore and request code caches
explicitly using ScriptCompiler::CreateCodeCache. Hence
removing the support for both parser cache and code cache options.
They are still retained in CompileOptions for backwards
compatibility. Apart from the api.cc, no other part should see
this option.

Bug:  chromium:779254 , chromium:783124
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ic8ad9afe3fa44bbb5adc71bdde59c0b4057a523d
Reviewed-on: https://chromium-review.googlesource.com/916261
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51416}
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/api.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/compiler.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/d8.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/background-parsing-task.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/background-parsing-task.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/parse-info.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/parse-info.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/parser.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/parser.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/parsing.cc
[delete] https://crrev.com/dea41745eec891609e691c9f2e7c9cc05fc8b9dc/src/parsing/preparse-data-format.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/preparse-data.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/preparse-data.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/parsing/preparser.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/snapshot/code-serializer.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/src/snapshot/code-serializer.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/test/cctest/cctest.h
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/test/cctest/test-api.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/test/cctest/test-debug.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/test/cctest/test-parsing.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/test/cctest/test-serialize.cc
[modify] https://crrev.com/5a68df2ab528ae8248806ae4fe7f8b52a14f731c/tools/parser-shell.cc

The "CodeCacheAfterExecute" feature is on finch experiment since two weeks and the results look promising: Here is the short summary:
   - A reduction of 30-35% in the overall JavaScript compilation time. 
   - No regressions on the memory used by renderer or browser. 
  -  4-6% reduction in the time html parse is blocked by JavaScript execution.
   - 1-2% reduction in the top level loading metric of NavigationStartToDomContentLoadedTime

More detailed results in this document: https://docs.google.com/document/d/1Y-a1XcpImrCMCMLJosNiMfjtIjP9zL_upUGlJzeowSo/edit?usp=sharing
Do we actually have any metrics on disk memory usage?
Project Member

Comment 23 by bugdroid1@chromium.org, Feb 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4043418267791fb7e8f89150f3dcfbadb5eeef16

commit 4043418267791fb7e8f89150f3dcfbadb5eeef16
Author: Mythri Alle <mythria@chromium.org>
Date: Wed Feb 28 11:39:09 2018

Enable CodeCacheAfterExecute by default.

CodeCacheAfterExecute is on a finch experiment since 3 weeks and
the results from the finch trial show a 20-40% reduction in
javascript compilation time [1].

[1]:https://docs.google.com/document/d/1Y-a1XcpImrCMCMLJosNiMfjtIjP9zL_upUGlJzeowSo/edit?usp=sharing

Bug: chromium:808007, chromium:783124
Change-Id: Idb0264a81eebc23b12cad71a7dfcdb2a9c0edae7
Reviewed-on: https://chromium-review.googlesource.com/939385
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539790}
[modify] https://crrev.com/4043418267791fb7e8f89150f3dcfbadb5eeef16/content/public/common/content_features.cc

We don't have metrics for memory usage on disk. The disk size is capped and storing too much into the disk cache would impact the hit rate (HttpCache.Pattern) and cache eviction metrics (SimpleCache.Http.Eviction.*). I looked at those metrics on the UMA and they are not impacted by the CodeCachingAfterExecute experiment. I updated the document[1] with these details.

[1] https://docs.google.com/document/d/1Y-a1XcpImrCMCMLJosNiMfjtIjP9zL_upUGlJzeowSo/edit?usp=sharing

Project Member

Comment 25 by bugdroid1@chromium.org, Mar 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/90b511277cd9246c9773b2200910b7cede20501f

commit 90b511277cd9246c9773b2200910b7cede20501f
Author: Leszek Swirski <leszeks@chromium.org>
Date: Fri Mar 02 11:53:33 2018

Make cache handler management virtual

Makes the cache handler management in Resource virtual, and move the
implementations to ScriptResource, so that other resources can create
and manage different implementations of CachedMetadataHandler.

One simplification to enable this is to move the platform sending logic,
different between service workers and non-service-workers, into a
separate callback class, which is passed to the cache handler creation.

Bug: chromium:783124
Change-Id: Ib1dcea072bce3f91e0c07732ca1881089187b0f5
Reviewed-on: https://chromium-review.googlesource.com/895686
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540497}
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/fetch/CachedMetadataHandler.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/fetch/Resource.h
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/fetch/ResourceTest.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/testing/MockResource.cpp
[modify] https://crrev.com/90b511277cd9246c9773b2200910b7cede20501f/third_party/WebKit/Source/platform/loader/testing/MockResource.h

Project Member

Comment 26 by bugdroid1@chromium.org, Mar 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dc154d98398e85f11d21372b1746672a4a48123a

commit dc154d98398e85f11d21372b1746672a4a48123a
Author: Leszek Swirski <leszeks@chromium.org>
Date: Fri Mar 02 15:12:34 2018

Fix ScriptResource setting the wrong cache handler

Due to a bad refactoring, ScriptResource was setting data on a cache
handler field it owned, rather than the cache handler of the Resource.

Bug: chromium:783124
Change-Id: I364b1d704821d9c14ad67b2af449c6f5b9aeca43
Reviewed-on: https://chromium-review.googlesource.com/946249
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540519}
[modify] https://crrev.com/dc154d98398e85f11d21372b1746672a4a48123a/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
[modify] https://crrev.com/dc154d98398e85f11d21372b1746672a4a48123a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h

Note that kEagerCompile does not work as advertised. Details here: https://bugs.chromium.org/p/v8/issues/detail?id=7591
Project Member

Comment 28 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea8b550bc13c647c7297e92bfed1de5ab6d01c11

commit ea8b550bc13c647c7297e92bfed1de5ab6d01c11
Author: Mythri Alle <mythria@chromium.org>
Date: Wed Apr 18 18:15:37 2018

Remove CodeCacheAfterExecute feature

CodeCacheAfterExecute feature was added to setup a finch trial
for the new v8 code caching mechanism. Now, the feature is
enabled by default and hence removing this feature.

Bug: 783124
Change-Id: I3e59c9a17b72a4201d8b74dc230988dfc7cbf96d
Reviewed-on: https://chromium-review.googlesource.com/1012115
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551746}
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/content/child/runtime_features.cc
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/content/public/common/content_features.cc
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/content/public/common/content_features.h
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/third_party/blink/public/platform/web_runtime_features.h
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/third_party/blink/renderer/bindings/core/v8/script_controller.cc
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.cc
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/third_party/blink/renderer/platform/exported/web_runtime_features.cc
[modify] https://crrev.com/ea8b550bc13c647c7297e92bfed1de5ab6d01c11/third_party/blink/renderer/platform/runtime_enabled_features.json5

Sign in to add a comment