[PR #22099] [CLOSED] perf: remove unnecessary JSON.parse(JSON.stringify()) on string primitives #26482

Closed
opened 2026-04-20 06:31:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22099
Author: @Classic298
Created: 3/1/2026
Status: Closed

Base: devHead: perf/remove-string-cloning


📝 Commits (3)

  • 90c7f07 perf: remove unnecessary JSON.parse(JSON.stringify()) on string primitives
  • d667117 Merge branch 'dev' into perf/remove-string-cloning
  • a8fb934 Update Chat.svelte

📊 Changes

2 files changed (+5 additions, -5 deletions)

View changed files

📝 src/lib/components/chat/Chat.svelte (+4 -4)
📝 src/lib/components/notes/NoteEditor.svelte (+1 -1)

📄 Description

Strings are immutable primitives in JavaScript — cloning them via JSON.parse(JSON.stringify()) is pure overhead that returns an identical value. Removes 5 instances: 4 in Chat.svelte (chatId, message.id) and 1 in NoteEditor.svelte (note.title).

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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22099 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 3/1/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `perf/remove-string-cloning` --- ### 📝 Commits (3) - [`90c7f07`](https://github.com/open-webui/open-webui/commit/90c7f07cb3c8c80746b0efb05925ee6877f8f21f) perf: remove unnecessary JSON.parse(JSON.stringify()) on string primitives - [`d667117`](https://github.com/open-webui/open-webui/commit/d667117a440b12eb4a8343f60cd22ecee26d09fb) Merge branch 'dev' into perf/remove-string-cloning - [`a8fb934`](https://github.com/open-webui/open-webui/commit/a8fb934ddb67943511926b04dfb0967a6dcdcd12) Update Chat.svelte ### 📊 Changes **2 files changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/Chat.svelte` (+4 -4) 📝 `src/lib/components/notes/NoteEditor.svelte` (+1 -1) </details> ### 📄 Description Strings are immutable primitives in JavaScript — cloning them via JSON.parse(JSON.stringify()) is pure overhead that returns an identical value. Removes 5 instances: 4 in Chat.svelte (chatId, message.id) and 1 in NoteEditor.svelte (note.title). ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. --> By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 06:31:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#26482