Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348681

Summary: UIProcess is slowing down, when start-method is called several times in a row
Product: [RT] Riena Reporter: Steffen Kriese <steffen.kriese>
Component: CoreAssignee: Project Inbox <riena.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.0.0   
Target Milestone: 3.0.0   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to reporoduce the behavior with the SWT Exampleclient
none
Patch for Riena none

Description Steffen Kriese CLA 2011-06-08 03:59:16 EDT
We changed the behavior of the UIProcess so it can be started multiple times in a row and the UIProcess checks, if the job is already scheduled and does nothing. This doesn't work properly, because if the start-method of a UIProcess is called like 50 times in a row, the execution hangs for about 1-2 seconds and gets slower with every additional execution.

This was introduced with revision 1.32 on 2.5.2011 in the UIProcess-class.
Comment 1 Steffen Kriese CLA 2011-06-08 04:24:46 EDT
Created attachment 197567 [details]
Patch to reporoduce the behavior with the SWT Exampleclient

steps to reproduce:

- apply patch
- start SWT ExampleClient
- go to Playground => UIProcess
- switch between SubModules Demo_1 and uiProcess_2 for at least 40 times
Comment 2 Steffen Kriese CLA 2011-06-09 08:43:15 EDT
After profiling the SWT Exampleclient I found out, that the method StatuslineUIProcessRidget.ContextUpdateListener.contextUpdated() was called more than 200 000 times when switching about 50 times between the 2 SubModules. I am not sure what this method does, but it's called way to often ;-)
Also in the method StatuslineUIProcessRidget.observeContext() the contextUpdateListener was created and registered for every call. So the list of listeners grows with every execution. That doesn't seem right as well. I fixed this by adding a check in the NodeEventDelegation.addContextUpdateListener() method, where the listener is registered. This helped reducing the calles to contextUpdated(), but I dont't know if this fix would break anything else, so I will add a patch to reproduce this.
Comment 3 Steffen Kriese CLA 2011-06-09 08:44:43 EDT
Created attachment 197691 [details]
Patch for Riena

Adds some debug statements and reduces the amount of listeners registered in NodeEventDelegation.
Comment 4 Steffen Kriese CLA 2011-06-15 08:29:22 EDT
Fixed in HEAD