Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 189999 - [PropertiesView] [PropertiesView] Setting 1 value causes very slow recursive refresh
Summary: [PropertiesView] [PropertiesView] Setting 1 value causes very slow recursive ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 197310 (view as bug list)
Depends on:
Blocks: 200102
  Show dependency tree
 
Reported: 2007-05-30 14:44 EDT by Adam Cabler CLA
Modified: 2008-02-01 10:15 EST (History)
1 user (show)

See Also:


Attachments
Patch that demonstrates the issue (3.88 KB, patch)
2007-05-31 11:46 EDT, Eric Moffatt CLA
no flags Details | Diff
Patch to use a HashMap to find TreeItem's corresponding to a particular PropertySheet entry (3.41 KB, patch)
2007-08-23 11:59 EDT, Eric Moffatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Cabler CLA 2007-05-30 14:44:10 EDT
I have a properties with a hierarchy.  Everything is read-only except for the leaf nodes.  Setting a value takes about 5 seconds on my Core2Duo and seems to have possibly gotten even slower in RC2.  This stems from the call to PropertySheetEntry.refreshFromRoot in the setValue method.  Why should 1 value cause a total refresh?  If other values were dependent, shouldn't they have listeners?  This is a big problem for me as it will be very hard for my users to be productive with such a slow interface.
I realize its late to get something in for 3.3.  If there is a workaround, I would really like to know about it so I don't have to reimplement the property view.
Comment 1 Eric Moffatt CLA 2007-05-30 15:56:11 EDT
Adam, just to get a ballpark on how bad this is how many preperties are there in the tree in total?

I'm marking this as 3.3.1 for now...
Comment 2 Adam Cabler CLA 2007-05-30 17:28:52 EDT
Thanks for looking at this Eric.  I have about 300 editable properties and about 40 non-editable sources that provide the hierarchy.  
Btw - I did some testing with changing the call to refreshFromRoot() in PropertySheetEntry.setValue to refreshValues().  This seemed to fix this problem for me without breaking anything.  However, I would in no way call this testing extensive.  Do you know why refreshFromRoot has to be used here?

(In reply to comment #1)
> Adam, just to get a ballpark on how bad this is how many preperties are there
> in the tree in total?
> 
> I'm marking this as 3.3.1 for now...
> 

Comment 3 Eric Moffatt CLA 2007-05-31 09:50:55 EDT
Adam, let me take a look (at least to see if there have been changes here). It seems to be at least 'suspicious' that changing an individual property should have to globally refresh. That being said it's also suspicious that this call is taking 5 secs (I'd expect that we should able to do this with only 300 entries in 'real time' like the new QuickAccess (Ctrl-3) does when it filters its tree as you type).
Comment 4 Eric Moffatt CLA 2007-05-31 11:46:28 EDT
Created attachment 69535 [details]
Patch that demonstrates the issue


This patches org.eclipse.ui.examples.propertysheet by changing the 'Address' to create 'n' copies of its properties.

It also patches the 'setValue' call to instrument how long the 'refreshFromRoot' took and how many properties eventually got a chance to 'update'.
Comment 5 Eric Moffatt CLA 2007-05-31 11:52:54 EDT
Adam, The above patch demonstrates your issue I think...I tested by changing the value in the for loop in the Address class and restarting an inner, opening a '.usr' file and selecting a name (with the Properties view open). Then I -expanded- the address field before changing the 'Name' att and hitting enter.

my initial results for various 'n' values is:

Count    Time(ms)   Updates

  1         15          14
 100      2922         410
 200     11382         810
 300     24781        1210
 400     44859        1610
 500     68968        2010

Haven't graphed it yet but it's definitely non-linear...
Comment 6 Adam Cabler CLA 2007-05-31 12:52:04 EDT
wow - thanks, Eric.  this looks consistent with what I'm seeing.  Any chance simply replacing the refreshFromRoot would work as I suggested?  I'm guessing its there for a reason and its going to require a more involved fix.

(In reply to comment #5)
> Adam, The above patch demonstrates your issue I think...I tested by changing
> the value in the for loop in the Address class and restarting an inner, opening
> a '.usr' file and selecting a name (with the Properties view open). Then I
> -expanded- the address field before changing the 'Name' att and hitting enter.
> 
> my initial results for various 'n' values is:
> 
> Count    Time(ms)   Updates
> 
>   1         15          14
>  100      2922         410
>  200     11382         810
>  300     24781        1210
>  400     44859        1610
>  500     68968        2010
> 
> Haven't graphed it yet but it's definitely non-linear...
> 

Comment 7 Eric Moffatt CLA 2007-05-31 16:09:41 EDT
Yeah, problem with changes like that is that it's likely to break someone building on top of us (RCP...) that relies on the current behavior. My guess is that the 'refreshFromRoot' needs some (un)optimization (my unsubstantiated suspicion is that we're trying to minimize the 'churn' but in the process actually doing too much merging...
Comment 8 Eric Moffatt CLA 2007-08-23 11:59:48 EDT
Created attachment 76785 [details]
Patch to use a HashMap to find TreeItem's corresponding to a particular PropertySheet entry
Comment 9 Eric Moffatt CLA 2007-08-23 12:11:05 EDT
Here's the new times with the fix in place:

Count    Time(ms)   Updates

  1          0          14
 100       125         410
 200       234         810
 300       312        1210
 400       453        1610
 500       531        2010

much more linear...;-)
Comment 10 Eric Moffatt CLA 2007-08-24 11:08:33 EDT
Committed to HEAD in >20070824. Now uses a map to find the TreeItems associated with an entry.
Comment 11 Eric Moffatt CLA 2007-08-24 11:25:36 EDT
Committed to R3_3_maintenance in >20070824.

Will verify in both after the next M-build.
Comment 12 Eric Moffatt CLA 2007-08-31 10:59:55 EDT
*** Bug 197310 has been marked as a duplicate of this bug. ***
Comment 13 Eric Moffatt CLA 2007-09-05 11:17:53 EDT
Verified in  I20070904-0800. Still need to verify the maintenance fix.

Verified by applying the patch to the example -only-, running an inner and chaning a name.
Comment 14 Eric Moffatt CLA 2007-09-06 09:32:45 EDT
Verified in M20070905-1045.