Bug 160750 - [registry] Unbuffered I/O in ExtensionRegistry#addContribution
Summary: [registry] Unbuffered I/O in ExtensionRegistry#addContribution
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2006-10-12 16:37 EDT by John Arthorne CLA
Modified: 2006-10-23 17:31 EDT (History)
1 user (show)

See Also:


Attachments
Patch (1.16 KB, patch)
2006-10-23 17:17 EDT, Oleg Besedin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2006-10-12 16:37:29 EDT
Build id: I20061003-0800

It appears that unbuferred I/O is going on in ExtensionRegistry.addContribution. It is parsing a manifest from an InputStream obtained from BundleURLConnection.openStream.  This stream should be wrapped in a BufferedInputStream to avoid going to disk on each read from the stream.  Here is a stack trace of the creation of the FileInputStream from which unbuffered reads are occurring:

55	java.io.FileInputStream.<init>(FileInputStream.java:151)
	54	org.eclipse.osgi.framework.util.SecureAction.getFileInputStream(SecureAction.java:99)
	53	org.eclipse.osgi.baseadaptor.bundlefile.FileBundleEntry.getInputStream(FileBundleEntry.java:50)
	52	org.eclipse.osgi.framework.internal.core.BundleURLConnection.connect(BundleURLConnection.java:53)
	51	org.eclipse.osgi.framework.internal.core.BundleURLConnection.getInputStream(BundleURLConnection.java:99)
	50	java.net.URL.openStream(URL.java:1059)
	49	org.eclipse.core.internal.registry.osgi.EclipseBundleListener.addBundle(EclipseBundleListener.java:123)
	48	org.eclipse.core.internal.registry.osgi.EclipseBundleListener.processBundles(EclipseBundleListener.java:79)
Comment 1 Thomas Watson CLA 2006-10-12 17:23:45 EDT
John, do you think it should be the responsibility of the extension registry to do the buffering?

Moving to Equinox-Bundles ... I do not think the bundle URLs provided by the framework should automatically return BufferedInputStreams from openStream.
Comment 2 John Arthorne CLA 2006-10-12 17:29:32 EDT
> I do not think the bundle URLs provided by the framework should automatically 
> return BufferedInputStreams from openStream.

I agree. I just filed this in the wrong place...
Comment 3 Oleg Besedin CLA 2006-10-23 17:17:37 EDT
Created attachment 52560 [details]
Patch

Mini-patch just in case we'll need to return to this.
Comment 4 Oleg Besedin CLA 2006-10-23 17:25:36 EDT
Patch released into CVS Head.

There is no difference in the regular startup performance tests on my computer.

There is no difference in a series of startups run with the "-clean" (again, on my computer).

However, it might make a difference in a very first start of un-initialized Eclipse.
Comment 5 Chris Laffra CLA 2006-10-23 17:31:03 EDT
There may a larger impact in products with >2,000 bundles and -clean.