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

Issue 592770 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Custom property storage can be expensive

Project Member Reported by dstockwell@chromium.org, Mar 7 2016

Issue description

Labels: M-51
Owner: shans@chromium.org
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 8 2016

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

commit 816a8ffc2122e85bd9de4f5e0a30378170c7ca99
Author: shans <shans@chromium.org>
Date: Fri Apr 08 06:11:04 2016

Refactor StyleVariableData to fallback on root map.

A StyleVariableData object is a 'root' when it is constructed
empty rather than as a copy of another StyleVariableData. This
change points all derived StyleVariableData objects back to
their root, and delegates lookups rather than copying variable
values.

This is a performance motivated change. Adding custom properties
to a node used to require that the inherited properties object
from the parent node be copied. This coupled with a standard
practice of creating several hundred custom properties on the
root node resulted in expensive style recalculation (e.g. more
than 50ms on desktop to create 1000 child custom properties).

With this change incorporated, root node custom properties
always form a fallback dictionary that is never copied, so
creating 1000 child custom properties costs approximately
the same as creating none.

BUG= 592770 

Review URL: https://codereview.chromium.org/1858553002

Cr-Commit-Position: refs/heads/master@{#386004}

[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.h
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/style/StyleVariableData.cpp
[modify] https://crrev.com/816a8ffc2122e85bd9de4f5e0a30378170c7ca99/third_party/WebKit/Source/core/style/StyleVariableData.h

Comment 3 by timloh@chromium.org, Apr 15 2016

Status: Fixed (was: Available)

Sign in to add a comment