Describe the bug
Opening a large thread in Buzz Desktop can make the UI severely laggy. In the affected thread, WebKitWebProcess used more than one CPU core and several gigabytes of resident memory.
The thread loader fetches replies in pages of 200 until the subtree is exhausted, while MessageThreadPanel mounts the complete visible reply list through threadReplyRenderItems.map(...).
Steps to reproduce
- Open a channel thread with a large reply history, especially one containing long Markdown or agent output.
- Expand nested branches if needed.
- Scroll through the thread panel.
- Observe delayed scrolling and input, high
WebKitWebProcess CPU usage, and increasing renderer memory.
Expected behavior
Opening and reading a large thread should not cause CPU and memory use to grow with every mounted reply. Deep links, unread state, nested branches, live replies, copying, and scroll anchoring should continue to work.
Measured result
Test environment:
With the same thread:
- Unbounded panel: approximately 139-174%
WebKitWebProcess CPU and 2.5-3.35 GB RSS shortly after opening. A longer session reached approximately 4.6-5 GB RSS.
- Diagnostic build mounting only the newest 60 replies: approximately 48-71% CPU and 0.97-1.04 GB RSS.
The 60-reply change was only a diagnostic test, not a proposed implementation. The result suggests that the number of mounted reply rows is the main bottleneck after the Linux rendering fixes.
Source evidence
desktop/src/features/messages/useThreadReplies.ts fetches 200 replies per page and continues until the thread is exhausted, with a 500-page safety limit.
desktop/src/features/messages/lib/threadPanel.ts flattens expanded reply subtrees into one visible list.
desktop/src/features/messages/ui/MessageThreadPanel.tsx mounts that list using threadReplyRenderItems.map(...).
Related work
I could not find an open issue or PR that limits or virtualizes the replies mounted by MessageThreadPanel.
Version and platform
- Buzz version: 0.5.8
- OS: Arch Linux, KDE Plasma 6.7.3
Additional context
I can provide additional profiling data or test a proposed fix against the affected thread if useful.
Describe the bug
Opening a large thread in Buzz Desktop can make the UI severely laggy. In the affected thread,
WebKitWebProcessused more than one CPU core and several gigabytes of resident memory.The thread loader fetches replies in pages of 200 until the subtree is exhausted, while
MessageThreadPanelmounts the complete visible reply list throughthreadReplyRenderItems.map(...).Steps to reproduce
WebKitWebProcessCPU usage, and increasing renderer memory.Expected behavior
Opening and reading a large thread should not cause CPU and memory use to grow with every mounted reply. Deep links, unread state, nested branches, live replies, copying, and scroll anchoring should continue to work.
Measured result
Test environment:
WEBKIT_DMABUF_RENDERER_FORCE_SHM=1With the same thread:
WebKitWebProcessCPU and 2.5-3.35 GB RSS shortly after opening. A longer session reached approximately 4.6-5 GB RSS.The 60-reply change was only a diagnostic test, not a proposed implementation. The result suggests that the number of mounted reply rows is the main bottleneck after the Linux rendering fixes.
Source evidence
desktop/src/features/messages/useThreadReplies.tsfetches 200 replies per page and continues until the thread is exhausted, with a 500-page safety limit.desktop/src/features/messages/lib/threadPanel.tsflattens expanded reply subtrees into one visible list.desktop/src/features/messages/ui/MessageThreadPanel.tsxmounts that list usingthreadReplyRenderItems.map(...).Related work
I could not find an open issue or PR that limits or virtualizes the replies mounted by
MessageThreadPanel.content-visibilityfrom thread replies because it caused scroll jumps.Version and platform
Additional context
I can provide additional profiling data or test a proposed fix against the affected thread if useful.