None of the invocation optimizations make any sense for anything other that
advanced optimization. They hard code static assumptions that might get
invalidated in any compilation unit other than whole program.

We don't need to look at the whole program at once. Think about why we need
declare and most Clojure programs avoid it if they can.

I don't think we need any fancy compiler stuff to fix the two big dead code
issues in the near term.

On Tuesday, October 16, 2012, Herwig Hochleitner wrote:

> 2012/10/16 David Nolen <dnolen.li...@gmail.com <javascript:_e({}, 'cvml',
> '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<javascript:_e({}, 'cvml', 
> '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 <javascript:_e({}, 'cvml',
> 'clojure%2bunsubscr...@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