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

Issue 396473004: Make ObserverList non-inline to save save 90 KB with gcc (Closed)

Created:
6 years, 5 months ago by Daniel Bratell
Modified:
6 years, 5 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Make ObserverList non-inline to save 90KB with gcc With gcc, ObserverList expands to 6-700 bytes every time it is iterated. By not trying to force OberservListBase to be inline that shrinks some. clang already ignores the hints to inline the code and actually doesn't change a single bit in the generated program with this change. raw data: Total change: -90875 bytes ========================== 262 added, totalling +39188 bytes across 2 sources 49 removed, totalling -27573 bytes across 16 sources 23 grown, for a net change of +3600 bytes (34968 bytes before, 38568 bytes after) across 8 sources 228 shrunk, for a net change of -106090 bytes (239819 bytes before, 133729 bytes after) across 53 sources The additions is about 2-300 different flavours of ObserverListBase, 100-300 bytes each. The savings are 200-600 bytes each every time an observer list is used. For example: -870: content::RenderFrameImpl::didFailLoad(blink::WebLocalFrame*, blink::WebURLError const&) type=t, (was 1635 bytes, now 765 bytes) -895: content::RenderFrameImpl::didFinishLoad(blink::WebLocalFrame*) type=t, (was 1646 bytes, now 751 bytes) -583: content::WebContentsImpl::DidFailProvisionalLoadWithError(content::RenderFrameHostImpl*, FrameHostMsg_DidFailProvisionalLoadWithError_Params const&) type=t, (was 768 bytes, now 185 bytes) -611: content::WebContentsImpl::DidStartProvisionalLoad(content::RenderFrameHostImpl*, GURL const&, bool, bool) type=t, (was 895 bytes, now 284 bytes) BUG=394311 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283762

Patch Set 1 #

Total comments: 4

Patch Set 2 : Indentation fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -65 lines) Patch
M base/observer_list.h View 1 3 chunks +88 lines, -65 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Daniel Bratell
jar, can you please take a look at this patch? I've not changed any code, ...
6 years, 5 months ago (2014-07-16 12:41:34 UTC) #1
jar (doing other things)
I'm not currently a base reviewer... to passing along to Brett, or Will (who might ...
6 years, 5 months ago (2014-07-16 23:00:46 UTC) #2
willchan no longer on Chromium
LGTM, although I caught some indentation issues when you moved the code. Thanks so much ...
6 years, 5 months ago (2014-07-16 23:19:18 UTC) #3
Daniel Bratell
https://codereview.chromium.org/396473004/diff/1/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/396473004/diff/1/base/observer_list.h#newcode132 base/observer_list.h:132: std::numeric_limits<size_t>::max() : On 2014/07/16 23:19:18, willchan wrote: > indentation ...
6 years, 5 months ago (2014-07-17 09:40:24 UTC) #4
Daniel Bratell
The CQ bit was checked by bratell@opera.com
6 years, 5 months ago (2014-07-17 09:40:29 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bratell@opera.com/396473004/20001
6 years, 5 months ago (2014-07-17 09:42:02 UTC) #6
commit-bot: I haz the power
6 years, 5 months ago (2014-07-17 12:39:39 UTC) #7
Message was sent while issue was closed.
Change committed as 283762

Powered by Google App Engine
This is Rietveld 408576698