Skip to content

docs: Add benchmark aggregation and display on new Benchmarks page#28

Merged
vbreuss merged 3 commits into
mainfrom
feat/awexpect-benchmarks
May 3, 2026
Merged

docs: Add benchmark aggregation and display on new Benchmarks page#28
vbreuss merged 3 commits into
mainfrom
feat/awexpect-benchmarks

Conversation

@vbreuss

@vbreuss vbreuss commented May 3, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new automated pipeline for fetching, processing, and displaying aweXpect benchmark results in the documentation site. The main change is the addition of a build target that retrieves benchmark data from the aweXpect repository, reduces it to a compact JSON format, and makes it available to a new React component for rendering benchmark comparisons. The PR also includes a new styled component for visualizing these benchmarks and updates the build schema and dependencies accordingly.

Automated Benchmark Data Pipeline

  • Added a new Benchmarks build target in Pipeline/Build.Benchmarks.cs that fetches the latest aweXpect benchmark snapshot from the aweXpect/aweXpect repository, processes the data, and writes a reduced JSON file (benchmarks.json) for use in documentation. This includes robust parsing, error handling, and shaping of the data for frontend consumption.
  • Updated the Pages build target in Pipeline/Build.Pages.cs to depend on the new Benchmarks target, ensuring benchmark data is always up-to-date before building docs.
  • Extended .nuke/build.schema.json to include the new Benchmarks target in the list of executable targets.

Frontend Benchmark Visualization

  • Added a new React component, BenchmarkResult (Docs/pages/src/components/BenchmarkResult/index.tsx), which reads from the generated benchmarks.json and renders a comparison of aweXpect vs FluentAssertions for a given benchmark. It includes trend sparklines, formatted metrics, and commit metadata.
  • Introduced a new CSS module (Docs/pages/src/components/BenchmarkResult/styles.module.css) to style the benchmark comparison component, including responsive layouts and color-coding for performance trends.

vbreuss and others added 2 commits May 3, 2026 09:45
Adds a build-time fetch of the latest aweXpect benchmark numbers from the
long-lived benchmarks branch on aweXpect/aweXpect, and renders them on the
new "Benchmarks" page contributed by the matching aweXpect change.

- Pipeline/Build.Benchmarks.cs: new Nuke target that downloads
  Docs/pages/static/js/limited-data.js from the benchmarks branch, strips
  the Chart.js prefix, picks the latest commit's metadata, and reduces
  every benchmark group to {timeNs, memoryBytes, history[16]} per library.
  Output lands at Docs/pages/src/data/awexpect/benchmarks.json so it can
  be consumed as a build-time JSON import.
- Pipeline/Build.Pages.cs: Pages now DependsOn(Benchmarks) so the existing
  pages.yml workflow refreshes the snapshot alongside the doc aggregation.
- Docs/pages/src/components/BenchmarkResult: small React component used by
  the new Benchmarks .mdx in aweXpect. Renders two metric rows (time,
  memory) with comparison bars, a +/- delta, and a 100x16 SVG sparkline of
  the last 16 datapoints. The sparkline hides below 1200 px viewport so
  the value column keeps its space when sidebar+TOC are visible.
- Docs/pages/src/data/awexpect/benchmarks.json: snapshot committed so the
  page renders on a fresh checkout without requiring the build target to
  run first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Benchmarks Nuke target regenerates Docs/pages/src/data/awexpect/benchmarks.json
on every Pages run, so it follows the same convention as the other aggregated
content under Docs/pages/docs/* — owned by the build target, not the repo.

Removed from the index but left on disk so existing local checkouts continue
to work without re-running the Nuke target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vbreuss vbreuss self-assigned this May 3, 2026
@vbreuss vbreuss added the documentation Improvements or additions to documentation label May 3, 2026
@vbreuss
vbreuss requested a review from Copilot May 3, 2026 09:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a benchmark-data ingestion step to the docs build and introduces a reusable BenchmarkResult component intended to render aweXpect vs FluentAssertions benchmark snapshots on the Docusaurus site.

Changes:

  • Adds a new Nuke Benchmarks target that fetches upstream benchmark data, reduces it to a smaller JSON snapshot, and wires Pages to depend on it.
  • Introduces a new BenchmarkResult React component plus CSS for rendering time/memory comparisons and trend sparklines.
  • Updates build metadata to recognize the new target and ignores the generated benchmark snapshot file.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Pipeline/Build.Pages.cs Makes the docs aggregation target depend on benchmark snapshot generation.
Pipeline/Build.Benchmarks.cs Adds benchmark fetch, reduction, and JSON output logic for the docs site.
Docs/pages/src/components/BenchmarkResult/styles.module.css Styles the benchmark comparison widget and its responsive layout.
Docs/pages/src/components/BenchmarkResult/index.tsx Renders benchmark metrics, deltas, sparklines, and snapshot metadata.
.nuke/build.schema.json Registers the new Benchmarks target in the generated build schema.
.gitignore Excludes the generated benchmark snapshot JSON from source control.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Docs/pages/src/components/BenchmarkResult/index.tsx
Comment thread Docs/pages/src/components/BenchmarkResult/index.tsx
Comment thread Docs/pages/src/components/BenchmarkResult/index.tsx Outdated
Comment thread Pipeline/Build.Benchmarks.cs Outdated
Comment thread Pipeline/Build.Pages.cs
@vbreuss
vbreuss enabled auto-merge (squash) May 3, 2026 09:16
@vbreuss
vbreuss merged commit 5870e18 into main May 3, 2026
2 checks passed
@vbreuss
vbreuss deleted the feat/awexpect-benchmarks branch May 3, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants