Why 2x Faster Decoding Only Saved 16% on 512K Local Coding Agents
Single-prompt tok/s benchmarks make local coding-agent performance look deceptively simple. Turn on Native Multi-Token Prediction (MTP) on a Mac Studio M5 Ultra 512 GB and warm decode roughly doubles even at 512K context: DeepSeek V4.1 Flash jumps from 45.2 to 98.9 tok/s on oMLX 0.8.4, and GLM 5.3 Flash jumps from 23.0 to 47.1 tok/s on llama.cpp b12774.
Yet when I ran real multi-turn terminal coding agents (Pi 1.6.1, OpenCode 2.0.25, and DeepSeek Harness 0.2.2-rc.5) on eight multi-file Python and TypeScript tasks inside a network-isolated Linux sandbox, doubling decode speed cut matched total session wall time by only 16.0% on DeepSeek (7.7% at 512K) and 7.4% on GLM (2.4% at 512K).
1. Past 128K Context, Cold Prefill and Cache Reuse Dominate
Real coding agents read repositories, run tests, inspect tracebacks, and edit multiple files over 8 to 16 turns. Every turn re-sends the growing conversation history. To measure the ceiling honestly, I ran 15 controlled six-turn ladders and 64 graded Pi coding sessions starting at exact native prompt sizes of 393,216 (384K) and 524,288 (512K) tokens with zero cached tokens at start.
| Model in Pi | 384K solves / med | 512K solves / med | 512K cold TTFT | 512K cached TTFT | 512K warm tok/s |
|---|---|---|---|---|---|
DeepSeek V4.1 Flash (oMLX 0.8.4 + MTP) |
8/8 · 6m 33s | 8/8 · 8m 30s | 5m 56s | 7.5s | 98.9 |
GLM 5.3 Flash (llama.cpp b12774 + MTP) |
7/8 · 16m 54s | 6/8 · 21m 51s | 19m 52s | 9.6s | 47.1 |
Muse Spark Open 816B (oMLX 0.8.4) |
6/8 · 28m 14s | 7/8 · 39m 15s | 21m 27s | 21.0s | 12.3 |
Once the prefix cache warmed (>99% token reuse on follow-ups), a 512K follow-up dropped from 5m 56s to 7.5s on DeepSeek and from 19m 52s to 9.6s on GLM. Across all 64 Pi sessions, prompts grew as high as 582,983 tokens with zero automatic compactions and 100% Normal macOS memory pressure (9,002 samples, zero swap growth; median session-average package power 136 W DeepSeek, 113 W GLM, 156 W Muse).
2. The 1-Line OpenCode Setting That Saved 2 to 4 Minutes Per Task
Comparing three coding-agent harnesses on the exact same DeepSeek V4.1 Flash setup (~100K-165K starting prompts) turned up an immediate, fixable local-LLM trap. By default, OpenCode 2.0.25 fires a background session-title request carrying the entire initial 100.5K-155.5K prompt just to generate at most 15 tokens of title text.
That single duplicate prefill added 280.4s of summed API prefill across 4 DeepSeek tasks and 995.7s across 4 GLM tasks. Turning background titles off in opencode.json fixed it immediately:
{
"agents": {
"title": {
"disabled": true
}
}
}
3. Three Real Operational Limits I Hit Along the Way
- Manual compaction is expensive when it fires: Triggering Pi compaction on GLM at
301,640estimated tokens took 10m 6s (606.3s) for the summary call, followed by an uncached39,067-token continuation that took another 81s to first token before recovering prefix caching and passing all checks. - SSD prefix-cache sizing breaks silently if too small: On Muse Spark 816B, each serialized 2,048-token boundary page on disk carried
~496 MiBof rotating-window state. A64 GiBSSD cache budget evicted the shared prefix chain around ~270K tokens and forced full473-504scold re-prefills. Raising the SSD cache to128 GiB(256K) and192 GiB(384K-512K) restored98.4-99.3%hit rates cleanly. - Parallel agents and reasoning effort: On original contexts (aggressive memory guard), DeepSeek + Pi solved
8/8across three seeds (42/43/44) and across Low (2.1m), High (3.4m), and Max (4.6m) effort. Two staggered agents solved2/2cleanly in5m 9s(vs5m 31ssequential), while 3- and 4-agent groups each missed one task (2/3,3/4).
• Full Episode 003 dataset, Waypoint MIT fixture, held-out grading suite & 38 evidence files: github.com/l8w8/videos/tree/main/2026/003-m5-ultra-coding-agents-512k
• 9-minute visual walkthrough on YouTube: youtu.be/Mr9sj51ccoE
• Earlier episodes: Part 1 (22 Setups) · Part 2 (+63% Native MTP)