How to Move Independent Work Through an asyncio Pipeline
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
Uber Eats rebuilt its search pipeline after accumulated architectural decisions made latency increasingly costly across retrieval, hydration, ranking, ads, and presentation. The team changed its primary metric from backend API response time to Above-the-Fold completion, then introduced paginated responses with server-side caching and concurrent template rendering; these changes improved ATF by over 200 milliseconds. Other work removed low-yield retrieval strategies, grouped items by product identity to reduce lookups by over 100 times, split ranking and presentation hydration, eliminated false DAG dependencies, added request hedging, and redesigned ad data as column-oriented in memory. The combined effort cut search latency in half, including approximately 120 milliseconds from retrieval, 100-plus from hydration changes, and 130 from ads, while planned product-based search, zero-pass ranking, and streaming target further gains.
Uber Eats search latency had become untenable as its multi-stage pipeline performed extensive candidate retrieval, full hydration, ads scoring, and ranking. Monolithic phases, unnecessary data dependencies, broad-recall retrieval paths, and serialized presentation work compounded latency across the stack.
The work optimized the full search path by measuring Above-the-Fold completion, paginating and caching results, rendering templates concurrently, removing low-yield retrieval paths, grouping items by product identity, splitting ranking and presentation hydration, parallelizing independent stages, hedging slow requests, and redesigning ads data layout and storage.
Above-the-Fold completion replaced back-end API response time as the primary latency metric, capturing payload transfer, template rendering, and image loading through the first rendered screen.
Splitting hydration into ranking signals and presentation attributes allowed ranking to start earlier and reduced end-to-end latency by more than 100 milliseconds.
Column-oriented ad data, application-memory access, and removal of redundant serialization reduced ads-related latency by approximately 130 milliseconds.
Summaries are generated from the original by a language model. Check the original before relying on it.
See the idea
A practical asyncio workflow for moving independent work through typed events, queues, concurrent tasks, and awaited API calls. Learn where validation and fallback belong.
AssemblyScript is a TypeScript-like way to target WebAssembly. This explainer shows how source becomes a sandboxed module, crosses explicit host boundaries, and fits performance-sensitive services.
Apache Pinot is a distributed real-time OLAP datastore for low-latency analytics. This architecture view shows how streams, processing, partitioning, indexed storage, and replica-aware serving fit together.
Keep reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
One useful email. Unsubscribe anytime.