mirror of
https://github.com/penpot/penpot.git
synced 2026-11-17 07:30:35 +00:00
Add a CLI under frontend/performance/benches/render_wasm that builds the renderer, runs seeded scenes (rects, plus, paths, masks) in headless Chromium and saves per-case timings. - build, run: prepare or reuse builds; measure cases with warmups, repetitions, deadlines - ab: build and compare Cargo feature configurations - compare, merge: median changes with bootstrap CIs between saved runs, guarded by scene, build and settings checks - purge: delete managed builds, runs or comparisons - GPU runs through `run-devenv --gpu` Lint, format and pnpm scripts now cover performance/ and its tests. AI-assisted-by: gpt-6.1-sol, deepseek-flash, muse-spark, glm-5.3, gpt6-astra, claude-5.5-sonnet, claude-haiku-5.5
37 lines
1.3 KiB
Clojure
37 lines
1.3 KiB
Clojure
;; This Source Code Form is subject to the terms of the Mozilla Public
|
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
;;
|
|
;; Copyright (c) KALEIDOS SUBSIDIARY SL
|
|
|
|
(ns benches.render-wasm.identity
|
|
"Build identity shared by the isolated Node catalog and browser bundle."
|
|
#?(:cljs (:require-macros [benches.render-wasm.identity :refer [compiled-profile-marks]]))
|
|
#?(:clj (:require [app.render-wasm.performance :as performance])))
|
|
|
|
#?(:clj
|
|
(defmacro compiled-profile-marks
|
|
"Captures the profiling switch used by renderer macros in this compiler."
|
|
[]
|
|
(performance/enabled?)))
|
|
|
|
#?(:cljs
|
|
(do
|
|
(goog-define build-id "unprepared")
|
|
|
|
(defn data
|
|
[]
|
|
{:build-id build-id :cljs-profile-marks (compiled-profile-marks)})
|
|
|
|
(defn check
|
|
"Checks a loaded bundle's identity against the selected build."
|
|
[expected-id actual]
|
|
(when-not (and (map? actual)
|
|
(string? (:build-id actual))
|
|
(= expected-id (:build-id actual)))
|
|
(throw (ex-info "renderer build identity mismatch"
|
|
{:type ::mismatch
|
|
:expected-id expected-id
|
|
:actual-id (:build-id actual)})))
|
|
actual)))
|