mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 21:09:41 -05:00
[PR #21883] [CLOSED] perf: memoize sourceIds computation in ContentRenderer #49368
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/21883
Author: @Classic298
Created: 2/25/2026
Status: ❌ Closed
Base:
dev← Head:perf/memoize-sourceids📝 Commits (1)
63c512bperf: memoize sourceIds computation in ContentRenderer📊 Changes
1 file changed (+35 additions, -30 deletions)
View changed files
📝
src/lib/components/chat/Messages/ContentRenderer.svelte(+35 -30)📄 Description
The sourceIds array was computed inline in the template via a complex reduce/forEach/filter chain. This meant it re-ran on every component re-render, including every streaming content update, even though it only depends on sources and model which rarely change during streaming. Move the computation to a reactive variable so Svelte only recalculates it when its actual dependencies change.
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.