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

Issue 608333 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Reduce external memory jank in V8 GC

Project Member Reported by u...@chromium.org, May 2 2016

Issue description

Currently  external.mc_epilogue and external.weak_global_handles phases can take up to 5ms each on the v8.infinite_scroll benchmark.

This issue tracks improvements for these phases.
 

Comment 1 by u...@chromium.org, May 4 2016

The jank in external.weak_global_handles can be reduced by introducing a new type of phantom handles without callback that are automatically reset on finalization.

This would save cost of maintaining the pending_phantom_callbacks and the cost of jumping between blink and V8 for each callback.

Project Member

Comment 2 by bugdroid1@chromium.org, May 9 2016

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

commit a6da98d86ffab7e1e50319ed12b57fcb366e24ee
Author: ulan <ulan@chromium.org>
Date: Mon May 09 07:15:43 2016

Introduce a new phantom weakness type without finalization callback.
Handles of this type are automatically reset by the garbage collector
when their objects are not longer reachable.

The motivation is to reduce pause time of external.weak_global_handles
phase of the garbage collector by not maintaing the list of pending
callbacks and not calling the callbacks.

Local testing on discourse page of the v8.inifinite_scroll benchmark
shows 7x improvement for this GC phase.

Before:
external.weak_global_handles
 len: 21
 min: 0.0
 max: 4.5
 avg: 0.757142857143

After:
external.weak_global_handles
 len: 21
 min: 0.0
 max: 0.5
 avg: 0.109523809524

A follow-up patch will enable the new phantom handles in Chromium.

BUG= chromium:608333 
LOG=NO

Review-Url: https://codereview.chromium.org/1950963002
Cr-Commit-Position: refs/heads/master@{#36095}

[modify] https://crrev.com/a6da98d86ffab7e1e50319ed12b57fcb366e24ee/include/v8.h
[modify] https://crrev.com/a6da98d86ffab7e1e50319ed12b57fcb366e24ee/src/api.cc
[modify] https://crrev.com/a6da98d86ffab7e1e50319ed12b57fcb366e24ee/src/global-handles.cc
[modify] https://crrev.com/a6da98d86ffab7e1e50319ed12b57fcb366e24ee/src/global-handles.h
[modify] https://crrev.com/a6da98d86ffab7e1e50319ed12b57fcb366e24ee/test/cctest/test-global-handles.cc

Project Member

Comment 3 by bugdroid1@chromium.org, May 10 2016

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

commit b19982c4431d0e8994b74992727e05cfb2e4ce37
Author: ulan <ulan@chromium.org>
Date: Tue May 10 15:28:16 2016

Use a new type of weak phantom handle for ScriptWrappable.

The new phantom handle does not require a callback and is reset
automatically by the garbage collector.

Since we do not have finalization callback anymore, we account for the
freed wrappers in GC epilogue by using a new V8 API function.

This drastically reduces time spent in callback handling
phases of V8 GC on v8.infinite_scroll benchmark.

See the related CL in V8 for more motivation and results:
https://codereview.chromium.org/1950963002

BUG= 608333 

Review-Url: https://codereview.chromium.org/1944363002
Cr-Commit-Position: refs/heads/master@{#392613}

[modify] https://crrev.com/b19982c4431d0e8994b74992727e05cfb2e4ce37/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
[modify] https://crrev.com/b19982c4431d0e8994b74992727e05cfb2e4ce37/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Comment 4 by u...@chromium.org, Jul 24 2017

Status: Fixed (was: Assigned)

Sign in to add a comment