mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #20908] [CLOSED] fix: improve performance and fix memory leaks #48871
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/20908
Author: @sjhddh
Created: 1/23/2026
Status: ❌ Closed
Base:
main← Head:fix/performance-and-memory-leaks📝 Commits (1)
b5261d8fix: improve performance and fix memory leaks📊 Changes
9 files changed (+50 additions, -30 deletions)
View changed files
📝
backend/open_webui/routers/images.py(+2 -1)📝
backend/open_webui/routers/pipelines.py(+25 -14)📝
src/lib/components/workspace/Prompts.svelte(+1 -1)📝
src/lib/components/workspace/Tools.svelte(+1 -1)📝
src/lib/components/workspace/common/AccessControl.svelte(+2 -2)📝
src/lib/components/workspace/common/MemberSelector.svelte(+2 -2)📝
src/lib/components/workspace/common/TagSelector.svelte(+1 -1)📝
src/lib/components/workspace/common/ViewSelector.svelte(+1 -1)📝
src/routes/+layout.svelte(+15 -7)📄 Description
Summary
This PR improves application performance and stability through targeted optimizations in both frontend and backend:
Frontend
+layout.svelte: TheonMounthook was adding event listeners formessage,touchstart,touchmove,touchend, andvisibilitychangebut only cleaning upresize. This causes memory leaks during navigation and hot-reloads. Now all listeners are properly cleaned up.{#each}blocks: Added unique keys to 6 components (ViewSelector,TagSelector,MemberSelector,AccessControl,Tools,Prompts) to enable efficient DOM diffing instead of full re-renders.Backend
[await load_url_image(img) for img in ...]toasyncio.gather()inimage_editsendpoint, significantly reducing latency for multi-image edits.requestscalls inpipelines.pywithasyncio.to_thread()to prevent blocking the FastAPI event loop during external API calls.Test plan
{#each}changesContributor License Agreement
I have read and agree to the Contributor License Agreement.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.