File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1600
1600
(every? constant-value? (ast-children ast)))))
1601
1601
1602
1602
(defn const-expr->constant-value [{:keys [op] :as e}]
1603
- (case op
1603
+ (case op
1604
1604
:quote (const-expr->constant-value (:expr e))
1605
1605
:const (:val e)
1606
1606
:map (zipmap (map const-expr->constant-value (:keys e))
1926
1926
{:protocol-impl proto-impl
1927
1927
:protocol-inline proto-inline})
1928
1928
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)
1930
1930
variadic (boolean (some :variadic? methods))
1931
1931
locals (if named-fn?
1932
1932
(update-in locals [name] assoc
Original file line number Diff line number Diff line change 205
205
#?(:clj (map? x) :cljs (ana/cljs-map? x)) (emit x)
206
206
#?(:clj (seq? x) :cljs (ana/cljs-seq? x)) (apply emits x)
207
207
#?(: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)]
209
210
(when-not (nil? *source-map-data*)
210
211
(swap! *source-map-data*
211
212
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