You might want to give Pack200 a try; it's a Java classfile-aware compression 
algorithm that can produce jars that are far more compact than e.g. if you were 
to only gzip applet jars on their way out to your users.  Lots of info about it 
if you feel like googling.

Using a build from the current HEAD of Clojure, this:

        pack200 clojure-1.3.0.pack.gz clojure-1.3.0-master-SNAPSHOT.jar

results in decent savings:

-rw-r--r--  1 chas  chas   835K Aug 26 22:57 
clojure-1.3.0-master-SNAPSHOT-slim.jar
-rw-r--r--  1 chas  chas   3.2M Aug 26 22:57 clojure-1.3.0-master-SNAPSHOT.jar
-rw-r--r--  1 chas  chas   1.3M Aug 26 22:59 clojure-1.3.0.pack.gz

So, pack200 won't get you down to the slim jar's 835K, but it will shave off 
~60%, and shouldn't impact startup time at all.  Whether that's a good tradeoff 
is up to you. :-)

- Chas

On Aug 25, 2011, at 4:26 AM, Terje Dahl wrote:

> My company (read: I) develop an web-based educational application (a
> language lab) implemented as a Java applet.
> 
> I have spendt the summer porting it to Clojure.  I am very happy with
> the results.
> 
> Except: The download (and therefore the download-time) has increased
> dramatically, as I now include the clojure.jar as part of the
> download.
> (Actually, I repackage the content together with my application.)
> 
> This, I fear is going to hit alot of the pupils hard, when 20 pupils
> at a time attempt to access the applet for the first time over the
> mediocre (at best) web-connections at their schools.
> 
> Yes, I do manipulate the java applet cache-params.
> But There will always be a need for full downloads - both for first-
> time-users, and when I update the applet (frequently).
> 
> My question:
> Is there anyway to reduce the size of the jar - drastically?
> Can I somehow remove most of the class-files generated from core.clj
> etc, and still have everything working properly?
> Tips/hints/suggestions?
> 
> 
> (Plug: See my open-source JS-embed code for Java applets:
> http://bitbucket.terjedahl.no/terjedahl/appletjs )
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to