0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00

Restore performance measuring lines

This commit is contained in:
Florian Schroedl 2024-07-04 16:03:32 +02:00
parent 4a329a6318
commit 4fc7efd3b7

View file

@ -53,7 +53,7 @@
"Resolves references and math expressions using StyleDictionary.
Returns a promise with the resolved dictionary."
[tokens & {:keys [debug?] :as config}]
(let [#_#_performance-start (js/window.performance.now)
(let [performance-start (js/performance.now)
sd (tokens->style-dictionary+ tokens config)]
(when debug?
(js/console.log "StyleDictionary" sd))
@ -61,12 +61,12 @@
(.buildAllPlatforms "json")
(.catch js/console.error)
(.then (fn [^js resp]
(let [#_#_performance-end (js/window.performance.now)
#_#_duration-ms (- performance-end performance-start)
(let [performance-end (js/performance.now)
duration-ms (- performance-end performance-start)
resolved-tokens (.-allTokens resp)]
#_(when debug?
(js/console.log "Time elapsed" duration-ms "ms")
(js/console.log "Resolved tokens" resolved-tokens))
(when debug?
(js/console.log "Time elapsed" duration-ms "ms")
(js/console.log "Resolved tokens" resolved-tokens))
resolved-tokens))))))
(defn humanize-errors [{:keys [errors value] :as _token}]