0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -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. "Resolves references and math expressions using StyleDictionary.
Returns a promise with the resolved dictionary." Returns a promise with the resolved dictionary."
[tokens & {:keys [debug?] :as config}] [tokens & {:keys [debug?] :as config}]
(let [#_#_performance-start (js/window.performance.now) (let [performance-start (js/performance.now)
sd (tokens->style-dictionary+ tokens config)] sd (tokens->style-dictionary+ tokens config)]
(when debug? (when debug?
(js/console.log "StyleDictionary" sd)) (js/console.log "StyleDictionary" sd))
@ -61,12 +61,12 @@
(.buildAllPlatforms "json") (.buildAllPlatforms "json")
(.catch js/console.error) (.catch js/console.error)
(.then (fn [^js resp] (.then (fn [^js resp]
(let [#_#_performance-end (js/window.performance.now) (let [performance-end (js/performance.now)
#_#_duration-ms (- performance-end performance-start) duration-ms (- performance-end performance-start)
resolved-tokens (.-allTokens resp)] resolved-tokens (.-allTokens resp)]
#_(when debug? (when debug?
(js/console.log "Time elapsed" duration-ms "ms") (js/console.log "Time elapsed" duration-ms "ms")
(js/console.log "Resolved tokens" resolved-tokens)) (js/console.log "Resolved tokens" resolved-tokens))
resolved-tokens)))))) resolved-tokens))))))
(defn humanize-errors [{:keys [errors value] :as _token}] (defn humanize-errors [{:keys [errors value] :as _token}]