mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #23800] [MERGED] perf: use set for O(1) lookup in insert_chat_files dedupe #43007
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/23800
Author: @Classic298
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @tjbck
Base:
dev← Head:claude/optimize-file-dedup-2j97H📝 Commits (1)
d9fc50aperf: use set for O(1) lookup in insert_chat_files dedupe📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
backend/open_webui/models/chats.py(+3 -3)📄 Description
Convert chat_message_file_ids from list to set so the membership test in the comprehension is O(1) instead of O(m), turning the dedupe from O(n*m) into O(n+m). Also replace the redundant set([...]) with a set comprehension.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.