You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] After updating to 0.18.0 Agents are extremely slow #259
After the latest updates, Agents are extremely slow, thinking for extremely long time, even the moderate ones. Tasks that used to take 10-15 minutes, now takes several hours. Mostly tested with GPT 5.4-medium.
Could be GPT only issue. I tried today Claude Opus 4.7 and GPT 5.5 for same task (code review), later was really slow. It printed sentences in the "thinking" mode word by word, as it would really think :)
I'm currently investigating this issue and have tried several fixes to reduce the overhead of rendering the thinking block, but none of them have been effective. One thing I noticed is that the thinking block always becomes slow or gets stuck after the following error occurs:
!ENTRY org.eclipse.ui.console 4 120 2026-05-29 22:20:05.286
!MESSAGE fixed width: false
!STACK 0
org.eclipse.jface.text.BadLocationException: 244
at org.eclipse.jface.text.TreeLineTracker.offsetByLine(TreeLineTracker.java:335)
at org.eclipse.jface.text.TreeLineTracker.getLineOffset(TreeLineTracker.java:1101)
at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:252)
at org.eclipse.jface.text.AbstractDocument.getLineOffset(AbstractDocument.java:868)
at org.eclipse.ui.internal.console.ConsoleDocument.getLineOffset(ConsoleDocument.java:59)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getLineOffset(ConsoleDocumentAdapter.java:354)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getOffsetAtLine(ConsoleDocumentAdapter.java:332)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1099)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:984)
at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:306)
at org.eclipse.swt.custom.StyledText.getVerticalScrollOffset(StyledText.java:5066)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4224)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4176)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8522)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8479)
at org.eclipse.swt.custom.StyledText.updateSelection(StyledText.java:10865)
at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:6120)
at org.eclipse.swt.custom.StyledText$5.textChanged(StyledText.java:5442)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.documentChanged(ConsoleDocumentAdapter.java:588)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:739)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:708)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:692)
at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:766)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1091)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1109)
at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:74)
at org.eclipse.ui.internal.console.IOConsolePartitioner.trim(IOConsolePartitioner.java:1216)
at org.eclipse.ui.internal.console.IOConsolePartitioner.checkBufferSize(IOConsolePartitioner.java:438)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.processPendingPartitions(IOConsolePartitioner.java:808)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.runInUIThread(IOConsolePartitioner.java:763)
at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4135)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3751)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:678)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:627)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1403)
!ENTRY org.eclipse.ui.console 4 120 2026-05-29 22:20:05.288
!MESSAGE fixed width: false
!STACK 0
org.eclipse.jface.text.BadLocationException: 245
at org.eclipse.jface.text.TreeLineTracker.getLineInformation(TreeLineTracker.java:1153)
at org.eclipse.jface.text.AbstractLineTracker.getLineInformation(AbstractLineTracker.java:228)
at org.eclipse.jface.text.AbstractDocument.getLineInformation(AbstractDocument.java:873)
at org.eclipse.ui.internal.console.ConsoleDocument.getLineInformation(ConsoleDocument.java:44)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getLineInformation(ConsoleDocumentAdapter.java:249)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getLine(ConsoleDocumentAdapter.java:226)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1098)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:984)
at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:306)
at org.eclipse.swt.custom.StyledText.getVerticalScrollOffset(StyledText.java:5066)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4224)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4176)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8522)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8479)
at org.eclipse.swt.custom.StyledText.updateSelection(StyledText.java:10865)
at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:6120)
at org.eclipse.swt.custom.StyledText$5.textChanged(StyledText.java:5442)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.documentChanged(ConsoleDocumentAdapter.java:588)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:739)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:708)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:692)
at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:766)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1091)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1109)
at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:74)
at org.eclipse.ui.internal.console.IOConsolePartitioner.trim(IOConsolePartitioner.java:1216)
at org.eclipse.ui.internal.console.IOConsolePartitioner.checkBufferSize(IOConsolePartitioner.java:438)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.processPendingPartitions(IOConsolePartitioner.java:808)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.runInUIThread(IOConsolePartitioner.java:763)
at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4135)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3751)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:678)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:627)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1403)
!ENTRY org.eclipse.ui.console 4 120 2026-05-29 22:20:05.289
!MESSAGE fixed width: false
!STACK 0
org.eclipse.jface.text.BadLocationException: 245
at org.eclipse.jface.text.TreeLineTracker.offsetByLine(TreeLineTracker.java:335)
at org.eclipse.jface.text.TreeLineTracker.getLineOffset(TreeLineTracker.java:1101)
at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:252)
at org.eclipse.jface.text.AbstractDocument.getLineOffset(AbstractDocument.java:868)
at org.eclipse.ui.internal.console.ConsoleDocument.getLineOffset(ConsoleDocument.java:59)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getLineOffset(ConsoleDocumentAdapter.java:354)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.getOffsetAtLine(ConsoleDocumentAdapter.java:332)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1099)
at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:984)
at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:306)
at org.eclipse.swt.custom.StyledText.getVerticalScrollOffset(StyledText.java:5066)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4224)
at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4176)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8522)
at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8479)
at org.eclipse.swt.custom.StyledText.updateSelection(StyledText.java:10865)
at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:6120)
at org.eclipse.swt.custom.StyledText$5.textChanged(StyledText.java:5442)
at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.documentChanged(ConsoleDocumentAdapter.java:588)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged2(AbstractDocument.java:739)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:708)
at org.eclipse.jface.text.AbstractDocument.doFireDocumentChanged(AbstractDocument.java:692)
at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:766)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1091)
at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1109)
at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:74)
at org.eclipse.ui.internal.console.IOConsolePartitioner.trim(IOConsolePartitioner.java:1216)
at org.eclipse.ui.internal.console.IOConsolePartitioner.checkBufferSize(IOConsolePartitioner.java:438)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.processPendingPartitions(IOConsolePartitioner.java:808)
at org.eclipse.ui.internal.console.IOConsolePartitioner$QueueProcessingJob.runInUIThread(IOConsolePartitioner.java:763)
at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4135)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3751)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:678)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:583)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:185)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:219)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:149)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:115)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:467)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:298)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:627)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1403)
Do you have any insights? Thanks for any suggestions.
Just curious: how an error on Console update affects thinking block performance? I don't see any pointers to the Copilot code in the error stack? Or is the listener org.eclipse.swt.custom.StyledText$5.textChanged(StyledText.java:5442) added by Copilot? Why do you listen to console styled text?
Beside this, the code runs in UI thread, it is exclusive and if some Copilot code tries to use UI thread at same time, it is a bottleneck of course. Not sure how much that all related to thinking blocks.
Performance Analysis: Slow Chat Output in GitHub Copilot for Eclipse
Date: 2026-06-09 Issue: Plugin outputs approximately 1 word per second when used in Eclipse Severity: Critical - Plugin is essentially unusable at current performance
Executive Summary
The copilot-for-eclipse plugin exhibits severe performance issues when displaying streamed chat responses, outputting only about 1 word per second. The root cause is an O(n²) markdown parsing operation combined with no debouncing/batching of UI updates, resulting in exponential slowdown as response text grows.
Root Causes Identified
1. O(n²) Markdown Parsing (Critical)
Location:BaseTurnWidget.java (lines 225-243, 474-501) and ChatMarkupViewer.java (lines 66-79)
Problem:
Every time a newline character arrives from the streaming response, processMessageLine() is called immediately
This triggers appendTextToTextViewer() which calls markupViewer.setMarkup(text)
ChatMarkupViewer.setMarkup() re-parses the entire accumulated markdown content every time via computeHtml()
Impact:
As response text grows from 100 to 1000 characters, the markdown parser runs on increasingly larger content
This creates O(n²) complexity - if response has n characters, total parsing work is proportional to n²
For a 1000-character response: ~500,000 character-parsing operations
// BaseTurnWidget.java - Line 225-243publicvoidappendMessage(Stringmessage) {
if (StringUtils.isEmpty(message)) {
return;
}
messageBuffer.append(message);
intnewlineIndex;
while ((newlineIndex = messageBuffer.indexOf("\n")) != -1) {
Stringline = messageBuffer.substring(0, newlineIndex + 1);
messageBuffer.delete(0, newlineIndex + 1);
processMessageLine(line); // Called for EVERY newline
}
}
// ChatMarkupViewer.java - Line 66-79@OverridepublicvoidsetMarkup(Stringsource) {
try {
StringhtmlText = this.computeHtml(source); // FULL re-parse every timesetHtml(htmlText);
} catch (Throwablet) {
// fallback
}
}
Problem:
Every character update triggers multiple expensive operations:
requestLayout() calls
refreshScrollerLayout() calls
Full markdown re-parsing via computeHtml()
setOrigin() scroll adjustments
requestRefreshScrollerLayout() async scheduling
// ChatContentViewer.java - Line 242-246refreshScrollerLayout(); // Called on every progress eventif (shouldAutoScrollToBottom()) {
scrollToBottom();
}
// ThinkingBlock.java - Line 104-105publicvoidappendText(Stringfragment) {
textBuffer.append(fragment);
refreshBody(); // Full re-parse of thinking blockrequestLayout(); // Layout recalculation
}
The severe performance issue is caused by fundamental architectural problems in the chat rendering pipeline:
Immediate rendering on every character instead of batched updates
Full markdown re-parsing instead of incremental updates
No debouncing to coalesce rapid changes
Implementing the recommended fixes should reduce rendering time from O(n²) to O(n), resulting in 10-100x improvement in chat response display performance.
Is there any update on this issue?
I find that there may be 2 aspects of the slow issue:
When you click the existing chat record which contains multiple turns, it takes much time to load and show all of the content. I find setMarkup() may consume most of the time since the "O(n²) complexity" issue.
When you continue chat in the long conversation, you may get response more and more slowly. I find that the reason may because processTurnEvent() and refreshScrollerLayout() affect and block each other. processTurnEvent() is invoked when new message is received and it invokes SwtUtils.invokeOnDisplayThread() to directly to handle messages and create components and then invoke refreshScrollerLayout(). But UI thread may be blocked by last turn of refreshScrollerLayout(). So processTurnEvent() is blocked a lot by refreshScrollerLayout() eventually. I suggest that we should optimize processTurnEvent() with non-blocking operation.
Activity
iloveeclipse commentedon May 26, 2026
Could be GPT only issue. I tried today Claude Opus 4.7 and GPT 5.5 for same task (code review), later was really slow. It printed sentences in the "thinking" mode word by word, as it would really think :)
jdneo commentedon May 27, 2026
I did not notice this with GPT 5.4-medium, is the behavior still the same now?
Or, do you observe the pattern that: chat view rendered smoothly at the beginning, and when more and more elements added, it becomes slow?
ethanyhou commentedon May 27, 2026
Hi maxentric-aplymoth, and Andrey Loskutov (@iloveeclipse),
Thanks for the feedback. We’re looking into this issue. Please stay tuned.
ethanyhou commentedon May 29, 2026
Hi Andrey Loskutov (@iloveeclipse),
I'm currently investigating this issue and have tried several fixes to reduce the overhead of rendering the thinking block, but none of them have been effective. One thing I noticed is that the thinking block always becomes slow or gets stuck after the following error occurs:
Do you have any insights? Thanks for any suggestions.
iloveeclipse commentedon May 29, 2026
Just curious: how an error on Console update affects thinking block performance? I don't see any pointers to the Copilot code in the error stack? Or is the listener
org.eclipse.swt.custom.StyledText$5.textChanged(StyledText.java:5442)added by Copilot? Why do you listen to console styled text?Beside this, the code runs in UI thread, it is exclusive and if some Copilot code tries to use UI thread at same time, it is a bottleneck of course. Not sure how much that all related to thinking blocks.
jdneo commentedon Jun 2, 2026
Most time cost happens at ChatContentViewer.processTurnEvent
My take away:
gvl2023 commentedon Jun 3, 2026
Subscribing. Sadly there isn't a way to disable reasoning blocks if they are indeed what's causing this performance issue.
infinity202 commentedon Jun 9, 2026
Performance Analysis: Slow Chat Output in GitHub Copilot for Eclipse
Date: 2026-06-09
Issue: Plugin outputs approximately 1 word per second when used in Eclipse
Severity: Critical - Plugin is essentially unusable at current performance
Executive Summary
The copilot-for-eclipse plugin exhibits severe performance issues when displaying streamed chat responses, outputting only about 1 word per second. The root cause is an O(n²) markdown parsing operation combined with no debouncing/batching of UI updates, resulting in exponential slowdown as response text grows.
Root Causes Identified
1. O(n²) Markdown Parsing (Critical)
Location:
BaseTurnWidget.java(lines 225-243, 474-501) andChatMarkupViewer.java(lines 66-79)Problem:
processMessageLine()is called immediatelyappendTextToTextViewer()which callsmarkupViewer.setMarkup(text)ChatMarkupViewer.setMarkup()re-parses the entire accumulated markdown content every time viacomputeHtml()Impact:
2. No Debouncing/Batching Mechanism (Critical)
Location:
BaseTurnWidget.java,ChatContentViewer.javaProblem:
Impact:
3. Excessive UI Layout Calls (High)
Location:
ChatContentViewer.java,BaseTurnWidget.java,ThinkingBlock.javaProblem:
Every character update triggers multiple expensive operations:
requestLayout()callsrefreshScrollerLayout()callscomputeHtml()setOrigin()scroll adjustmentsrequestRefreshScrollerLayout()async schedulingFiles and Methods Involved
BaseTurnWidget.javaappendMessage()BaseTurnWidget.javaprocessMessageLine()BaseTurnWidget.javaappendTextToTextViewer()ChatMarkupViewer.javasetMarkup()ChatMarkupViewer.javacomputeHtml()ChatContentViewer.javaprocessTurnEvent()ThinkingBlock.javaappendText()ThinkingBlock.javarefreshBody()Performance Analysis
Current Behavior (O(n²)):
Expected Behavior with Fix (O(n)):
Recommended Fixes
Fix 1: Batch Text Updates (Priority: High)
Accumulate text in the buffer and only update the UI periodically:
Fix 2: Incremental Document Updates (Priority: High)
Instead of replacing entire markup, append to existing document:
Fix 3: Optimize Markdown Rendering (Priority: Medium)
Add caching to
ChatMarkupViewerto avoid re-parsing unchanged content:Fix 4: Use StyledText Directly for Plain Text (Priority: Medium)
For non-markdown content, bypass the expensive markdown parser:
Testing Recommendations
Unit Tests:
appendMessage()with various text sizes (100, 1000, 10000 chars)Integration Tests:
Performance Metrics:
Related Files to Review
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/BaseTurnWidget.javacom.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatMarkupViewer.javacom.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatContentViewer.javacom.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ThinkingBlock.javacom.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/SwtUtils.javaConclusion
The severe performance issue is caused by fundamental architectural problems in the chat rendering pipeline:
Implementing the recommended fixes should reduce rendering time from O(n²) to O(n), resulting in 10-100x improvement in chat response display performance.
Analysis made by QWEN3.5b
royrang commentedon Jun 23, 2026
Is there any update on this issue?
I find that there may be 2 aspects of the slow issue:
iloveeclipse commentedon Jun 30, 2026
Sheng Chen (@jdneo) : can we have a nightly build with this fix?
jdneo commentedon Jun 30, 2026
We just released a new nightly build which should improve the rendering efficiency a lot. Please have a try:
// cc Andrey Loskutov (@iloveeclipse)