Skip to content

Shared prefixes: performance benchmarks ​

A cold-KV request here has no relevant cached input prefix, but the model and computation kernels are already warmed up. A warm request can reuse existing prefixes. These measurements compare all and staged submission in the local Python SGLangBackend.

The following local measurements use Qwen3-1.7B, BF16, an RTX 5090, SGLang 0.5.20 and Triton attention, with decode CUDA Graph and chunked prefill disabled. Tests used the current default prompt, serialized requests, five warm-up iterations and 30 measurements per configuration. Values are median end-to-end cold-KV latency, including rendering, tokenization and response assembly, excluding model loading and cache flushing.

WorkloadAll at onceStaged
Baseline: 3 questions, 9 candidates84.00 ms36.43 ms
Long context: 4 questions, 8 candidates611.77 ms125.15 ms
Mixed question types: 9 candidates93.09 ms40.88 ms
Short input: 1 question, 2 candidates11.49 ms19.11 ms

The long-context cold request was about 4.9 times faster, while the short request became slower. With fully warm cache, that same long-context workload took about 25.88 ms with all-at-once submission and 50.79 ms with staging. Choose based on your requests; these measurements do not predict every model, device or concurrent workload.

See Usage guide for configuration examples and mode selection.

Independent open source. Not affiliated with Jev or TypeSafe.