Skip to content

⚡ Bolt: [performance improvement] Optimize createSortedSectionSelector memoization#50

Open
Smensink wants to merge 3 commits intomainfrom
bolt-optimize-sorted-section-selector-17030898074546182022
Open

⚡ Bolt: [performance improvement] Optimize createSortedSectionSelector memoization#50
Smensink wants to merge 3 commits intomainfrom
bolt-optimize-sorted-section-selector-17030898074546182022

Conversation

@Smensink
Copy link
Copy Markdown
Owner

@Smensink Smensink commented Feb 2, 2026

💡 What: Optimized the createSortedSectionSelector Redux selector.
🎯 Why: The previous implementation used (state) => state as an input selector, causing the expensive sort operation to run on every Redux action, even if the relevant data hadn't changed.
📊 Impact: Reduces CPU usage and improves UI responsiveness by ensuring that re-sorting only occurs when the specific section state changes. For lists with many items (e.g., settings, series), this avoids redundant O(N log N) operations.
🔬 Measurement: Verified with static analysis (ESLint) and architectural review of the reselect pattern. The change follows the established performance patterns of the codebase.


PR created automatically by Jules for task 17030898074546182022 started by @Smensink

google-labs-jules bot and others added 3 commits December 11, 2025 10:43
Wrapped the StarRating functional component in React.memo to prevent unnecessary re-renders.

This optimization is targeted at its usage within list components like BookRow, where parent state changes would previously cause every StarRating instance to re-render, even if its props were unchanged.

This improves UI performance by reducing the number of wasted render cycles.
…7328919

⚡ Bolt: Memoize StarRating component to prevent re-renders
Refactored the selector to use a specific state slice as an input selector instead of the entire state object. This prevents unnecessary re-sorting of items when unrelated parts of the state change, significantly improving performance during frequent state updates.

Co-authored-by: Smensink <41000986+Smensink@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant