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

Issue 613783002: Smaller vtbls in RenderObject (Closed)

Created:
6 years, 2 months ago by Daniel Bratell
Modified:
6 years, 2 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-rendering, chromiumbugtracker_adobe.com, krit, eae+blinkwatch, ed+blinkwatch_opera.com, eric.carlson_apple.com, feature-media-reviews_chromium.org, f(malita), fs, gyuyoung.kim_webkit.org, jchaffraix+rendering, jfernandez, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, philipj_slow, Manuel Rego, rwlbuis, rune+blink, Stephen Chennney, svillar, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Smaller vtbls in RenderObject. There are 101 different classes in the RenderObject class tree and they share 150-250 virtual functions each. That scales to 60-200 KB of vtbls (depending on architecture), which cost space in the binary and time during startup since they need to be copied to RAM and adjusted. In fact, some RenderObject vtbls are the largest vtbls in Chrome. There doesn't have to be anything wrong with any of this, but the use of 60+ virtual isXXX functions which were the same for 100 out of 101 classes could easily be replaced by a single virtual function, saving 20-50 KB of the space mentioned above (again depending on architecture). When the class is known, the isOfType functions will constant fold, just like the isFoo methods. clang x64 space info: Total change: -47075 bytes ========================== 78 added, totalling +4731 bytes across 70 sources 142 removed, totalling -4008 bytes across 70 sources 397 grown, for a net change of +5064 bytes (296097 bytes before, 301161 bytes after) across 128 sources 115 shrunk, for a net change of -52862 bytes (209130 bytes before, 156268 bytes after) across 5 sources gcc x64 space into: Total change: -49078 bytes ========================== 141 added, totalling +19000 bytes across 90 sources 200 removed, totalling -21292 bytes across 90 sources 371 grown, for a net change of +17491 bytes (387125 bytes before, 404616 bytes after) across 164 sources 261 shrunk, for a net change of -64277 bytes (387358 bytes before, 323081 bytes after) across 98 sources R=esprehn@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183832

Patch Set 1 : RenderObject: Cut down vtbls a bit #

Total comments: 2

Patch Set 2 : Rebased to newer master with lowercase overrides. #

Patch Set 3 : Rebase better. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -143 lines) Patch
M Source/core/rendering/RenderBR.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderButton.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderCounter.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderCounter.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderDetailsMarker.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderEmbeddedObject.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFieldset.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFileUploadControl.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFrame.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFrameSet.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFullScreen.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderFullScreen.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderGrid.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderHTMLCanvas.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderIFrame.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderImage.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/rendering/RenderListBox.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderListItem.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderListMarker.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderMedia.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/rendering/RenderMenuList.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderMeter.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderMultiColumnSet.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderObject.h View 1 3 chunks +136 lines, -62 lines 0 comments Download
M Source/core/rendering/RenderProgress.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderQuote.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderRegion.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderReplica.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderRuby.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderRubyBase.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderRubyRun.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderRubyText.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderScrollbarPart.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderSlider.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderSliderThumb.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderSliderThumb.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderTable.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableCaption.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableCell.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableCol.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableRow.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableSection.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTextControl.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/rendering/RenderTextControlMultiLine.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTextControlSingleLine.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderVideo.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderView.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGBlock.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGContainer.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGForeignObject.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGGradientStop.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGHiddenContainer.h View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGImage.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGInline.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGInlineText.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGModelObject.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceContainer.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilter.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGRoot.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGShape.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGText.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGTextPath.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGTransformableContainer.h View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGViewportContainer.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (4 generated)
Daniel Bratell
https://codereview.chromium.org/613783002/diff/40001/Source/core/rendering/RenderObject.h File Source/core/rendering/RenderObject.h (right): https://codereview.chromium.org/613783002/diff/40001/Source/core/rendering/RenderObject.h#newcode1132 Source/core/rendering/RenderObject.h:1132: RenderObjectSVG, /* Keep by itself? */ Comment need to ...
6 years, 2 months ago (2014-10-01 07:49:47 UTC) #3
esprehn
There's no reason to delete old patchsets unless you have a password or something bad ...
6 years, 2 months ago (2014-10-01 08:05:48 UTC) #5
Daniel Bratell
On 2014/10/01 08:05:48, esprehn wrote: > There's no reason to delete old patchsets unless you ...
6 years, 2 months ago (2014-10-01 09:28:41 UTC) #6
esprehn
Why didn't you do the same thing for isRenderBoxModelObject though?
6 years, 2 months ago (2014-10-01 10:30:04 UTC) #7
Daniel Bratell
Executive summary: Performance results show no change. Performance results (ran base and with change 3 ...
6 years, 2 months ago (2014-10-01 13:03:07 UTC) #8
Daniel Bratell
On 2014/10/01 10:30:04, esprehn wrote: > Why didn't you do the same thing for isRenderBoxModelObject ...
6 years, 2 months ago (2014-10-01 13:12:40 UTC) #9
Daniel Bratell
https://codereview.chromium.org/613783002/diff/40001/Source/core/rendering/RenderObject.h File Source/core/rendering/RenderObject.h (right): https://codereview.chromium.org/613783002/diff/40001/Source/core/rendering/RenderObject.h#newcode349 Source/core/rendering/RenderObject.h:349: virtual bool isBoxModelObject() const { return false; } Move ...
6 years, 2 months ago (2014-10-01 13:12:48 UTC) #10
Daniel Bratell
esprehn, I think I responded to your questions above. What do you think?
6 years, 2 months ago (2014-10-07 15:24:44 UTC) #11
Daniel Bratell
esprehn, can you please take a look? I've just rebased it to a world where ...
6 years, 2 months ago (2014-10-16 16:22:32 UTC) #12
esprehn
This does mean there's a comparison inside these isFoo() functions now instead of just a ...
6 years, 2 months ago (2014-10-16 16:28:21 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/613783002/80001
6 years, 2 months ago (2014-10-16 17:36:11 UTC) #15
Daniel Bratell
On 2014/10/16 16:28:21, esprehn wrote: > This does mean there's a comparison inside these isFoo() ...
6 years, 2 months ago (2014-10-16 17:36:47 UTC) #16
commit-bot: I haz the power
6 years, 2 months ago (2014-10-16 17:47:39 UTC) #17
Message was sent while issue was closed.
Committed patchset #3 (id:80001) as 183832

Powered by Google App Engine
This is Rietveld 408576698