Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow org.eclipse.swt.widgets.Display.withCrLf(String) #1718

Closed
jukzi opened this issue Jan 13, 2025 · 1 comment · Fixed by #1722
Closed

Slow org.eclipse.swt.widgets.Display.withCrLf(String) #1718

jukzi opened this issue Jan 13, 2025 · 1 comment · Fixed by #1722
Assignees
Labels
performance Performance issue regression Something that used to work Windows Happens on Windows OS

Comments

@jukzi
Copy link
Contributor

jukzi commented Jan 13, 2025

reproduce: open help/"Installation Details"/Configuration (~200_000 lines)
=> UI freeze warning
regression from #1708 @Christopher-Hermann
A regexp is performance overkill.

eclipse.buildId=4.35.0.I20250112-1800
java.version=22.0.2
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.eclipse.ui.monitoring
Warning
Mon Jan 13 15:43:12 CET 2025
UI freeze of 1,4s at 15:43:11.504


org.eclipse.ui.monitoring
Info
Mon Jan 13 15:43:12 CET 2025
Sample at 15:43:12.503 (+0,333s)
Thread 'main' tid=1 (RUNNABLE)

Stack Trace
	at [email protected]/java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:4133)
	at [email protected]/java.util.regex.Pattern$Branch.match(Pattern.java:4914)
	at [email protected]/java.util.regex.Pattern$GroupHead.match(Pattern.java:4969)
	at [email protected]/java.util.regex.Pattern$Start.match(Pattern.java:3787)
	at [email protected]/java.util.regex.Matcher.search(Matcher.java:1765)
	at [email protected]/java.util.regex.Matcher.find(Matcher.java:785)
	at [email protected]/java.util.regex.Matcher.replaceAll(Matcher.java:1228)
	at [email protected]/java.lang.String.replaceAll(String.java:3111)
	at org.eclipse.swt.widgets.Display.withCrLf(Display.java:5159)
	at org.eclipse.swt.widgets.Text.setText(Text.java:2305)
	at org.eclipse.ui.internal.about.AboutSystemPage.lambda$2(AboutSystemPage.java:181)
	at org.eclipse.ui.internal.about.AboutSystemPage$$Lambda/0x000001bb65f30a88.run(Unknown Source)
	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:4084)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.ui.internal.dialogs.AboutDialog.lambda$0(AboutDialog.java:131)
	at org.eclipse.ui.internal.dialogs.AboutDialog$$Lambda/0x000001bb65c70238.run(Unknown Source)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.dialogs.AboutDialog.buttonPressed(AboutDialog.java:127)
	at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
	at org.eclipse.jface.dialogs.Dialog$$Lambda/0x000001bb643579b8.accept(Unknown Source)
	at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:83)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:286)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4311)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1208)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4109)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3697)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.ui.internal.about.AboutHandler.execute(AboutHandler.java:31)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:277)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:98)
	at [email protected]/java.lang.invoke.LambdaForm$DMH/0x000001bb651f0400.invokeVirtual(LambdaForm$DMH)
	at [email protected]/java.lang.invoke.LambdaForm$MH/0x000001bb6559c800.invoke(LambdaForm$MH)
	at [email protected]/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
	at [email protected]/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:157)
	at [email protected]/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:580)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:299)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:233)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:385)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:141)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:581)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:415)
	at org.eclipse.jface.action.ActionContributionItem$$Lambda/0x000001bb64704638.handleEvent(Unknown Source)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4311)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1208)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4109)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3697)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(Unknown Source)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(Unknown Source)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Unknown Source)
	at org.eclipse.ui.internal.Workbench$$Lambda/0x000001bb64360ee8.run(Unknown Source)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at [email protected]/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
	at [email protected]/java.lang.invoke.LambdaForm$MH/0x000001bb64007800.invoke(LambdaForm$MH)
	at [email protected]/java.lang.invoke.LambdaForm$MH/0x000001bb64007c00.invokeExact_MT(LambdaForm$MH)
	at [email protected]/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Unknown Source)
	at [email protected]/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
	at [email protected]/java.lang.reflect.Method.invoke(Unknown Source)
	at app//org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at app//org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at app//org.eclipse.equinox.launcher.Main.run(Main.java:1481)
@jukzi jukzi added regression Something that used to work performance Performance issue Windows Happens on Windows OS labels Jan 13, 2025
@Christopher-Hermann Christopher-Hermann self-assigned this Jan 13, 2025
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 14, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
@Christopher-Hermann
Copy link
Contributor

Christopher-Hermann commented Jan 14, 2025

@jukzi Could you please check if the issue is resolved with this PR?

Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 16, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 16, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 16, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 16, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 17, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.swt that referenced this issue Jan 20, 2025
Changing back to the old withCrLf coding. Regex is causing performance issues.

Furthermore, handling of mixed \n and \r\n is improved.

Fixes: eclipse-platform#1718
@jukzi jukzi closed this as completed in d04d5a4 Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issue regression Something that used to work Windows Happens on Windows OS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants