Bug 61369 - [Dialogs] High CPU usage when tying in Open Type dialog
Summary: [Dialogs] High CPU usage when tying in Open Type dialog
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on: 93113
Blocks:
  Show dependency tree
 
Reported: 2004-05-07 07:17 EDT by Dirk Baeumer CLA
Modified: 2006-07-06 19:08 EDT (History)
2 users (show)

See Also:


Attachments
A profiler trace (30.59 KB, image/png)
2004-05-07 07:18 EDT, Dirk Baeumer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-05-07 07:17:43 EDT
I20040505

From bug 61311

If i open the Open TYpe dialog  and i just type D
and then do nothing. The cpu usage of eclipse is going constantly between 50 
and 70%. This seems very strange.

When this happens JDT has already computed the list of types. I created a 
performance trace that I will attach.

The dialog we use is AbstractElementListSelectionDialog from Platform
Comment 1 Dirk Baeumer CLA 2004-05-07 07:18:45 EDT
Created attachment 10388 [details]
A profiler trace
Comment 2 Tod Creasey CLA 2004-05-12 08:17:03 EDT
It looks like it it is the creation of table elements that is taking all of 
the time from your trace (this can be quite expensive for a large list).

Can you give me a rough idea of how many entries D will give in your workspace 
(i.e. will be it be thousands?).
Comment 3 Johan Compagner CLA 2004-05-12 09:01:11 EDT
ahh that's it.
I thought it never ends.. But it does i just have to wait a quite a bit longer 
(at least 20-30 seconds) before it goes down.

So maybe the number of items you are making there should be maximized, until 
you start scrolling? But of course it doesn't make any sense for the list to be 
longer then a few hundred items because nobody is going to scroll through such 
a list in search for one item. 
Comment 4 Tod Creasey CLA 2004-05-12 09:51:58 EDT
This is how we limit the size of the tasks view as well - this is also the 
reason why we open with nothing.

Having said that we stop updating as soon as you type a second letter so if 
the user really want a list that long then we should give it to them. In most 
cases you will type (or select) fast enough to prevent this problem occuring.

I am going to mark this down in priority as there are higher priority 
performance items to focus on and this is not a regression from 2.1 but a long 
standing issue.

Thanks for the feedback guys - this is very helpful.
Comment 5 Tod Creasey CLA 2005-03-07 11:57:20 EST
Adding my name to the cc list as we are now tracking performance issues more
closely. Please remove the performance keyword if this is not a performance bug.
Comment 6 Tod Creasey CLA 2005-04-05 13:22:50 EDT
I'll up this one as there is a fair amount of work going into the TypeDialog
now. We might want to consider making it VIRTUAL as well as it most cases people
will type rather than scroll.
Comment 7 Dirk Baeumer CLA 2005-04-05 13:40:02 EDT
Tod, we should carefully coordinate this effort. I internally implemented a new
version of the open type dialog for JDT/UI which makes use of the virtual table.
However, the main benefit is that the new dialog doesn't require knwoing all the
elements upfront. It directly takes the elements from the search engine and
pipes them into a dialog.

A non polished prototype of the can be seen in the TypeInfoViewer. The new
dialog can be enabled inside OpenTypeAction#run.

Please note, that the code in TypeInfoViewer isn't polished yet. It currently
post every match into the UI thread. However, the user experience isn't bad
right now, except that search doesn't report the matches sorted (but we are
working on this).

Furthermore, the dialog support a history of the last opened elements and camel
case filtering (e.g. OTSD takes you directly to OpenTypeSelectionDialog).
Comment 8 Dirk Baeumer CLA 2005-04-05 13:40:30 EDT
Reassigning to Tod. Pressed the wrong button.
Comment 9 Dirk Baeumer CLA 2005-04-05 13:43:22 EDT
To complete comment #7: the new dialog should allow piping in the results in a
sorted fashion via some callback like the virtual table and should not require
on the fact that all items are known upfront.
Comment 10 Tod Creasey CLA 2005-04-05 13:50:11 EDT
I agree. Let me look at what you did and perhaps propose a patch and get your
feedback - thanks for the pointers.
Comment 11 Tod Creasey CLA 2005-04-27 14:27:20 EDT
Reducing priority as JDT has thier own dialog now
Comment 12 Tod Creasey CLA 2005-04-28 09:33:03 EDT
We can't check this one until Bug 93113 is fixed.
Comment 13 Johan Compagner CLA 2005-04-28 10:12:07 EDT
i have to say that the new open type dialog works great!
It is fast and calculates the things he doesn't have in the background..
Comment 14 Susan McCourt CLA 2006-07-06 19:08:55 EDT
I think we can close this one given the new open type dialog in 3.1.
There are still open issues about using the same code in OpenResource, also, but those are documented in other bugs.

Closing this one.