Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Jars in jars is good citicenship?

John Arthorne wrote:

Thomas Hallgren wrote on 11/06/2007 02:33:33 AM:
> John Arthorne wrote:
> > Well, it really depends on the situation. If a plugin contains a
> > nested jar, plus thousands of other files, there is certainly
> > performance gain in install time, disk space, etc, from jarring. The
> > benefit of jarring tends to accumulate over a large body of plugins -
> > it might be a small gain for a single plugin, but for an application
> > with a 1000 plugins, it adds up.
>
> In practice, I doubt that nested jars will ever be an optimization. If
> you have a high number of plug-ins with nested jars and if most of them
> has a large number of files outside of the jars, then yes, the space
> gained by compressing might be significant. But is it always favorable?
> Will we ever see an application assembled that way?

I didn't say it's always favorable, I said it depends on the situation. Since you doubt that nested jars will ever be an optimization, I give you just one example from the Eclipse SDK. The org.eclipse.platform.doc.isv plugin, which contains a nested JAR, consumes 28,930,048 bytes (27.5 MB) of disk space. When I unzip this JAR, it consumes 181,501,952 bytes (173 MB) of disk space. Disk space may be cheap, but I still consider this to be an important optimization.

This plug-in illustrates the problem with the current recommendation. It has one jar (activeHelpSample.jar) that is on the bundle classpath. Other projects will run into problems when they reference the classes contained in that jar when the plug-in is jar'ed.

I might miss some subtle point here but the way I see it, the nesting is unnecessary. You can either unpack the activeHelpSample.jar into a folder that extends from the root of the bundle (i.e. create a normal plug-in, jar'ed but not nested) or create a non jar'ed plug-in that would contain an additional compressed archive with most of the other files. Either way, nesting would not be used but the optimization would still be there.

- thomas



Back to the top