I've merged these changes in master. I've also added another change that
results in yet another large perf boost:

- direct invocation of known fns instead of going through .call

It's now possible to write CLJS that has the exact same performance as
handwritten JS - I compared the handwritten JS spectral norm from Alioth to
one written in CLJS running under Node.js - the CLJS is actually a tad
faster on my machine. This probably due to GClosure.

I also tried zebrao from core.logic. On my machine I consistently see times
just under 30ms in Google Chrome.

David

On Sun, Apr 8, 2012 at 8:59 PM, David Nolen <dnolen.li...@gmail.com> wrote:

> The multi-arity fn optimization was causing some code size explosion. I've
> committed a refactor that eliminates the issue. Please try!
>
> On Sun, Apr 8, 2012 at 6:26 PM, David Nolen <dnolen.li...@gmail.com>wrote:
>
>> I've spend the past weekend doing some comprehensive optimizations to
>> ClojureScript, these can be seen here:
>> https://github.com/clojure/clojurescript/compare/all-optimizations
>>
>> With these optimizations operations are anywhere from 1.5X-5X faster
>> depending on the operation and the JavaScript environment.
>>
>> These optimizations include:
>>
>> * respect boolean type hints on fns
>> * remove CLJS truth tests if we can infer that an if's test expression is
>> boolean - this works for common combinations of and/or
>>   - this removes nearly all truth tests from PersistentVector, big wins
>> here and for other persistent data structures to come
>> * multi-arity fns that are not used higher-order are now dispatched
>> directly to the correct arity instead of using JS arguments
>>   - multi-arity protocol fns also benefit from this optimization
>> * remove all truth tests from protocol dispatch fns
>>
>> Feedback & improvements appreciated. Please try this branch out and let
>> us know if it works for you - especially interested if things are faster,
>> slower or if the changes adversely affect your file sizes under advanced
>> optimization.
>>
>> 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

Reply via email to