DescriptionRefactor 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 #
Messages
Total messages: 5 (0 generated)
|