Clojurians
#cljs-dev
<
2016-03-25
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

darwin22:03:41

I think I have discovered an interesting optimization: https://github.com/darwin/clojurescript/tree/inline-truth When @domkm requested proper dead code elimination in cljs-devtools, I got burnt by the need to explicitly specify (if ^boolean js/goog.DEBUG …) hint to get :closure-defines working under :advanced build[1]. It was unexpected to me that closure compiler cannot see that optimization and does not inline truth test for js/goog.DEBUG “constant”. So I started poking around and found a way how to aggressively inline checked truth checks in a compatible way (I believe). I also believe this could potentially open optimizations in other places. I think we should explore @nosideeffects annotation[2] and tag core functions where appropriate. [1] https://github.com/binaryage/cljs-devtools/releases/tag/v0.5.3 [2] https://developers.google.com/closure/compiler/docs/js-for-compiler?hl=en#tag-nosideeffects