2012/10/16 David Nolen <dnolen.li...@gmail.com> > > ClojureScript programmers benefit from the assumption of whole program > optimization for production code. Also remember we have analyze-file. > > They most certainly do, but in my mind this assumption is only made in the google closure compiler, right now. I see analyze-file is used in the compiler to prepopulate an analysis environment with clojure.core. It still doesn't look at the whole program at once. IMO it wouldn't be a good fit to base optimizations on, since that would hardcode a compilation unit to be a file. Also, you couldn't remove multimethod infrastructure with it, since it would only know about a file at a time.
> If these weren't true ClojureScript would not be anywhere near as fast as > it currently is. Look at all the assumptions we can make when we compile a > fn invocation form under advanced compilation. > > Are you are talking about compile time optimization for invokations of fixed arity, protocols, keywords and clojure.core/not, by chance? Those are fine optimizations, but they don't depend on WPO or advanced mode. In my mental model, the cljs compiler generates the same intermediate javascript in all optimization levels. I have looked at cljs.analyzer/parse-invoke and cljs.compiler/emit :invoke but couldn't find any different code paths. Am I missing something? -- 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