• brucedawson's avatar
    Shrink gn's chrome.dll - now smaller than gyp's · e792bd73
    brucedawson authored
    More work to shrink gn's chrome.dll
    
    The three largest globals that were present in gn's chrome.dll but not in gyp's chrome.dll were eliminated by using /verbose linker output to track the object files that pulled them in and then conditionally changing source_set targets to static_library targets. Specifically:
    
    unigram_table, in compact_enc_det.obj
    - Referenced by TextResourceDecoder.obj from //third_party/WebKit/Source/core:html - some other source_set targets in this file were also modified
    
    gpu::ApplyFramebufferAttachmentCMAAINTELResourceManager::cmaa_frag_s1_ and cmaa_frag_s2_, in gles2_cmd_apply_framebuffer_attachment_cmaa_intel.obj from //gpu/command_buffer/service:service_sources
    - Referenced by gpu_command_buffer_stub.obj from //gpu/ipc/service:ipc_service_sources
    - Referenced by gpu_video_decode_accelerator.obj from //media/gpu/ipc/service:service
    - Referenced by gpu_child_thread.obj from //content/gpu:gpu_sources
    - Referenced by gpu_video_decode_accelerator_factory.obj from //content/public/gpu:gpu_sources
    
    As of R406709 this shrinks gn's 32-bit official chrome.dll file size from 38,907,904 bytes to 37,571,584 bytes - an unexpected 1,336,320 byte savings, mostly from the .text section. There is also ~67,000 bytes of memory-only savings in the zero-init part of the .data section.
    
    At the same revision gyp's 32-bit official chrome.dll file size is 37,843,456 bytes - 271,872 bytes *larger* than the gn version.
    
    There are still globals that are present in gn's chrome.dll but not gyp's chrome.dll, so the optimization technique can still be applied some more, but the priority is much lower now that gn is winning.
    
    This is a follow-on to crrev.com/2163823002.
    
    BUG=624274
    CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
    
    Review-Url: https://codereview.chromium.org/2163933003
    Cr-Commit-Position: refs/heads/master@{#406912}
    e792bd73
BUILD.gn 2.46 KB