Skip to content

perf(codegen): share recursive struct Drop helpers - #891

Merged
sanohiro merged 4 commits into
mainfrom
agent/request19-drop-codegen
Aug 26, 2026
Merged

perf(codegen): share recursive struct Drop helpers#891
sanohiro merged 4 commits into
mainfrom
agent/request19-drop-codegen

Conversation

@sanohiro

Copy link
Copy Markdown
Owner

Summary

  • emit one module-private iterative destructor per Move struct reached as a Drop-site root
  • reuse that helper across direct, replacement, fixed-array, dynamic-array, and cross-function cleanup sites without introducing recursive helper calls
  • add malformed-input, sibling aggregate-array, and 4,096-level stack-bound owners plus a local baseline/candidate benchmark

Request 19 evidence

  • raw LLVM IR: 1,517,324 lines / 113.6 MB -> 109,992 lines / 5.96 MB
  • cold three-unit release build: 471.074 s and >832,704 KiB observed RSS -> 13.555 s and 266,400 KiB peak RSS
  • final release candidate: 13.27 s, 264,560 KiB, exact prompt-verifier PASS output
  • small control: unchanged 1,240-byte object and 1 allocation / 1 free; cleanup execution 0.001 s before and after

Verification

  • cargo build --release --workspace
  • scripts/cargo.sh test -p align_codegen_llvm --lib
  • scripts/cargo.sh test -p align_driver --test large_drop_codegen
  • Request 19 fixture built and executed with the final release compiler
  • code-tier scripts/pre-pr.sh (focused owner, bounded gate, Clippy)

@sanohiro
sanohiro marked this pull request as ready for review August 26, 2026 02:33
@sanohiro
sanohiro merged commit 4b515f8 into main Aug 26, 2026
9 checks passed
@sanohiro
sanohiro deleted the agent/request19-drop-codegen branch August 26, 2026 02:33
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