docs: Add benchmark aggregation and display on new Benchmarks page#28
Merged
Conversation
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>
There was a problem hiding this comment.
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
Benchmarkstarget that fetches upstream benchmark data, reduces it to a smaller JSON snapshot, and wiresPagesto depend on it. - Introduces a new
BenchmarkResultReact 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.
vbreuss
enabled auto-merge (squash)
May 3, 2026 09:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Benchmarksbuild target inPipeline/Build.Benchmarks.csthat fetches the latest aweXpect benchmark snapshot from theaweXpect/aweXpectrepository, 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.Pagesbuild target inPipeline/Build.Pages.csto depend on the newBenchmarkstarget, ensuring benchmark data is always up-to-date before building docs..nuke/build.schema.jsonto include the newBenchmarkstarget in the list of executable targets.Frontend Benchmark Visualization
BenchmarkResult(Docs/pages/src/components/BenchmarkResult/index.tsx), which reads from the generatedbenchmarks.jsonand renders a comparison of aweXpect vs FluentAssertions for a given benchmark. It includes trend sparklines, formatted metrics, and commit metadata.Docs/pages/src/components/BenchmarkResult/styles.module.css) to style the benchmark comparison component, including responsive layouts and color-coding for performance trends.