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