Bug 28812 - ld: Make --compress-debug-sections=zlib parallel
Summary: ld: Make --compress-debug-sections=zlib parallel
Status: RESOLVED NOTABUG
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-24 01:07 UTC by Fangrui Song
Modified: 2023-05-25 09:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2022-01-24 01:07:30 UTC
For a -DCMAKE_BUILD_TYPE=Debug build of clang with 265MiB SHF_ALLOC sections and 920MiB uncompressed debug sections. 
```
% =time -f "CPU: %Us\tReal: %es\tRAM: %MKB" ld.bfd @response.txt -o bfd                               
CPU: 69.17s     Real: 78.50s    RAM: 6689800KB
% =time -f "CPU: %Us\tReal: %es\tRAM: %MKB" ld.bfd @response.txt -o bfd --compress-debug-sections=zlib
CPU: 96.18s     Real: 104.31s   RAM: 7469100KB
```

With a parallel implementation, the compile time can be decreased to below 3 seconds with parallel divide-and-conquer with 8 threads.
I will add a parallel implementation to ld.lld (https://maskray.me/blog/2022-01-23-compressed-debug-sections).
Comment 1 Alan Modra 2023-05-25 09:42:04 UTC
Not a bug, an advert for lld.