| |
Dinesh Patil's Weblog
Dinesh Patil's Weblog
Thursday August 31, 2006 |
|
GlassFish V2 Lightweight!
Lightweight GlassFish
GlassFish V2 Lightweight
Are you surprised to see the quicker downloads on GlassFish
Installers? from 88MB to 63MB reduction on Windows installers.
OR swifter execution of "maven bootstrap" goal? reduced SNAPSHOT
jar file from 93MB to 66MB (About 30% Compression)
93439767 Aug 30 03:13 glassfish-image-v2-b15-nightly-30_aug_2006.jar
66734581 Aug 31 03:25 glassfish-image-v2-b16-nightly-31_aug_2006.jar
We have added JDK 5.0 JarPack pack200
tool which changes files to highly compressed files that can be
directly deployed, saving bandwidth and reducing download time, and
while configuring the GlassFish images using
setup.xml/setup-cluster.xml files, we call JDK 5.0 Jar Unpacking tool unpack200
which transforms a packed file produced by pack200(1)
into a JAR file.
We use Ant Pack200Task and Unpack200Tasks from java-pack200-ant-task
which is Java.net Open source project by itself to call this
pack/unpack200 JDK tools. Ant users required easy to use Ant tasks for
performance reasons, java-pack200-ant-task project provides the
external ant tasks to use Pack200 API effectively.
Jar packing/unpacking is implemented in setup.xml and setup-cluster.xml
in GlassFish Server images with the java-pack200-ant-tasks as below.
<property name="jarpack-task.jar" value="${install.home}/lib/Pack200Task.jar"/> <target name="jarpack-tasks" > <taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="${jarpack-task.jar}" /> <taskdef name="unpack200" classname="com.sun.tools.apache.ant.pack200.Unpack200Task" classpath="${jarpack-task.jar}" /> </target>
<!-- Target to pack the jars using the Pack200 ant optional task --> <target name="jar-pack" depends="jarpack-tasks"> description="Applying the pack utility on jars"> <mkdir dir="${pack.jar.dir}/normalized" /> <pack200 src="${pack.jar.dir}/${pack.jar.name}" ... </target>
<!-- Target to unpack the jars using the Pack200 ant optional task --> <target name="jar-unpack" depends="jarpack-tasks"> <unpack200 src="${pack.jar.dir}/${pack.jar.name}.pack.gz" ... <target>
During the creation of GlassFish V2 JarInstallers (which only
Release/Build Engineer uses) you will see the messages below, you can
see the packing is done couple of times, it normalizes the jar file and
packs it again to get maximum jar compression.
% cd $ws/glassfish/bootstrap % maven build-jarinstaller [java] glassfish-jarpack: [java] [echo] Applying Pack200 on GlassFish jars using JDK1.5, /ws/publish/glassfish/lib/Pack200Task.jar [java] jar-pack: [java] [pack200] Building: /ws/publish/glassfish/lib/normalized/appserv-rt.jar [java] [pack200] Repack with Pack200 [java] [pack200] Source File :/gf9.1/ws/publish/glassfish/lib/appserv-rt.jar [java] [pack200] Dest. File :/ws/publish/glassfish/lib/normalized/appserv-rt.jar [java] [pack200] Building: /ws/publish/glassfish/lib/normalized/appserv-rt.jar.pack.gz [java] [pack200] Packing with Pack200 [java] [pack200] Source File :/ws/publish/glassfish/lib/normalized/appserv-rt.jar [java] [pack200] Dest. File :/ws/publish/glassfish/lib/normalized/appserv-rt.jar.pack.gz [java] [unpack200] Unpacking with Unpack200 [java] [unpack200] Source File :ws/publish/glassfish/lib/normalized/appserv-rt.jar.pack.gz [java] [unpack200] Dest. File :/ws/publish/glassfish/lib/normalized/a-appserv-rt.jar [java] [pack200] Building: /ws/publish/glassfish/lib/appserv-rt.jar.pack.gz [java] [pack200] Packing with Pack200 [java] [pack200] Source File :/ws/publish/glassfish/lib/normalized/a-appserv-rt.jar [java] [pack200] Dest. File :/ws/publish/glassfish/lib/appserv-rt.jar.pack.gz
When you run GlassFish
configuration step, you will see following messages, same messages
will be printed when you run "maven bootstrap"
% cd $ws/publish/glassfish % ant -f setup-cluster.xml [java] glassfish-jarunpack: [java] [echo] Applying UnPack200 on Packed jars using JDK1.5 [java] [echo] /ws/publish/glassfish/lib/Pack200Task.jar [java] jarpack-tasks: [java] jar-unpack: [java] [unpack200] Unpacking with Unpack200 [java] [unpack200] Source File :/ws/publish/glassfish/lib/appserv-rt.jar.pack.gz [java] [unpack200] Dest. File :/ws/publish/glassfish/lib/appserv-rt.jar [java] [delete] Deleting: /ws/publish/glassfish/lib/appserv-rt.jar.pack.gz
Posted by dpatil
( Aug 31 2006, 11:16:55 AM PDT / Aug 31 2006, 11:20:00 AM PDT )
Permalink
Trackback: http://blogs.sun.com/dpatil/entry/glassfish_v2_lightweight
|
Trackback URL: http://blogs.sun.com/dpatil/entry/glassfish_v2_lightweight
|
| « November 2009 | | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | | | | | | | | | | | | | Today |
Today's Page Hits: 10
|