Bug 474803 - Hang in OSGi frameworks preference page
Summary: Hang in OSGi frameworks preference page
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All iOS
: P3 normal (vote)
Target Milestone: 4.6 M4   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 482576
  Show dependency tree
 
Reported: 2015-08-12 09:34 EDT by Alex Blewitt CLA
Modified: 2015-12-08 00:50 EST (History)
1 user (show)

See Also:


Attachments
Fix for this issue (1.93 KB, patch)
2015-11-05 06:23 EST, Vikas Chandra CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2015-08-12 09:34:30 EDT
The OSGi frameworks preference page (under plug-in development) hangs for 5+s for me when I navigate to it for the first time. It looks like it's doing some kind of scan on extension points or file system on the first go and then caching those results. 


After restarting eclipse the same delay is seen, so it looks like it's building up a transient view of something.
Comment 1 Alex Blewitt CLA 2015-08-12 09:42:20 EDT
The delay seems to be coming from the final IPluginExtensionPoint point = call in the fourth line of the createContents method of OSGiFrameworkPreferencePage
Comment 2 Alex Blewitt CLA 2015-08-12 09:52:41 EDT
Looks like the delay is coming from the creation of the pderegistry. The PDERegistry.getRegistry is instantiated on demand and it's the createRegistry call that's taking the time. 

If the PDE bundle is started it probably makes sense to create the registry then as opposed to first use, especially if that's triggered by the UI.
Comment 3 Alex Blewitt CLA 2015-08-12 11:05:06 EDT
Single stepping through the code, PDERegistry.getContributionsTimestamp() is taking a long time because of the fPDETegistry.getModels() call, which is returning a 1000+ array of models and getting an exclusive or of the lastModified dates of the files and hash codes. 

In a runtime debug instance of eclipse (with a reused workspace/configuration) I couldn't get the PDE registry to save anything, in which case it always recreated the models anyway. If it's doing that then returning the current time might be just as effective.
Comment 4 Alex Blewitt CLA 2015-08-12 11:12:38 EDT
Note: on this instance the localfile_1_0_0.dll wasn't load able because of security reasons (unable to load dlls through writable/workspace path). I don't think it's related because I can't see the extension registry using the LocalFile API from the eclipse file systems but mention it here for reference.
Comment 5 Alex Blewitt CLA 2015-08-12 13:28:55 EDT
There's also a small delay due to the PDEImages being loaded and several hundred File lookups for icons. That's probably a separate issue though.
Comment 6 Vikas Chandra CLA 2015-11-05 06:23:47 EST
Created attachment 257750 [details]
Fix for this issue
Comment 7 Vikas Chandra CLA 2015-11-05 06:26:57 EST
The PDE models are loaded "only" to decide whether or not to put a hyperlink ( if any) in the text in OSGi frameworks preference page. I think this is an overkill.

Only when  PDE models are loaded, we should provide try to put hyperlink in the text.
Comment 8 Vikas Chandra CLA 2015-11-30 04:17:58 EST
Based on previous comment, fixed using 

https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=a2139e58a2af0ef4c08d7f5bbf26bcf91d3d6604
Comment 9 Vikas Chandra CLA 2015-12-08 00:50:18 EST
verified on

Version: Neon (4.6)
Build id: I20151207-0800