Bug 79591

Summary: Avoid doing 2 hash lookups if we override RenderBox's logical width / height
Product: WebKit Reporter: Julien Chaffraix <jchaffraix>
Component: Layout and RenderingAssignee: Julien Chaffraix <jchaffraix>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed refactoring.
none
Smaller, better change. No change on html5-full-render.html this time. none

Julien Chaffraix
Reported 2012-02-25 18:36:43 PST
Currently all RenderBoxes are calling clearOverrideSize. However a RenderBox could have an override size in only 3 cases: * if it's a child of a RenderDeprecatedFlexibleBox * if it's a child of a RenderFlexibleBox * if it's a RenderTableCell That would remove 2 hash lookups from RenderBox::willBeDestroyed.
Attachments
Proposed refactoring. (6.61 KB, patch)
2012-02-25 18:49 PST, Julien Chaffraix
no flags
Smaller, better change. No change on html5-full-render.html this time. (1.49 KB, patch)
2012-02-27 13:22 PST, Julien Chaffraix
no flags
Julien Chaffraix
Comment 1 2012-02-25 18:49:09 PST
Created attachment 128899 [details] Proposed refactoring.
Benjamin Poulain
Comment 2 2012-02-25 19:09:37 PST
Comment on attachment 128899 [details] Proposed refactoring. View in context: https://bugs.webkit.org/attachment.cgi?id=128899&action=review r~ from me :-D > Source/WebCore/rendering/RenderBox.cpp:-251 > - clearOverrideSize(); > - I am not convinced by this change. You are spreading complexity to avoid one very simple call. Could you find if this has any impact? > Source/WebCore/rendering/RenderBox.cpp:802 > - if (hasOverrideHeight()) > + if (gOverrideHeightMap) > gOverrideHeightMap->remove(this); > - if (hasOverrideWidth()) > + if (gOverrideWidthMap) > gOverrideWidthMap->remove(this); This looks good.
Benjamin Poulain
Comment 3 2012-02-26 00:17:17 PST
Comment on attachment 128899 [details] Proposed refactoring. Let's r- until you benchmark it.
Julien Chaffraix
Comment 4 2012-02-27 12:54:25 PST
> Let's r- until you benchmark it. Thanks for doubting my change. I tested on html5-full-renderer and it looks like it regressed a bit the benchmark (around 1%, small but significant). It looks like the branches we introduced were killing us and / or my assumption about the use of RenderDeprecatedFlexibleBox or RenderFlexibleBox were wrong. I will re-purpose the bug to center around the good part and put a new patch for review.
Julien Chaffraix
Comment 5 2012-02-27 13:17:50 PST
Re-purposing the bug on the part that is safe.
Julien Chaffraix
Comment 6 2012-02-27 13:22:53 PST
Created attachment 129089 [details] Smaller, better change. No change on html5-full-render.html this time.
Benjamin Poulain
Comment 7 2012-02-27 13:57:44 PST
Damn review thief! ;)
Antonio Gomes
Comment 8 2012-02-27 14:01:16 PST
(In reply to comment #7) > Damn review thief! ;) :'( ... <:o)
WebKit Review Bot
Comment 9 2012-02-27 15:09:51 PST
Comment on attachment 129089 [details] Smaller, better change. No change on html5-full-render.html this time. Clearing flags on attachment: 129089 Committed r109028: <http://trac.webkit.org/changeset/109028>
WebKit Review Bot
Comment 10 2012-02-27 15:09:56 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.