Equinox p2 Repository Optimization
p2 artifact repositories can hold many different forms of the same artifact. For example, a JAR artifact may exist as
- a canonical (unmolested) JAR
- a compressed JAR (assuming the original was not compressed)
- a pack200 JAR
- a delta relative to another version of the artifact
This document outlines the behavior of p2 in the various scenarios and details how to populate a repository with a optimized forms of artifacts.
Pack200 is a standard part of Java 5. It is a rather radical compression algorithm that is class file aware. It typically results in approximately 70% smaller JARs assuming the JARs are mostly code. Pack200 has no effect on non-class files. Packed JARs can be supplied by the client populating a repository or added after the fact by running the Pack 200 repository optimizer. See the org.eclipse.equinox.p2.artifact.optimizers bundle and the application org.eclipse.equinox.p2.artifact.optimizers.pack200optimizer.
Once the repository has been optimized, any agent pointing at the repository will automatically choose to download the packed form of the artifact if the repository is not local to the agent. In the case of local repositories it is more efficient to simply copy the canonical form if available.
Note that the agent running must have the org.eclipse.equinox.p2.jarprocessor bundle installed and resolved.
- -artifactRepository the URL of the repository to optimize
Class Delta Optimization
When JARs change often only a few classes in them change. The difference between two JARs can then be captured as a set of deletions, replacements and additions. These can themselves be contained in a JAR. That JAR is called a "delta JAR". The delta JAR can itself be packed, signed, ... since it is just a normal JAR.
To be implemented...
Full Delta Optimization