Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Issue 136693009: Refactor RenderStyle::diff to be grouped by type and guard with pointer compares on structs (Closed)

Created:
6 years, 11 months ago by esprehn
Modified:
6 years, 11 months ago
Reviewers:
ojan, pdr., shawnsingh, eseidel
CC:
blink-reviews, bemjb+rendering_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, zoltan1, abarth-chromium
Visibility:
Public.

Description

Refactor RenderStyle::diff to be grouped by type and guard with pointer compares on structs This patch moves around the checks inside RenderStyle::diff so that as much a possible the checks for a given structure of data are all grouped and then guards those checks with a pointer compare on the struct when possible. This was already done for some of the structs but not all of them. I also noticed that the logic for table display types had not been updated for flex box so I removed the >= TABLE check and replaced it with a LAST_TABLE_DISPLAY and FIRST_TABLE_DISPLAY guard cutting out a bunch of if checks for flex boxes. Similarly we were deep comparing the SVGRenderStyle because we were using the overloaded operator== on the DataRef<SVGRenderStyle> before calling into ::diff() to do the real comparison which is a waste. I changed to a pointer comparison which will reduce the number of duplicate checks for SVG elements. While this is definitely a set of micro-optimizations it should reduce the number of checks for a typical RenderStyle::diff which is very hot code in all our benchmarks. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165037

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add comment per ojan and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -100 lines) Patch
M Source/core/rendering/style/RenderStyle.cpp View 1 6 chunks +86 lines, -99 lines 0 comments Download
M Source/core/rendering/style/RenderStyleConstants.h View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
esprehn
6 years, 11 months ago (2014-01-14 00:39:34 UTC) #1
ojan
lgtm https://codereview.chromium.org/136693009/diff/1/Source/core/rendering/style/RenderStyle.cpp File Source/core/rendering/style/RenderStyle.cpp (right): https://codereview.chromium.org/136693009/diff/1/Source/core/rendering/style/RenderStyle.cpp#newcode373 Source/core/rendering/style/RenderStyle.cpp:373: if (m_svgStyle.get() != other->m_svgStyle.get()) { If you're going ...
6 years, 11 months ago (2014-01-14 00:49:35 UTC) #2
esprehn
On 2014/01/14 00:49:35, ojan wrote: > lgtm > > https://codereview.chromium.org/136693009/diff/1/Source/core/rendering/style/RenderStyle.cpp > File Source/core/rendering/style/RenderStyle.cpp (right): > ...
6 years, 11 months ago (2014-01-14 04:20:14 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/136693009/60001
6 years, 11 months ago (2014-01-14 04:29:40 UTC) #4
commit-bot: I haz the power
6 years, 11 months ago (2014-01-14 07:59:19 UTC) #5
Message was sent while issue was closed.
Change committed as 165037

Powered by Google App Engine
This is Rietveld 408576698