⚡ Bolt: Optimize get_all_entities Redis fetch path#103
Conversation
Replaced pipelined GETs with chunked MGETs and increased SCAN count to drastically reduce Redis round-trips and overhead. Co-authored-by: d3mocide <136547209+d3mocide@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:
SCANcount from 100 to 5000 inbackend/redis_bus.py.GETcommands with chunkedMGETcommands (in batches of 5000).🎯 Why:
/api/v1/entities) was slow for large collections because it required 100-count scans and a pipeline of thousands of individualGETrequests, parsing each command on the Redis server individually.MGETwith larger batches reduces overhead and command parsing significantly.📊 Impact:
🔬 Measurement:
await get_all_entities()or the/api/v1/entitiesendpoint when thousands of entities are stored in Redis.PR created automatically by Jules for task 15279417063963769355 started by @d3mocide