Compressing class files in the module library

Chris Hegarty chris.hegarty at oracle.com
Thu Nov 10 03:49:08 PST 2011


On 09/11/2011 18:21, Alan Bateman wrote:
>
> I have an initial patch [1] to compress the classes of modules in the
> module library. It essentially adds an option to "jmod create" so that
> the classes of any modules installed into the library get compressed.
> The patch also adds a build option to enable compression in the system
> libraries of the images that the build generates.

Wow, this look good.

So we will always be creating module library images that use compression 
when we build. Do we need an option or environment variable to override 
this? I'm just wondering if you could see a scenario where compression 
wouldn't be desirable by default.

> Before finishing this I'd like to get some input on a few points. The
> first is whether it's reasonable to enable compression when creating the
> module library? The alternative is install time so that it's on a per
> module basis. The former is less flexible but as the module library
> format evolves it may not be feasible to have a mix of compressed and
> uncompressed modules.

I do like the idea of being able to select this type of compression on a 
per module basis at install time ( lesser used modules could be 
compressed, while more startup performance sensitive ones may not ). But 
I do understand your reasoning about the evolution of the module library 
format. And this approach does not preclude the possibility of adding 
per module compression to an uncompressed library in the future.

> The other question is suggestions for the option name. For now it's -9
> or --enable-compression (-9 influenced by the zip -9 option for compress
> better). I'm looking for better suggestions.

I understand the reasoning behind the option name -9 'compress better', 
from the module library point of view, but this gives the impression 
that the level of compression can be selected -0 -> -9 ( or that it is 
using the best compression available) when really I don't think it can 
be, right? The pack200 API doesn't seem to give this fine grain level of 
control over the compression level (or maybe I just missed it), which 
would be nice.

-Chris.

>
> Thanks,
>
> -Alan.
>
> [1] http://cr.openjdk.java.net/~alanb/ModuleLibraryCompression/webrev/



More information about the jigsaw-dev mailing list