Miguel de Benito Delgado 756541939a
🔧 Add renderer benchmark runner (#12756)
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
2026-11-12 11:02:34 +01:00

69 lines
2.6 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.node.cli.registry
"Ordered command definitions for parsing, request schemas and help."
(:require
[benches.render-wasm.node.cli.commands.ab :as ab]
[benches.render-wasm.node.cli.commands.build :as build]
[benches.render-wasm.node.cli.commands.compare :as compare]
[benches.render-wasm.node.cli.commands.merge :as merge]
[benches.render-wasm.node.cli.commands.purge :as purge]
[benches.render-wasm.node.cli.commands.run :as run]))
(def commands
[["build" {:usage build/usage
:description build/description
:options build/cli-options
:resolve build/resolve-options
:schema build/schema:options
:check build/check-options}]
["run" {:usage run/usage
:description run/description
:options run/cli-options
:resolve run/resolve-options
:schema run/schema:options
:help-options {:build {:kind :prepare}}
:help-defaults run/get-help-defaults
:check run/check-options}]
["ab" {:usage ab/usage
:description ab/description
:options ab/cli-options
:resolve ab/resolve-options
:schema ab/schema:options
:check ab/check-options}]
["compare" {:usage compare/usage
:description compare/description
:options compare/cli-options
:resolve compare/resolve-options
:schema compare/schema:options}]
["merge" {:usage merge/usage
:description merge/description
:options merge/cli-options
:resolve merge/resolve-options
:schema merge/schema:options}]
["purge" {:usage purge/usage
:description purge/description
:options purge/cli-options
:resolve purge/resolve-options
:schema purge/schema:options}]])
(def command-names (mapv first commands))
(def ^:private definitions (into {} commands))
(defn get-definition
"Returns a command definition, or nil for an unknown command."
[command]
(get definitions command))
(defn check-options
"Checks command policy and returns the resolved options."
[command options]
(if-let [check (:check (get-definition command))]
(check options)
options))