Community
Participate
Working Groups
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.
mvm I am assigning to you as I am not sure who owns editors now.
Andrew, perhaps you can investigate what is actually happening here first, as you were recently looking into openEditors etc...
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.
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 ***