Mainly cosmetic and performance improvements on shape render.

This commit is contained in:
Andrey Antukh 2020-12-21 13:42:10 +01:00 committed by Alonso Torres
parent a3c583af1d
commit c5f4ae2242
6 changed files with 80 additions and 67 deletions

View file

@ -27,16 +27,6 @@
;; percentiles of render time measures. The log function is
;; automatically debouced for avod excesive spam to the console.
;; #?(:clj
;; (defmacro with-measure
;; [name & body]
;; `(let [start# (js/performance.now)
;; res# (do ~@body)
;; end# (js/performance.now)
;; time# (.toFixed (- end# start#) 2)]
;; (println (str "[perf|" ~name "] => " time#))
;; res#)))
(defn tdigest
[]
(specify! (td/TDigest.)
@ -111,7 +101,7 @@
(mf/deps label)
#(on-render-factory label))]
(if enabled?
[:> react/Profiler {:id label
:on-render on-render}
[:> react/Profiler #js {:id label
:onRender on-render}
children]
children)))