Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox p2 Repository Optimization"

(Pack200 Optimization)
Line 11: Line 11:
  
 
== Pack200 Optimization ==
 
== Pack200 Optimization ==
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.repositoryoptimizer''' bundle.
+
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'''.
 
+
That project includes a simple optimizer application that, when pointed at an artifact repository, packs all "plugin" artifacts it can find. There is also a handy launch configuration you can use to run the application.
+
  
 
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.   
 
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.
 
Note that the agent running must have the '''org.eclipse.equinox.p2.jarprocessor''' bundle installed and resolved.
 +
 +
Arguments:
 +
* -artifactRepository the URL of the repository to optimize
  
 
== Class Delta Optimization ==
 
== Class Delta Optimization ==

Revision as of 11:58, 25 January 2008

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 Optimization

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.

Arguments:

  • -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

In-progress...

Back to the top