Bug 58745 - [EditorMgmt] API: batch editor opening
Summary: [EditorMgmt] API: batch editor opening
Status: RESOLVED DUPLICATE of bug 46818
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Andrew Eidsness CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2004-04-15 17:01 EDT by DJ Houghton CLA
Modified: 2004-08-30 16:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2004-04-15 17:01:31 EDT
build i0413:1323

- have the outline view showing
- in the packages view select a lot of Java files with ctrl-click
- hit F3 to open them
- this is very slow (I was opening about 30 files to edit)

I am guessing that for each one it is opening it, trying to update the outline,
doing the syntax high-lighting, then give it focus only to move onto the next
one in the list.

Perhaps new API something like:
   openEditors(String[] names)
would help. The workbench could create reference parts for all the editors
except for the last one in the array which is the one that it draws for real and
gives focus too.
Comment 1 Tod Creasey CLA 2004-04-16 08:30:50 EDT
mvm I am assigning to you as I am not sure who owns editors now.
Comment 2 Michael Van Meekeren CLA 2004-04-16 17:55:39 EDT
Andrew, perhaps you can investigate what is actually happening here first, as 
you were recently looking into openEditors etc...
Comment 3 Andrew Eidsness CLA 2004-08-26 15:13:05 EDT
I've been looking into this, so far the approach doesn't seem to save much time.

I timed how long it takes to open batches of files.  The first time is a bit 
slower than subsequent attempts, I assume because stuff is cached.  The results 
I got for M1 were 16 seconds on the first attempt to open 50 files and 10 
seconds on later attempts to open the same 50 files.

Then I created a batched open method that doesn't send any perspective changed 
events, etc. until after the last file is opened.  After changing all the code 
from the JDT action to the open method I found that the times are pretty much 
the same, a little over 14 seconds on first open and a little over 8 seconds on 
later attempts.

Given that this isn't a common operation and there isn't much gain overall, I 
don't know if its worth adding API to handle this particular case.

I'm going to spend a little more time to see if there is more stuff that can be 
batched.

However, this is a good test case to try to improve the time required to open a 
single file.  Any gains to that will be passes to the batched open as well.
Comment 4 Andrew Eidsness CLA 2004-08-30 16:46:45 EDT
The excessive time to open many editors should be investigated but it doesn't 
look like this approach will be worth the cost of adding API, changing the 
implementation, and changing jdt to call the new API.  Especially when opening 
50 editors is a rare operation.

Bug 46818 tracks some other changes to the openEditor API and implementation.  
I'd like to track this problem there and close this one.  So I'll mark this as a 
duplicate to get the link, even though the topics aren't exactly the same.

*** This bug has been marked as a duplicate of 46818 ***