OSDN Git Service

[COFF] Reduce the size of Chunk and SectionChunk, NFC
authorReid Kleckner <rnk@google.com>
Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)
commit3ce39390c1cd2c9529771574f38ea517f135fc07
tree39c9d4038b5d2a53d7962d0356e589215aae7599
parent4babc48b059062f4ae8082f2d7a5f58d66505551
[COFF] Reduce the size of Chunk and SectionChunk, NFC

Summary:
Reorder the fields in both to use padding more efficiently, and add more
comments on the purpose of the fields.

Replace `std::vector<SectionChunk*> AssociativeChildren` with a
singly-linked list. This avoids the separate vector allocation to list
associative children, and shrinks the 3 pointers used for the typically
empty vector down to 1.

In the end, this reduces the sum of heap allocations used to link
browser_tests.exe with NO PDB by 13.10%, going from 2,248,728 KB to
1,954,071 KB of heap. These numbers exclude memory mapped files, which
are of course a significant factor in LLD's memory usage.

Reviewers: ruiu, mstorsjo, aganea

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59797

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357535 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/BinaryFormat/COFF.h