mirror of
https://github.com/penpot/penpot.git
synced 2026-02-12 22:53:02 +00:00
🐛 Fix performance macros disabled in production mode
This commit is contained in:
committed by
Alonso Torres
parent
d933e91c6c
commit
8e8d46b314
@@ -45,13 +45,13 @@
|
||||
|
||||
(defmacro begin-measure
|
||||
[measure-name]
|
||||
(when enabled?
|
||||
(when (enabled?)
|
||||
(let [measure-name (str/concat measure-name "::begin")]
|
||||
`(.mark js/performance ~measure-name))))
|
||||
|
||||
(defmacro end-measure
|
||||
[measure-name & [detail]]
|
||||
(when enabled?
|
||||
(when (enabled?)
|
||||
(let [begin-name (str/concat measure-name "::begin")
|
||||
end-name (str/concat measure-name "::end")
|
||||
detail `(cljs.core/js-obj ~@(mapcat (fn [[k v]] [(name k) v]) detail))
|
||||
@@ -62,7 +62,7 @@
|
||||
(defmacro with-measure
|
||||
"Measures the time of a function call. This should only be called in synchronous functions"
|
||||
[[measure-name detail] body]
|
||||
(if-not enabled?
|
||||
(if-not (enabled?)
|
||||
body
|
||||
`(let [_# (begin-measure ~measure-name)
|
||||
result# ~body
|
||||
|
||||
Reference in New Issue
Block a user