• brucedawson's avatar
    Optimize GetPathForVectorIcon*, save ~290 KB on disk · 26816320
    brucedawson authored
    VC++ was initializing all of the static PathElement arrays in
    GetPathForVectorIcon and GetPathForVectorIconAt1xScale at runtime, which
    meant that these were the largest and sixth largest functions in
    chrome.dll, and similarly in chrome_child.dll. Tagging the arrays and
    types as constexpr shrinks these functions down to nothing, saves about
    ~50 KB of per-process private data, and actually helps them compile
    slightly faster.
    
    The approximate section size changes are:
           .text: -164224 bytes change
          .rdata:   51984 bytes change
           .data:  -54976 bytes change
          .reloc:  -23204 bytes change
    
    These gains apply both to chrome.dll and chrome_child.dll.
    
    BUG=679539
    
    Review-Url: https://codereview.chromium.org/2620653004
    Cr-Commit-Position: refs/heads/master@{#442751}
    26816320
vector_icons.cc.template 678 Bytes