[PR #24952] [CLOSED] perf: reduce heavy chat rendering work #131609

Closed
opened 2026-05-21 17:18:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24952
Author: @noufalkv
Created: 5/20/2026
Status: Closed

Base: devHead: perf/tor-chat-rendering


📝 Commits (3)

  • 1d2ccce perf(renderer): reduce markdown and tool-call mount cost
  • 40346ff test(renderer): add pathological chat stress fixtures
  • d1f1c51 perf(chat): reduce high-latency load stalls

📊 Changes

8 files changed (+555 additions, -119 deletions)

View changed files

📝 package.json (+1 -1)
scripts/renderer-stress-cases.mjs (+237 -0)
scripts/renderer-stress-cases.test.mjs (+36 -0)
📝 src/lib/components/chat/Chat.svelte (+41 -21)
📝 src/lib/components/chat/Messages/CodeBlock.svelte (+86 -7)
📝 src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte (+75 -68)
📝 src/lib/components/common/ToolCallDisplay.svelte (+76 -19)
📝 src/routes/+layout.svelte (+3 -3)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.

This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.

Before submitting, make sure you've checked the following:

  • Linked Issue/Discussion: This PR references an existing Issue or DiscussionCloses #___ / Relates to #24949. If one does not exist, create one first. PRs without a linked issue or discussion may be closed without review.
  • Target branch: The pull request targets the dev branch. PRs targeting main will be immediately closed.
  • Description: A concise description of the changes is provided below.
  • Changelog: A changelog entry following Keep a Changelog format is included at the bottom.
  • Documentation: Relevant documentation has been added or updated in the Open WebUI Docs Repository.
  • Dependencies: Any new or updated dependencies are explained, tested, and documented.
  • Testing: Manual tests have been performed to verify the fix/feature works correctly and does not introduce regressions. Screenshots or recordings are included where applicable.
  • No Unchecked AI Code: This PR is either human-written or has undergone thorough human review AND manual testing. Unreviewed AI-generated PRs may be closed immediately.
  • Self-Review: A self-review of the code has been performed, ensuring adherence to project coding standards.
  • Architecture: Smart defaults are preferred over new settings. Local state is used for ephemeral UI logic. Major architectural or UX changes have been discussed first.
  • Git Hygiene: The PR is atomic (one logical change), rebased on dev, and contains no unrelated commits.
  • Title Prefix: The PR title uses one of the listed prefixes.

Changelog Entry

Description

  • Reduce heavy chat rendering work for markdown, code blocks, tool-call displays, and high-latency chat navigation.

Added

  • None.

Changed

  • Code blocks mount CodeMirror only when editing, and use lighter rendering for large or streaming blocks.
  • Tool-call display work is memoized and delayed so collapsed calls avoid nested markdown parsing and eager result decoding.
  • Chat loading parallelizes independent metadata probes and discards stale navigation loads.
  • Removed noisy chat-path console logging from hot streaming and navigation paths.

Deprecated

  • None.

Removed

  • None.

Fixed

  • Reduced UI stalls caused by eager markdown/highlighting/tool-call work in large chat histories and high-latency browser sessions.

Security

  • None.

Breaking Changes

  • None.

Additional Information

This PR was prepared by an autonomous AI coding agent at a user's request, then manually reviewed and tested before marking the checklist item above. Please review it as an ordinary external contribution; no maintainer affiliation is implied.

Validation performed on the cleaned branch:

  • git diff --check origin/dev...HEAD
  • Svelte compiler smoke checks for:
    • src/lib/components/chat/Chat.svelte
    • src/routes/+layout.svelte
    • src/lib/components/chat/Messages/CodeBlock.svelte
    • src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte
    • src/lib/components/common/ToolCallDisplay.svelte
  • npx vitest run --passWithNoTests
  • Changed-file secret scan over the PR diff.
  • Manual local Open WebUI load check in Chromium via Playwright: sign-in page loaded with title Open WebUI, no console errors.

🔄 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/24952 **Author:** [@noufalkv](https://github.com/noufalkv) **Created:** 5/20/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `perf/tor-chat-rendering` --- ### 📝 Commits (3) - [`1d2ccce`](https://github.com/open-webui/open-webui/commit/1d2ccce0047d1db52b20d6b3c520e551db883b94) perf(renderer): reduce markdown and tool-call mount cost - [`40346ff`](https://github.com/open-webui/open-webui/commit/40346ff482c016e99c5d0ce9838f45059f1291aa) test(renderer): add pathological chat stress fixtures - [`d1f1c51`](https://github.com/open-webui/open-webui/commit/d1f1c513f3fee6466239bd066facd12254457d4b) perf(chat): reduce high-latency load stalls ### 📊 Changes **8 files changed** (+555 additions, -119 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) ➕ `scripts/renderer-stress-cases.mjs` (+237 -0) ➕ `scripts/renderer-stress-cases.test.mjs` (+36 -0) 📝 `src/lib/components/chat/Chat.svelte` (+41 -21) 📝 `src/lib/components/chat/Messages/CodeBlock.svelte` (+86 -7) 📝 `src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte` (+75 -68) 📝 `src/lib/components/common/ToolCallDisplay.svelte` (+76 -19) 📝 `src/routes/+layout.svelte` (+3 -3) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request. This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR. **Before submitting, make sure you've checked the following:** - [ ] **Linked Issue/Discussion:** This PR references an existing [Issue](https://github.com/open-webui/open-webui/issues) or [Discussion](https://github.com/open-webui/open-webui/discussions) — `Closes #___` / `Relates to #24949`. If one does not exist, create one first. PRs without a linked issue or discussion may be closed without review. - [x] **Target branch:** The pull request targets the `dev` branch. **PRs targeting `main` will be immediately closed.** - [x] **Description:** A concise description of the changes is provided below. - [x] **Changelog:** A changelog entry following [Keep a Changelog](https://keepachangelog.com/) format is included at the bottom. - [ ] **Documentation:** Relevant documentation has been added or updated in the [Open WebUI Docs Repository](https://github.com/open-webui/docs). - [x] **Dependencies:** Any new or updated dependencies are explained, tested, and documented. - [x] **Testing:** Manual tests have been performed to verify the fix/feature works correctly and does not introduce regressions. Screenshots or recordings are included where applicable. - [x] **No Unchecked AI Code:** This PR is either human-written or has undergone thorough human review AND manual testing. Unreviewed AI-generated PRs may be closed immediately. - [x] **Self-Review:** A self-review of the code has been performed, ensuring adherence to project coding standards. - [x] **Architecture:** Smart defaults are preferred over new settings. Local state is used for ephemeral UI logic. Major architectural or UX changes have been discussed first. - [x] **Git Hygiene:** The PR is atomic (one logical change), rebased on `dev`, and contains no unrelated commits. - [x] **Title Prefix:** The PR title uses one of the listed prefixes. # Changelog Entry ### Description - Reduce heavy chat rendering work for markdown, code blocks, tool-call displays, and high-latency chat navigation. ### Added - None. ### Changed - Code blocks mount CodeMirror only when editing, and use lighter rendering for large or streaming blocks. - Tool-call display work is memoized and delayed so collapsed calls avoid nested markdown parsing and eager result decoding. - Chat loading parallelizes independent metadata probes and discards stale navigation loads. - Removed noisy chat-path console logging from hot streaming and navigation paths. ### Deprecated - None. ### Removed - None. ### Fixed - Reduced UI stalls caused by eager markdown/highlighting/tool-call work in large chat histories and high-latency browser sessions. ### Security - None. ### Breaking Changes - None. --- ### Additional Information This PR was prepared by an autonomous AI coding agent at a user's request, then manually reviewed and tested before marking the checklist item above. Please review it as an ordinary external contribution; no maintainer affiliation is implied. Validation performed on the cleaned branch: - `git diff --check origin/dev...HEAD` - Svelte compiler smoke checks for: - `src/lib/components/chat/Chat.svelte` - `src/routes/+layout.svelte` - `src/lib/components/chat/Messages/CodeBlock.svelte` - `src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte` - `src/lib/components/common/ToolCallDisplay.svelte` - `npx vitest run --passWithNoTests` - Changed-file secret scan over the PR diff. - Manual local Open WebUI load check in Chromium via Playwright: sign-in page loaded with title `Open WebUI`, no console errors. --- <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-05-21 17:18:54 -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#131609