[PATCH] D113813: [MachO] Reduce size of Symbol and Defined

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 12 15:54:45 PST 2021


smeenai created this revision.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We can lay out Symbol more optimally to reduce its size from 56 bytes to
48 bytes by eliminating unnecessary padding, and we can lay out Defined
such that its bitfield members are placed in the tail padding of Symbol
(on ABIs which support this), to reduce it from 96 bytes to 80 bytes (8
bytes from the Symbol reduction, and 8 bytes from the tail padding
reuse).

This is perf-neutral for an internal app (results from two different
machines):

             smol-syms       baseline        difference (95% CI)
  sys_time   7.430 ± 0.202   7.440 ± 0.193   [  -2.6% ..   +2.9%]
  user_time  21.443 ± 0.513  21.206 ± 0.396  [  -3.3% ..   +1.1%]
  wall_time  20.453 ± 0.534  20.222 ± 0.488  [  -3.7% ..   +1.5%]
  samples    9               8
  
             smol-syms       baseline        difference (95% CI)
  sys_time   3.011 ± 0.050   3.040 ± 0.052   [  -0.4% ..   +2.3%]
  user_time  10.416 ± 0.075  10.496 ± 0.091  [  +0.1% ..   +1.4%]
  wall_time  12.229 ± 0.144  12.354 ± 0.192  [  -0.1% ..   +2.1%]
  samples    14              13

However, on the first machine, it reduces maximum resident set size by
65.9 MB (0.8%, from 7.92 GB to 7.85 GB). On the second machine, it
reduces it by 92 MB (1.4%, from 6.40 GB to 6.31 GB).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113813

Files:
  lld/MachO/Symbols.cpp
  lld/MachO/Symbols.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113813.386971.patch
Type: text/x-patch
Size: 4035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211112/93895bde/attachment.bin>


More information about the llvm-commits mailing list