Fork me on GitHub
Christian Johansen22:12:27

Question about advanced optimizations:

Christian Johansen22:12:31

(ns test.core
  (:require [cljs.reader :as reader]))

(defn method1 []
  (js/console.log "Hello"))

(defn method2 []
  (js/console.log (reader/read-string "Hello")))


Christian Johansen22:12:01

this code compiles to 125k, but I had expected it to strip out cljs.reader. Is my expectation wrong?

Christian Johansen22:12:22

If I comment out the require and method2 (which isn't used), this compiles down to 5k


@christian767 It could very well be that there is something inherently not DCE-friendly in cljs.reader. The same thing occurs with cljs.pprint. See