perf(async): bound Future size without hot-path allocations - #488
Conversation
Move archive copy buffers behind one reusable allocation, remove production unused-async helpers, and record before/after future and allocation evidence for archive, upload, and WebDAV paths.\n\nRefs #486
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthrough本次变更优化归档复制 Future 的内存布局,新增分配测量与回归测试,并将五类无异步操作的辅助函数改为同步函数。中文开发记录新增 Issue ChangesFuture 体积与分配测量
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Box<[u8]>per copyCloses #486.
Design boundaries
Box::pin, dynamic future dispatch, or any new per-request allocationMeasurements
Baseline:
9b55dbfd18892e09227bfb0ff5de950586071dd5Future size
The temporary 8 KiB Clippy threshold was used only to measure the post-change archive callers; it is not committed as repository configuration.
Allocation count and requested bytes
Archive allocation regressions use a 128 KiB input, so the copy loops iterate across the 64 KiB buffer more than once while still recording exactly one buffer allocation.
Full methodology and warning classification are recorded in
developer-docs/zh-CN/records/issue-486-future-size-evidence.md.Clippy classification
For the main crate:
large_futures: 17 -> 9; all eight archive cascade warnings are goneunused_async: 8 -> 3; all five production findings are goneValidation
cargo fmt --all -- --checkgit diff --checkRUSTC_WRAPPER= cargo clippy -p aster_drive --lib --all-features --message-format=short -- -W clippy::unused_async -W clippy::large_futuresRUSTC_WRAPPER= cargo test --lib -- --test-threads=1— 1,559 passed, 1 ignoredRUSTC_WRAPPER= cargo test --lib services::files::archive::preview::tests -- --test-threads=1— 18 passedRUSTC_WRAPPER= cargo test --lib services::task::archive::extract::staging::tests -- --test-threads=1— 6 passedRUSTC_WRAPPER= cargo test --lib services::files::upload::lifecycle::tests -- --test-threads=1— 9 passedRUSTC_WRAPPER= cargo test --lib services::files::upload::provider_relay::tests -- --test-threads=1— 14 passedRUSTC_WRAPPER= cargo test --lib services::remote::master_binding::tests -- --test-threads=1— 6 passedRUSTC_WRAPPER= cargo test --test files test_chunked_upload_flow -- --test-threads=1— passedRUSTC_WRAPPER= cargo test --test webdav test_webdav_propfind_root -- --test-threads=1— 2 passedcd docs && bun run developer-docs:build— 414 pages built; all internal links validSummary by CodeRabbit
性能优化
稳定性
文档