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

Bug 369201

Summary: Tweak client performance
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: shawn.kleese, tbuschto
Version: 1.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2012-01-20 06:15:32 EST
After switching to JSON protocol, the time the client needs for creating new widgets increased about 2-20% depending on widget and browser. This is most likely due to the additional code within the Widget-Adapters that handle tasks that were done by the server before (e.g. replacing certain characters for strings). To counter this, there are some tweaks that could be done:

- Cache references to widgets and rwt-types in Processor.js and/or ObjectManager.js

- Replace cases of setAppearance with new init value, as this triggers some unnecessary calculation.

- Fixing Bug 360674

- remove instances of qx.core.Variant.isSet (either replace them with Variant.select, with Client.isXXX, or remove them completely)

- introduce an alternative for Target#createDispatchEvent for cases where the actual event object is not needed (creating object en masse can cost some time)

- check if the number of calls to Widget.js#disableScrolling, Widget.js#prepareEnhancedBorder, VML.js#setFillGradient or VML.js#_copyData can be reduced.

- refactor Tree/Table to improve perforamnce for this widget specifically

- dispose qooxdoo objects asynchronously (after the changes are rendered)
Comment 1 Tim Buschtoens CLA 2012-01-20 09:51:13 EST
Important note: The 2 to 20% are relative to the time needed to process the message itself, NOT including the actual rendering, which makes 50% or more of the entire process.
Comment 2 Tim Buschtoens CLA 2012-01-20 10:03:57 EST
Refactored Processor.js to minimize lookups in ObjectManager.js. Changes are in CVS HEAD.
Comment 3 Tim Buschtoens CLA 2012-01-20 10:54:57 EST
Sadly, setAppearance can not be easily replaced or refactored to prevent unnecessary calculation, because some code relies on this to be done immideatly. While this could be fixed, i'm not feeling that it is too risky and not worth the effort.
Comment 4 Tim Buschtoens CLA 2012-01-20 11:44:50 EST
Removed all occurrences of "qx.core.Variant.isSet( 'qx.debug', 'on' )" and of qx.core.Settings, including Settings.js in CVS HEAD.
Comment 5 Tim Buschtoens CLA 2012-01-23 09:39:06 EST
Replaced all instances of "qx.core.Variant.isSet( "qx.client", .."  in CVS HEAD. 

The instances of Variant.isSet then remain i would rather not touch right now.
Comment 6 Tim Buschtoens CLA 2012-01-23 11:55:01 EST
Introduced Target.js#dispatchSimpleEvent to CVS HEAD. This does not create a qooxdoo event object, and is used by Widget.js ("appear", "create", "insertDom") and TreeItem.js ("update").
Comment 7 Tim Buschtoens CLA 2012-01-24 06:54:52 EST
Calls to prepareEnhancedBorder have been optimized to be done before any elements or properties have to be copied, reducing the number of DOM-accesses (non CSS3 browser only). Changes are in CVS HEAD.