Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room List - Store sorted rooms in skip list #29345

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

MidhunSureshR
Copy link
Member

@MidhunSureshR MidhunSureshR commented Feb 24, 2025

This PR uses a skip list to sort and store a given array of rooms. Insertion and deletion into the sorted list is very performant.

https://en.wikipedia.org/wiki/Skip_list

We don't want the store to be created if the labs flag is off
import { RecencySorter } from "./skip-list/sorters/RecencySorter";
import { AlphabeticSorter } from "./skip-list/sorters/AlphabeticSorter";

export class RoomListStoreV3Class extends AsyncStoreWithClient<EmptyObject> {
Copy link
Member Author

@MidhunSureshR MidhunSureshR Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this class so that we can create a minimal view model for the UI work. I will implement the onAction method for dealing with updates after I get filters and spaces working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the store to #29357

Probably best to include this PR with the minimal vm implmentation
@MidhunSureshR MidhunSureshR changed the title Implement a new minimal room list store Room List - Store sorted rooms in skip list Feb 25, 2025
@MidhunSureshR MidhunSureshR marked this pull request as ready for review February 25, 2025 08:23
@MidhunSureshR MidhunSureshR requested a review from a team as a code owner February 25, 2025 08:23
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain your rationale in choosing a probabilistic data structure vs something like a binary search tree

@MidhunSureshR
Copy link
Member Author

Please explain your rationale in choosing a probabilistic data structure vs something like a binary search tree

Skip lists as just as fast as trees but so much easier to implement and reason about. No rebalancing necessary etc..

@MidhunSureshR MidhunSureshR added this pull request to the merge queue Feb 25, 2025
Merged via the queue into develop with commit fe35354 Feb 25, 2025
43 checks passed
@MidhunSureshR MidhunSureshR deleted the midhun/rls/skip-list-1 branch February 25, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants