[PATCH] D59797: [COFF] Reorder fields in Chunk and SectionChunk to reduce their size

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 13:58:31 PDT 2019


aganea added a comment.

> @rnk wrote:
>  This reduces the total size of all LLD heap allocations by 5.22%

What is the total heap size before/after? What percentage of that heap size is used by Chunks? How many of them do you have?



================
Comment at: lld/COFF/Chunks.cpp:79
+  uintptr_t SectionName[2];
+  uintptr_t AssocChildren[3];
+  uint32_t Class[2];
----------------
Is `std::vector<SectionChunk *>`'s implementation guaranteed to be 3 pointers? Wouldn't something like `AlignedCharArrayUnion<std::vector<SectionChunk *>>` be better? Just wondering.


================
Comment at: lld/COFF/Chunks.h:127
   // The output section for this chunk.
   OutputSection *Out = nullptr;
 
----------------
64-bit for a value that's probably <10 most of the time, seems like an awful waste of space ;-)

If this takes so much memory, it'd be interesting to investigate (in terms of performance and dynamic value range) if some of the pointer members below could be converted to offset / bitfields.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59797/new/

https://reviews.llvm.org/D59797





More information about the llvm-commits mailing list