This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
perf: resolve case users once per listing instead of once per case - #125
Merged
Merged
Conversation
CaseStore built each case with its own get_user / fetch_user calls, so a listing of N cases whose moderators weren't cached made N sequential API calls. _from_rows now collects the distinct user IDs, takes cached users, and fetches the rest concurrently (at most 5 at a time), once each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Before,
CaseStoreresolved users once per row. Acase listof N cases whose moderators weren't cached made N sequentialfetch_userAPI calls, and repeated ones for the same moderator.Now
_from_rowscollects the distinct user IDs in a result, takes the cached users fromget_user, and fetches the rest once each, concurrently, with at most 5 calls in flight.get,active,for_userandexpireall use it.Tests
fetch_useris called exactly once.ruff format --check,ruff check,ty checkandpytestall pass (367 passed).🤖 Generated with Claude Code