mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[PR #21885] [MERGED] perf: throttle message list rebuild to once per animation frame during streaming #113633
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21885
Author: @Classic298
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/28/2026
Merged by: @tjbck
Base:
dev← Head:perf/throttle-messages-rebuild📝 Commits (1)
acdb43aperf: throttle message list rebuild to once per animation frame during streaming📊 Changes
1 file changed (+31 additions, -2 deletions)
View changed files
📝
src/lib/components/chat/Messages.svelte(+31 -2)📄 Description
Messages.svelte rebuilds the message list by walking the parent chain and creating spread copies on every history.messages change. During streaming, this runs on every token — hundreds of times per second — even though each ResponseMessage already has its own reactive binding for content updates. Throttle the rebuild to once per animation frame (~60Hz) during content-only updates, while keeping immediate rebuilds for structural changes (currentId changes like chat switches, navigation, or new messages). Adds onDestroy cleanup for the pending rAF.
this is a completely invisible change - free lunch
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.