⚡ Bolt: [performance improvement] Optimize space sync N+1 requests#884
⚡ Bolt: [performance improvement] Optimize space sync N+1 requests#884kevinaboos wants to merge 1 commit into
Conversation
Extract avatar fetching into `get_joined_space_info` and use `futures_util::future::join_all` to concurrently fetch space avatars during initial sync, append, and reset. This resolves an N+1 fetching bottleneck while preserving correct UI rendering order. Co-authored-by: kevinaboos <1139460+kevinaboos@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Extracted avatar fetching logic in
space_service_sync.rsintoget_joined_space_infoand appliedfutures_util::future::join_allto execute asynchronous requests concurrently.🎯 Why: Awaiting each avatar fetch inside a sequential
forloop caused an N+1 query performance bottleneck during space list synchronization (initial sync, append, and reset), unnecessarily blocking list updates.📊 Impact: Reduces total loading time for space syncing by executing all space data requests concurrently. Resolves the N+1 problem.
🔬 Measurement: Verify by joining multiple spaces or starting the app with multiple top-level spaces. The loading time should improve and logging should show concurrent requests. Also added a
.jules/bolt.mdentry.PR created automatically by Jules for task 6934061112531014119 started by @kevinaboos