From 8bc4b6dd9b4d3e0742b706d69dc1c760968d919d Mon Sep 17 00:00:00 2001 From: Thomas Korrison Date: Wed, 29 Apr 2026 09:58:26 +0100 Subject: [PATCH] docs: refine benchmark artifacts management and add chart styles/scripts - Updated `.gitignore` to better manage benchmark artifacts, ensuring that necessary files for documentation are included while excluding raw run artifacts. - Introduced `charts.css` and `charts.js` to enhance the visual representation of benchmark results, improving user experience and compliance with security standards. - The new styles and scripts support a structured and responsive layout for displaying benchmark data, facilitating better interpretation of performance metrics. These changes improve the organization of benchmark documentation and enhance the usability of visualized results. --- .gitignore | 21 +- docs/benchmarks/latest/charts.css | 182 +++++++++++ docs/benchmarks/latest/charts.js | 507 ++++++++++++++++++++++++++++++ 3 files changed, 707 insertions(+), 3 deletions(-) create mode 100644 docs/benchmarks/latest/charts.css create mode 100644 docs/benchmarks/latest/charts.js diff --git a/.gitignore b/.gitignore index ea46bb5..00196c8 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,21 @@ out/ .DS_Store /dhat-heap.json -# Benchmark artifacts -docs/benchmarks/latest/ -docs/benchmarks/*/ +# Benchmark artifacts. +# +# `docs/benchmarks//` mixes published Pages assets (which must be +# committed so GitHub Pages can serve them) with raw run artifacts (which +# must not). We exclude *files inside* each version dir, then explicitly +# re-include the five files that `bench-support::render_docs` produces +# and that `charts.html` references at runtime — the page 404s without +# `charts.js` / `charts.css`. +# +# Pattern note: `docs/benchmarks/*/*` (file-level) is required instead of +# `docs/benchmarks/*/` (directory-level) because git refuses to re-include +# files whose parent directory is excluded. +docs/benchmarks/*/* +!docs/benchmarks/*/charts.html +!docs/benchmarks/*/charts.css +!docs/benchmarks/*/charts.js +!docs/benchmarks/*/index.md +!docs/benchmarks/*/results.json diff --git a/docs/benchmarks/latest/charts.css b/docs/benchmarks/latest/charts.css new file mode 100644 index 0000000..5c34ee4 --- /dev/null +++ b/docs/benchmarks/latest/charts.css @@ -0,0 +1,182 @@ +/*! + * charts.css — sibling stylesheet for charts.html. + * Sized to run under `style-src 'self'` with no 'unsafe-inline'. + * + * Coordinated tokens with charts.html: + * - `.no-js #loading { display: none; }` cooperates with the parser- + * blocking inline script in , which strips the `no-js` class + * before paints so JS-enabled users immediately see the + * "Loading…" placeholder. JS-disabled users keep the class and the + *