Skip to content

perf(elf): parallelize full-LTO section population - #80

Merged
zackees merged 11 commits into
mainfrom
perf/issue-79-splice-buffered-output
Aug 26, 2026
Merged

zackees merged 11 commits into
mainfrom
perf/issue-79-splice-buffered-output

Conversation

@zackees

@zackees zackees commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #81.

This supersedes the rejected splice experiment tracked by #79.

What changed

  • split monolithic ELF object writing into serial range allocation, parallel raw section population, and ordered relocation/table emission;
  • shard large, sorted RELA debug-relocation streams across provably disjoint output byte ranges;
  • preserve paired-relocation semantics by carrying the preceding relocation into each shard, with serial fallback for small, CREL, unsorted, out-of-bounds, or unshardable inputs;
  • parallelize large fast build-ID hashing with fixed ordered chunks;
  • flush large Linux ext4 anonymous buffers with bounded positional writes;
  • retain coarse phase timing for monolithic object allocation, population, relocation, and symbol emission;
  • upgrade the setup-soldr runtime pin from 0.8.43 to 0.9.10, fixing the catalogue setup failure;
  • scope benchmark iteration by perf/linux/**, perf/windows/**, perf/macos/**, or perf/all/**, with manual dispatch defaulting to Linux and schedules retaining all platforms.

Why

The retained Rust full-LTO input has 71,604 sections and 3.15 million debug relocations. About 2.47 million are concentrated in one sorted .rela.debug_info stream, so section-level parallelism could not use all four runner cores. Exact hosted instrumentation measured 147.0 ms in monolithic relocation versus only 22.1 ms in population, identifying intra-section relocation sharding as the highest-value remaining optimization.

Platform-scoped benchmark branches prevent Linux performance iteration from allocating unrelated macOS and Windows runners. The final cross-platform evidence remains explicit rather than being paid on every candidate.

Hosted benchmark evidence

Final all-platform source run: https://github.com/zackees/reld/actions/runs/32916339512

At source commit 0fc685cc on x86_64 Linux:

  • full-LTO reld: 241.9 ms
  • full-LTO mold: 249.7 ms
  • reld lead: 7.8 ms (3.1%)
  • monolithic relocation: 147.0 -> 66.5 ms
  • Write data to file: 165.5 -> 97.3 ms
  • default mode versus exact issue baseline: 26.8% faster

That run passed Linux, Windows, and macOS executable verification, coverage, concrete-engine metadata, startup significance, exact-SHA, and graph-rendering gates.

Exact current-HEAD Linux-only run: https://github.com/zackees/reld/actions/runs/32918511923

At commit 1b9c875e:

  • full-LTO reld: 232.4 ms
  • full-LTO mold: 237.1 ms
  • reld lead: 4.7 ms (2.0%)
  • matrix expansion: Linux only; Windows, macOS, aggregation, and freshness skipped
  • runner usage: 13.0 minutes, versus about 54.6 combined runner-minutes in the final all-platform run

Validation

  • 163 reld-core Linux tests passed (two unrelated formatter-tool tidy tests explicitly skipped in Bosn);
  • strict Linux Clippy passed;
  • Windows focused tests and reld-core check passed;
  • Linux fast/ThinLTO/full-LTO linker-mode smoke suite passed and executed every output;
  • hosted format/Clippy/licenses, Python, all linker modes, all host builds/smokes, Phase 1 targets, and cross-release gates passed at current HEAD;
  • benchmark workflow RED-to-GREEN regression test, Ruff, YAML parse, and diff checks passed;
  • setup-soldr 0.9.10 passed Linux, Windows, and macOS builds after 0.8.43 failed during catalogue setup.

Rejected alternatives

Exact hosted runs rejected splice, finish-time mmap copy, and whole-debug-section parallelism. The PR retains only the measured winning paths.

@zackees zackees changed the title perf(fs): splice large buffered Linux outputs perf(elf): parallelize full-LTO section population Aug 25, 2026
@zackees
zackees marked this pull request as ready for review August 26, 2026 01:33
@zackees
zackees merged commit 945a0b4 into main Aug 26, 2026
19 checks passed
@zackees
zackees deleted the perf/issue-79-splice-buffered-output branch August 26, 2026 01:38
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.

perf(elf): parallelize section population for monolithic full-LTO objects

1 participant