File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 16001600 (every? constant-value? (ast-children ast)))))
16011601
16021602(defn const-expr->constant-value [{:keys [op] :as e}]
1603- (case op
1603+ (case op
16041604 :quote (const-expr->constant-value (:expr e))
16051605 :const (:val e)
16061606 :map (zipmap (map const-expr->constant-value (:keys e))
19261926 {:protocol-impl proto-impl
19271927 :protocol-inline proto-inline})
19281928 methods (map #(disallowing-ns* (analyze-fn-method menv locals % type (nil? name))) meths)
1929- mfa (apply max (map :fixed-arity methods) )
1929+ mfa (transduce (map :fixed-arity ) max 0 methods)
19301930 variadic (boolean (some :variadic? methods))
19311931 locals (if named-fn?
19321932 (update-in locals [name] assoc
Original file line number Diff line number Diff line change 205205 #?(:clj (map? x) :cljs (ana/cljs-map? x)) (emit x)
206206 #?(:clj (seq? x) :cljs (ana/cljs-seq? x)) (apply emits x)
207207 #?(:clj (fn? x) :cljs ^boolean (goog/isFunction x)) (x )
208- :else (let [s (print-str x)]
208+ :else (let [s (cond-> x
209+ (not (string? x)) print-str)]
209210 (when-not (nil? *source-map-data*)
210211 (swap! *source-map-data*
211212 update-in [:gen-col ] #(+ % (count s))))
Original file line number Diff line number Diff line change 1+ (ns cljs.profile
2+ (:require [clojure.java.io :as io]
3+ [cljs.env :as env]
4+ [cljs.analyzer :as ana]
5+ [cljs.compiler :as comp]))
6+
7+ (comment
8+
9+ ; ; ~900ms
10+ (dotimes [_ 20 ]
11+ (time (ana/analyze-file (io/resource " cljs/core.cljs" ))))
12+
13+ ; ; ~2700ms
14+ ; ; after change ~2500
15+ (dotimes [_ 20 ]
16+ (time
17+ (env/with-compiler-env (env/default-compiler-env )
18+ (comp/compile-file (.getPath (io/resource " cljs/core.cljs" )))
19+ (.delete (io/file " src/main/cljs/cljs/core.js" )))))
20+
21+ )
You can’t perform that action at this time.
0 commit comments