This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Cay and Gary: Pack Transfer Format

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cay and Gary,

I wonder why we need to have our own Pack Transfer Format instead of making use of the existing compression techniques, like ZIP/JAR, etc.

In JSR 200, it mentioned that this is because the JVM is too large that people is difficult to download it, and they using the pack format to reduce the size. However, does this format only useful for bytecode, while other compression algorithms do not really help?

Nick
 
Cay Horstmann
author
Ranch Hand
Posts: 137
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zip/gzip are general-purpose compression formats that perform well on a wide variety of data. Occasionally, someone comes up with a better compression algorithm that wrings out a few extra percent, but most people don't bother switching.

Pack200 is different. It is optimized for Java class files. For class files, it can achieve dramatically better compression than zip/gzip. According to http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/pack200.html#pack200_compression,
"One can expect compression to 1/9 the size of the JAR file, if it contains only class files and is in the order of several MB." I tried this out with a couple of examples, and indeed, the results were excellent.

However, if you use Pack200 for other formats, such as image files, the result would not be impressive.

What's not to like about Pack200? Since older JVMs don't know about it, you either have to make sure that all users of your applet/web start app have 5.0, or you have to rig the server to serve up either a traditional JAR or a Pack200-compressed one. See the above link for details.

Cheers,

Cay
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

However, if you use Pack200 for other formats, such as image files, the result would not be impressive.

Even image files could not be benefit much, for Web applications with large image files, pack still help a lot, isnt it? Or we should use the traditional WAR file?

Nick
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

you have to rig the server to serve up either a traditional JAR or a Pack200-compressed one

However, so far as I know, the latest release of WAS (should be 6.0) would be based on J2EE 1.4, and hence, we might still need to wait for a long time for J2EE Tiger released together with WAS 7.0, say , in order to *enjoy* this new compression feature.

Nick
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic