Qwen Code lazily loads three dependencies and cuts cold-start time by 144 ms
gitmeatarru · ghdev · 2026-07-24
Qwen Code’s core runtime now lazy-loads three heavy first-use dependencies: iconv-lite, @xterm/headless, and simple-git.
- The PR moves them out of the ACP child’s eager static import closure and loads them only when first needed.
- It preserves synchronous encoding helpers via a compatibility entry while switching internal paths to async lazy variants.
- Terminal construction is deferred until the PTY path is selected, and Git service setup remains side-effect-free until a Git operation is actually needed.
- On the prototype artifact, the static closure shrank by about 890 KiB, process-to-first-session P50 improved from 1877.7 ms to 1733.3 ms, channel.initialize P50 from 896.2 ms to 831.5 ms, and peak RSS P50 from 417.0 MB to 408.1 MB.
More from coding & agent
- Claude Code + Monid MCP builds a $12K/year B2B prospecting engine on live data — aryanXmahajan · 2026-10-26
- Karpathy shares CLAUDE.md rulebook to stop AI coding agents from piling up tech debt — mdancho84 · 2026-10-26
- Rethinking dependencies in the agent era: drop libs that save 20 lines of code — gethackteam · 2026-10-26
- RustGIS hits 2,000 GitHub stars in two weeks with agent-first architecture — giswqs · 2026-10-26
- Vercel Ships 12 New Products at Its 2026 Conference as It Races Rivals for the Agent Entry Point — FinanceYF5 · 2026-10-26
- Build an AI agent from scratch in under 50 lines of pure Python: ReAct loop tutorial — adnan_hashmi · 2026-10-26