perf(history): avoid temporary arrays in memory history - #8352
perf(history): avoid temporary arrays in memory history#8352LadyBluenotes wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughMemory history now replaces forward entries without temporary arrays. A regression test verifies branch truncation, state retention, and navigation. A patch changeset records the update. ChangesMemory history updates
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The optimized memory-history branch replacement preserves the tested navigation and state behavior, with no current merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
|
View your CI Pipeline Execution ↗ for commit ea0bcb8
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 23 bumped as dependents. 🟩 Patch bumps
|
Bundle Size BenchmarksThis pull request does not affect bundle size in any measured scenario. |
🎯 Changes
Write the next memory-history URL and state directly at the destination index, then truncate any remaining forward entries. This avoids the two unused arrays returned by
splicewhen a push creates a new branch. Backward/forward navigation and retained state stay unchanged.Performance
Local Node.js 24.12.0 comparison of
6494e75362andea0bcb8690. Allocation rows are medians of three heap-sampling profiles with a 4,096-byte sampling interval; history setup is outside the measurement window.These allocation estimates include objects collected by GC; they are not retained-heap measurements. The standalone bundle uses Vite 8.0.14, minified ESM,
es2022, and gzip level 9. Browser-history-only output is byte-identical.Longer ordinary-push measurements were effectively unchanged: median elapsed time was 80.392 ms before and 80.315 ms after; CPU time was 100.221 ms before and 100.421 ms after, across nine counterbalanced samples of 150,000 pushes. This PR claims allocation savings, not a stable navigation-speed improvement.
✅ Checklist
🚀 Release Impact
Summary by CodeRabbit