Files
open-webui/backend/open_webui
Classic298andClaude 62491debfa perf: linear content accumulation in the streaming response handler (#27231)
The streaming handler rebuilt the full accumulated response with
`content = f'{content}{value}'` on every content delta — a complete
string copy per chunk, making accumulation O(n^2) over the response
length. Use in-place `content += value` for the (universal) str case,
which CPython extends in place, keeping accumulation O(n); the
f-string fallback is preserved for non-str values so coercion
behavior is unchanged.

In the ENABLE_REALTIME_CHAT_SAVE branch, full_output() — which
concatenates the entire accumulated output — was called twice per
chunk (once for the DB upsert, once for the emitted delta). Compute
it once and reuse.


Claude-Session: https://claude.ai/code/session_01MHg5zs1VBjvRWQ54qHpfYD

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-23 12:24:29 -04:00
..
…
2026-06-29 12:40:20 -05:00
2026-07-23 03:01:01 -04:00
2026-07-23 04:16:14 -04:00
2026-07-20 22:11:42 -04:00
2026-07-20 22:27:13 -04:00
2026-07-23 03:39:30 -04:00
2026-06-17 03:01:11 +02:00
2026-07-14 17:34:00 -04:00
2026-06-29 05:46:51 -05:00
2026-07-09 17:28:05 -05:00
2026-07-23 03:39:56 -04:00
2026-07-23 04:16:14 -04:00
2026-07-16 21:57:43 -04:00