Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346089 - Consider to bypass AdapterManager in Widget#getAdapter for Widget LCA
Summary: Consider to bypass AdapterManager in Widget#getAdapter for Widget LCA
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 1.5 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 09:44 EDT by Ralf Sternberg CLA
Modified: 2011-10-17 06:53 EDT (History)
1 user (show)

See Also:


Attachments
Patch (17.16 KB, patch)
2011-05-18 07:14 EDT, Rüdiger Herrmann CLA
no flags Details | Diff
Patch #2 (19.49 KB, patch)
2011-05-19 04:21 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-05-17 09:44:21 EDT
Performance measurements have shown that calling the AdapterManager consumes a considerable amount of time in Widget#getAdapter(). Since the AdapterManager is currently used only to manage lifecycle adapters, we suggest the following improvement:
In Widget#getAdapter(), we could directly consult the LifeCycleAdapterFactory in order to find the corresponding LCA.
Furthermore, this result could be buffered in the widget.
Comment 1 Rüdiger Herrmann CLA 2011-05-18 07:14:52 EDT
Created attachment 195949 [details]
Patch

This patch converts the LifeCycleAdapterFactory from an IAdapterFactory that was registered at the AdapterManager to a member of the RWTFactory.
The implementation of Display#getAdapter() and Widget#getAdapter() was changed to consult the LifeCycleAdapterFactory if an ILifeCycleAdapter is requested. 
Despite that RWT itself registers no more adapter factories at the AdapterManager, AdapterManager#getAdapter() is still called as a last resort in getAdapter().
Comment 2 Rüdiger Herrmann CLA 2011-05-19 04:21:56 EDT
Created attachment 196083 [details]
Patch #2

Same as patch #1, plus it introduces SharedInstanceBuffer from bug 345933 in LifeCycleAdapterFactory
Comment 3 Rüdiger Herrmann CLA 2011-10-17 06:53:42 EDT
Converted the LifeCycleAdapterFactory from an AdapterFactory that was registered at the AdapterManager to a member of the RWTFactory.
The implementation of Display#getAdapter() and Widget#getAdapter() was changed to consult the LifeCycleAdapterFactory if an ILifeCycleAdapter is requested. 
Despite that RWT itself registers no more adapter factories at the AdapterManager, AdapterManager#getAdapter() is still called as a last resort in getAdapter().