Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to enable LTO #419

Closed
wants to merge 1 commit into from
Closed

Option to enable LTO #419

wants to merge 1 commit into from

Conversation

myrrc
Copy link

@myrrc myrrc commented May 2, 2024

LTO allows to eliminate dead code sections.

Why this may be useful, clap example.
Release build:

~/src/dexed bloaty build/Source/Dexed_artefacts/CLAP/Dexed.clap 
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  34.1%  6.96Mi   0.0%       0    .strtab
  30.5%  6.22Mi  54.0%  6.22Mi    .text
   9.7%  1.97Mi   0.0%       0    .symtab
   9.4%  1.91Mi  16.6%  1.91Mi    .eh_frame
   8.4%  1.72Mi  14.9%  1.72Mi    .rodata
   3.1%   655Ki   5.6%   655Ki    .rela.dyn
   2.3%   476Ki   4.0%   476Ki    .eh_frame_hdr
   1.5%   319Ki   2.7%   319Ki    .data.rel.ro
   0.5%   109Ki   0.9%   109Ki    .gcc_except_table
   0.0%       0   0.5%  62.6Ki    .bss
   0.2%  33.8Ki   0.3%  33.8Ki    .dynstr
   0.1%  16.8Ki   0.1%  16.8Ki    .dynsym
   0.1%  13.7Ki   0.1%  13.7Ki    .rela.plt
   0.0%  9.12Ki   0.1%  9.12Ki    .plt
   0.0%  6.76Ki   0.1%  6.76Ki    .data
   0.0%  4.59Ki   0.0%  4.59Ki    .got.plt
   0.0%  2.96Ki   0.0%  2.69Ki    [14 Others]
   0.0%  2.72Ki   0.0%       0    [Unmapped]
   0.0%  1.88Ki   0.0%       0    [ELF Section Headers]
   0.0%  1.55Ki   0.0%  1.55Ki    .gnu.hash
   0.0%  1.41Ki   0.0%  1.41Ki    .gnu.version
 100.0%  20.4Mi 100.0%  11.5Mi    TOTAL

Release build with LTO:

~/src/dexed bloaty build/Source/Dexed_artefacts/CLAP/Dexed.clap 
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  47.0%  2.47Mi  56.6%  2.47Mi    .text
  19.9%  1.05Mi  24.0%  1.05Mi    .rodata
  12.5%   670Ki   0.0%       0    .strtab
   5.6%   299Ki   6.7%   299Ki    .eh_frame
   5.4%   292Ki   0.0%       0    .symtab
   5.1%   273Ki   6.1%   273Ki    .rela.dyn
   1.4%  77.9Ki   1.7%  77.9Ki    .data.rel.ro.local
   0.0%       0   1.3%  60.1Ki    .bss
   0.9%  49.5Ki   1.1%  49.5Ki    .eh_frame_hdr
   0.9%  47.5Ki   1.1%  47.5Ki    .gcc_except_table
   0.4%  21.1Ki   0.5%  21.1Ki    .data.rel.ro
   0.2%  9.97Ki   0.2%  9.97Ki    .dynstr
   0.2%  9.35Ki   0.2%  9.35Ki    .dynsym
   0.1%  7.15Ki   0.2%  7.15Ki    .rela.plt
   0.1%  4.78Ki   0.1%  4.78Ki    .plt
   0.1%  2.94Ki   0.1%  2.54Ki    [16 Others]
   0.1%  2.93Ki   0.1%  2.94Ki    .data
   0.0%  2.41Ki   0.1%  2.41Ki    .got.plt
   0.0%  2.06Ki   0.0%       0    [ELF Section Headers]
   0.0%  1.70Ki   0.0%       0    [Unmapped]
   0.0%     800   0.0%     800    .gnu.version
 100.0%  5.25Mi 100.0%  4.37Mi    TOTAL

@myrrc myrrc marked this pull request as draft May 3, 2024 11:01
@myrrc myrrc marked this pull request as ready for review May 4, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant