perf(bench): make hot_path compile by default, representative and profile-able (LAB-7039) - #97
Conversation
…nd profile-able (LAB-7039) - required-features = ["encryption"]: a plain cargo bench skips hot_path instead of failing to compile. - [profile.bench] keeps symbols (release strips them, which also dropped the line tables), so callgrind/perf resolve function names. - Fixtures, including the 64 MiB incompressible setup, build lazily inside the routine closure, so a filtered run pays only for the ids it selects. - New byte_storage/roundtrip_msgpack and roundtrip_incompressible corpora beside the original ids; each prints its LZ4 ratio once. - bench_throughput no longer prints a hard-coded machine label.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: cachekit-io/cachekit-core/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. Summary by CodeRabbit
WalkthroughThe benchmark profile retains symbols and line tables, and the hot-path benchmark requires the encryption feature. Round-trip benchmarks now cover synthetic ramp, realistic MessagePack, and incompressible payloads. Large envelope fixtures and encryption plaintext are created lazily. ChangesBenchmark suite
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The changes broaden benchmark workloads and improve profiling and filtered execution without an established functional regression. No merge-blocking issue remains, subject to normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 2 files. (2 skipped: 2 unsupported.)
✨ 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 |
Makes the
hot_pathCriterion bench usable for instruction-count profiling and closer to real workloads.required-features = ["encryption"]on the bench target: a plaincargo benchnow skipshot_pathinstead of failing to compile.make benchis unchanged.[profile.bench]withstrip = falseand line tables. The release profile'sstrip = "symbols"also discarded the line tables, so profilers saw only addresses.byte_storage/roundtrip_msgpack/<size>(msgpack-encoded records) andbyte_storage/roundtrip_incompressible/<size>ids sit beside the originalbyte_storage/roundtrip/<size>ids, which keep their history. Each corpus prints its LZ4 compressed/raw ratio once (at 64 KB: ramp 0.008, msgpack 0.377, incompressible 1.004).examples/bench_throughput.rsprints the OS/arch instead of a hard-coded machine name.README's Performance section now says how to run the suite and what the corpora are.
Checks:
cargo bench --no-run(no features) exits 0; all 28 ids passcargo bench --features encryption --bench hot_path -- --test;cargo test --features encryption,cargo clippy --features encryption --all-targets -- -D warningsandcargo fmt --checkpass.Closes LAB-7039