feat(): LibraryViewModel performance improvements#1693
Open
phobos665 wants to merge 3 commits into
Open
Conversation
…wercased on creation rather than doing multiple operations. (Go from O(n log n) to O(n). Much nicer.
Contributor
📝 WalkthroughWalkthrough
ChangesLibrary filtering pipeline
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant FilterRequest
participant LibraryViewModel
participant PaginationState
FilterRequest->>LibraryViewModel: start filtering
LibraryViewModel->>LibraryViewModel: cancel prior filter and page jobs
LibraryViewModel->>PaginationState: cache full filtered list
FilterRequest->>LibraryViewModel: change page
LibraryViewModel->>PaginationState: slice cached list and apply pagination
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…currently runnin jobs to avoid excessive retirevals.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Overall, the UI should be vastly more responsive on initial and further retrievals for games going forward. This also means Carousel should be much more usable.
Recording
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Speeds up
LibraryViewModelfiltering, sorting, and pagination to reduce CPU work and UI redraws. The library and carousel feel more responsive on first load and when paging; pagination now cancels stale work.applyPagination, avoiding re-filter/re-sort on page changes.pageJobandfilterJobto cancel stale work; guard commits withensureActive()to prevent outdated UI updates.sortNameper entry for cheaper sorting.ConcurrentHashMap.SteamService.getAllInstalledApps().Written for commit 0761185. Summary will update on new commits.
Summary by CodeRabbit