• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To Cay and Gary: Pack Transfer Format

 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 284
35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic