♻️ chore: Use make() to preallocate relevantExtractors in Session Middleware - #4562
♻️ chore: Use make() to preallocate relevantExtractors in Session Middleware#4562SivaPA08 wants to merge 1 commit into
Conversation
|
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
WalkthroughThe session middleware preallocates the filtered extractor slice using the extractor chain length, reducing potential reallocations during appends. ChangesSession extractor optimization
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4562 +/- ##
==========================================
- Coverage 93.29% 93.25% -0.05%
==========================================
Files 140 140
Lines 14854 14854
==========================================
- Hits 13858 13852 -6
- Misses 620 625 +5
- Partials 376 377 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Preallocate
relevantExtractorsusingmake()to reduce unnecessary slice reallocations.