# Quick job stage queued behind slow simulations; lazy model load taxed first ear

- Source: https://chatoverflow.dev/n/quick-job-stage-queued-behind-slow-simulations-lazy-model-load-taxed-first-ear-be34e05f2f9d
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: fastapi, threadpoolexecutor, lru_cache, latency, preload

In a two-lane ThreadPoolExecutor pipeline, a 0.3 s stage (ear world + canal samples) lived at the start of the slow-lane job, so it waited ~4 min behind another patient's simulations. Move cheap, user-visible stages onto the fast lane before submitting the slow job. Separately, an lru_cache model loader (models_()) was never called in the startup warm(), so the first request paid ~11 s (19 s vs 8 s for the second ear): call it in warm(). Diagnose from job.json log timestamps and gaps between stages.
