Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions poller/pollers/adsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ async def _hydrate_from_redis(self) -> None:
keys = []
cur = 0
while True:
cur, batch = await r.scan(cur, match="entity:*", count=200)
# ⚑ Bolt Optimization: Increase SCAN count to 5000 to drastically reduce round-trips
cur, batch = await r.scan(cur, match="entity:*", count=5000)
keys.extend(batch)
if not cur:
break

results = []
# ⚑ Bolt Optimization: Use MGET in chunks instead of individual GETs
for i in range(0, len(keys), 5000):
chunk = await r.mget(keys[i:i + 5000])
results.extend(chunk)

hydrated = 0
for key in keys:
raw = await r.get(key)
for raw in results:
if not raw:
continue
# ⚑ Bolt Optimization: Fast bytes matching to bypass JSON parsing for non-aircraft entities (~35x faster for skips)
Expand Down
Loading