Custom property storage can be expensive |
||
Issue descriptioneg. http://jsbin.com/sivasuh/1/edit?js,output Some notes on the current state and possible options: https://docs.google.com/document/d/1MNTcK9HjXG_En0O4z5HZd6Jzahs_Aowob5C9WRHWnDQ
,
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
,
Apr 15 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by dstockwell@chromium.org
, Mar 15 2016Owner: shans@chromium.org