Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343049 - Optimize Table/Tree#dispose()
Summary: Optimize Table/Tree#dispose()
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.4 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-16 14:34 EDT by Rüdiger Herrmann CLA
Modified: 2011-04-19 10:04 EDT (History)
0 users

See Also:


Attachments
Proposed patch (5.83 KB, patch)
2011-04-19 05:46 EDT, Ivan Furnadjiev CLA
no flags Details | Diff
Activated test case (6.76 KB, patch)
2011-04-19 09:16 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 Rüdiger Herrmann CLA 2011-04-16 14:34:12 EDT
While disposing of a table, all TableItems and TableColumns are disposed of one by one. This causes many unnecessary re calculation of scoll bar sizes, topIndex, focusIndex, etc.
This should be avoided.

Also check the Tree if a similar optimization can be applied there.
Comment 1 Ivan Furnadjiev CLA 2011-04-19 05:46:28 EDT
Created attachment 193561 [details]
Proposed patch

This patch skips the code executed in Table#destroyItem and Table#destroyColumn if Table is in dispose. The corresponding item and column are removed from its holder in Table#releaseChildren. Do I miss something?
Comment 2 Ivan Furnadjiev CLA 2011-04-19 09:09:47 EDT
Just checked the Tree and the same optimization could be made for it too.
Comment 3 Rüdiger Herrmann CLA 2011-04-19 09:16:20 EDT
Created attachment 193579 [details]
Activated test case

The Table_Test#testDisposeWithFontDisposeInDisposeListener() was without effect as it wasn't executing the PROCESS_ACTION phase.
This patch includes the previous and fakes the phase in the test accordingly.
With this, we even have a test case for the changes.
From my point of view, the patch can be committed.
Comment 4 Ivan Furnadjiev CLA 2011-04-19 09:29:18 EDT
Applied patch to CVS HEAD. Will be made the same optimization for Tree as well.
Comment 5 Ivan Furnadjiev CLA 2011-04-19 10:04:20 EDT
Similar optimization for Tree is in CVS.