On Tue, Sep 18, 2012 at 9:40 AM, Matt Campbell <mattcampb...@pobox.com> wrote: > When run in advanced mode, the Google Closure Compiler tries to eliminate > dead code. This currently doesn't seem to be very effective for > ClojureScript. A minimal hello-world example currently compiles to 90 KB in > advanced mode. Is this the best that can be done? Is Clojure's dynamism an > insurmountable obstacle at this point? Or does this area just need more > work? > > Matt
Avoid making any assumptions about what advanced compilation can do based on trivial ClojureScript programs. I've heard of several large ClojureScript programs that generate 1.2-1.8 *megabytes* of JavaScript. After advanced compilation and gzipping the applications are around 40k-50k (http://blog.mezeske.com/?p=552). This is pretty impressive given that jQuery, which is pretty standard these days, itself is 32k gzipped. But yes, we can do better and there are some things in ClojureScript that seem to prevent some dead code from being eliminated in small programs. There's an open issue for that though no one has tackled it yet. Note the dead code issue doesn't have much to do with dynamism - rather issues with the generated JS such that Closure doesn't seem to want to remove some unused code. David -- 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