The slim jar probably won't work in an applet, because it does classloader stuff (unless you have a signed applet).
--
Dave
The runtime performance should be the same, but the startup time will be slower because it will have to compile the clojure code at load time.
--
Dave
Any thoughts about difference in performance between "slim" and
"full"?
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?
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