Skip to content

Use async task parallelization to accelerate handling new rooms from the room list service#696

Merged
kevinaboos merged 9 commits intomainfrom
bolt/optimize-room-list-loading-1182162883180883458
Feb 5, 2026
Merged

Use async task parallelization to accelerate handling new rooms from the room list service#696
kevinaboos merged 9 commits intomainfrom
bolt/optimize-room-list-loading-1182162883180883458

Conversation

@kevinaboos
Copy link
Member

@kevinaboos kevinaboos commented Feb 4, 2026

This takes fuller advantage of async task parallelism in the sliding sync
background in order to accelerate the somewhat expensive procedure
of caching the latest states from each room (into the RoomListServiceRoomInfo struct)
and calling the actual add_new_room() function.

This seems to have messed up the display order (since the rooms
may now be added in a different order) so we'll need to fix that as well.


PR created automatically by Jules for task 1182162883180883458 started by @kevinaboos

Parallelized room processing and batched subscriptions in room list service loop.
Reduced sequential async calls for `from_room` and consolidated `subscribe_to_rooms` calls.
Preserved existing behavior regarding room state subscriptions.

Co-authored-by: kevinaboos <[email protected]>
@google-labs-jules
Copy link
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.

google-labs-jules bot and others added 7 commits February 4, 2026 16:27
…ubscriptions

* Parallelize `from_room` conversion in `room_list_service_loop` using `join_all`.
* Batch `subscribe_to_rooms` calls for Joined and Invited rooms to reduce SDK overhead.
* Update `add_new_room` to support deferred subscription.
* Fix regression where Invited rooms were excluded from batched subscription.
* Ensure correct type coercion for `subscribe_to_rooms`.

Co-authored-by: kevinaboos <[email protected]>
* Parallelize `from_room` conversion in `room_list_service_loop` using `join_all`.
* Batch `subscribe_to_rooms` calls for all new rooms in `Append` and `Reset` events to reduce SDK overhead.
* Remove `subscribe` filtering/logic from `add_new_room`; caller is now responsible for subscription.
* Ensure `subscribe_to_rooms` is called before `add_new_room` in all single-room update cases.
* Use concurrent processing for large room list updates.

Co-authored-by: kevinaboos <[email protected]>
* Parallelize `from_room` conversion in `room_list_service_loop` using `join_all`.
* Parallelize `add_new_room` calls in `Append` and `Reset` events to concurrently fetch latest events and setup timelines.
* Batch `subscribe_to_rooms` calls for all new rooms in `Append` and `Reset` events to reduce SDK overhead.
* Remove `subscribe` filtering/logic from `add_new_room`; caller is now responsible for subscription.
* Ensure `subscribe_to_rooms` is called before `add_new_room` in all single-room update cases.

Co-authored-by: kevinaboos <[email protected]>
* Combine `from_room` conversion and `add_new_room` execution into a single concurrent task per room in `room_list_service_loop` using `join_all`.
* Batch `subscribe_to_rooms` calls for all new rooms in `Append` and `Reset` events to reduce SDK overhead.
* Remove `subscribe` filtering/logic from `add_new_room`; caller is now responsible for subscription.
* Ensure `subscribe_to_rooms` is called before `add_new_room` in all single-room update cases.
* Use concurrent processing for large room list updates, improving initial sync speed.

Co-authored-by: kevinaboos <[email protected]>
This takes fuller advantage of async task parallelism in the sliding sync
background in order to accelerate the somewhat expensive procedure
of caching the latest states from each room (into the `RoomListServiceRoomInfo` struct)
and calling the actual `add_new_room()` function.

This seems to have messed up the display order (since the rooms
may now be added in a different order) so we'll need to fix that as well.
* Verify and finalize the batched subscription and parallel initialization logic in `sliding_sync.rs`.
* Ensure `add_new_room` properly defers subscription to the caller.
* Record performance learnings in `bolt.md`.

Co-authored-by: kevinaboos <[email protected]>
* Combine `from_room` conversion and `add_new_room` execution into a single concurrent task per room in `room_list_service_loop` using `join_all`.
* Batch `subscribe_to_rooms` calls for all new rooms in `Append` and `Reset` events to reduce SDK overhead.
* Remove `subscribe` filtering/logic from `add_new_room`; caller is now responsible for subscription.
* Ensure `subscribe_to_rooms` is called before `add_new_room` in all single-room update cases.
* Use concurrent processing for large room list updates, improving initial sync speed.

Co-authored-by: kevinaboos <[email protected]>
@kevinaboos kevinaboos changed the title ⚡ Bolt: Optimize room list loading Use async task parallelization to accelerate handling new rooms from the room list service Feb 5, 2026
@kevinaboos
Copy link
Member Author

This seems to have messed up the display order (since the rooms may now be added in a different order) so we'll need to fix that as well.

We need to somewow share the order of the all_known_rooms list in the room_list_service_loop with the RoomsList widget in order to make sure that it shows the rooms in the proper sorting order.

We could optionally use OrderMap for all_joined_rooms and the invited rooms list, though it might be better to just store the preferred ordering elsewhere (in a separate field, like a Vec<OwnedRoomId>) and iterate over that in order when populating each displayed_* list of rooms.

@kevinaboos kevinaboos merged commit bf1ea76 into main Feb 5, 2026
11 checks passed
@kevinaboos kevinaboos deleted the bolt/optimize-room-list-loading-1182162883180883458 branch February 5, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant