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

Bug 275832

Summary: [Table] disposing of many TableItems is slow
Product: [RT] RAP Reporter: Björn Fischer <b.fischer>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: elias, stefan.roeck
Version: 1.2   
Target Milestone: 1.2 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Testproject showing the performance bug none

Description Björn Fischer CLA 2009-05-12 05:37:13 EDT
Created attachment 135309 [details]
Testproject showing the performance bug

There is a performance problem with the TableViewer when switching the input from a large amount of items to a small amount. To reproduce this bug do the following:

1. Create TableViewer with some columns
2. Create two Buttons, one to set a small input (List of 1 or 2 Objects), and one to set a large input (List of 500+ Objects)
3. Run the app, click the Button "setLargeInput", then click the Button "setSmallInput". The second click takes some seconds (depending on the number of objects in the _previous_ input) until the Table shows the correct items

This behavoiur happens in Firefox and IE 7. I am using RAP 1.2 M7 (but the Problem was there in M6 and probably earlier too). I attach a project that contains a view demonstrating the behaviour.

The problem seems neither to be in setInput(), nor in one of the LifeCicle phases. In the attached project I implemented time measurement for all these including syso's with the taken time.

Measuring the time from second click until the items are shown gave the following results:

Number of objecs in "large" input -> Time from click to show
200 objects -> 3 secs
400 objects -> 13 secs
800 objects -> 20 secs
Comment 1 Rüdiger Herrmann CLA 2009-05-12 14:02:48 EDT
If table items are disposed from top to bottom (lower indices first) and the top index 
is at the beginning of the table, then all rows are refreshed with each disposed item.
Changed summay accordingly.
Comment 2 Rüdiger Herrmann CLA 2009-05-12 14:03:35 EDT
Fixed in CVS HEAD
Comment 3 Stefan Röck CLA 2009-05-12 14:05:39 EDT
Rüdiger, could you please attach a patch to allow porting this patch back to RAP 1.1.2 or give some advice which files are affected by this fix? Thanks.
Comment 4 Rüdiger Herrmann CLA 2009-05-12 14:09:51 EDT
(In reply to comment #3)
> R�diger, could you please attach a patch to allow porting this patch back to RAP
> 1.1.2 or give some advice which files are affected by this fix? Thanks.
The only change was in Table.js, function _removeItem()
remove the call to this._updateRows();

Comment 5 Stefan Röck CLA 2009-05-13 04:20:37 EDT
Rüdiger, thanks for this fix.
Comment 6 Björn Fischer CLA 2009-05-13 10:49:41 EDT
Just want to agree Stefan...
Thanks, Rüdiger, for fixing this so fast!