Skip to content

docs: add benchmarks page after comparison#763

Merged
vbreuss merged 1 commit into
mainfrom
feat/benchmarks-doc-page
May 3, 2026
Merged

docs: add benchmarks page after comparison#763
vbreuss merged 1 commit into
mainfrom
feat/benchmarks-doc-page

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 3, 2026

Adds 09-benchmarks.mdx — a tabbed page showing the per-scenario Mockolate-vs-other-libraries snapshot rendered by Testably.Site's MockolateBenchmarkResult component. Renumbers the existing complete-example page from 09 to 10 to make room.

The page covers the six benchmark scenarios (CreateMock, Method, Property, Indexer, Event, Callback) with code samples for the Mockolate path, methodology notes, and a link to each benchmark source file. Benchmarks parameterised with [Params(1, 10)] surface inline N=1 / N=10 tabs.

Also fixes the stale 09-complete-example.md link in 00-index.md to match the renumber.

@vbreuss vbreuss self-assigned this May 3, 2026
Copilot AI review requested due to automatic review settings May 3, 2026 13:15
@vbreuss vbreuss added the documentation Improvements or additions to documentation label May 3, 2026
Adds 09-benchmarks.mdx — a tabbed page showing the per-scenario
Mockolate-vs-other-libraries snapshot rendered by Testably.Site's
MockolateBenchmarkResult component. Renumbers the existing
complete-example page from 09 to 10 to make room.

The page covers the six benchmark scenarios (CreateMock, Method,
Property, Indexer, Event, Callback) with code samples for the
Mockolate path, methodology notes, and a link to each benchmark
source file. Benchmarks parameterised with [Params(1, 10)] surface
inline N=1 / N=10 tabs.

Also fixes the stale 09-complete-example.md link in 00-index.md to
match the renumber.
@vbreuss vbreuss force-pushed the feat/benchmarks-doc-page branch from 5ffeff1 to fb47cab Compare May 3, 2026 13:16
@vbreuss vbreuss merged commit 33d936c into main May 3, 2026
13 checks passed
@vbreuss vbreuss deleted the feat/benchmarks-doc-page branch May 3, 2026 13:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new documentation page to present Mockolate’s benchmark results (rendered via the docs site component) and adjusts the docs ordering/links to accommodate it.

Changes:

  • Added a new Benchmarks MDX page with scenario tabs and links to benchmark source files.
  • Renumbered/introduced the “complete example” page as 10-complete-example.md.
  • Updated the docs index to link to the renumbered complete example page.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
Docs/pages/09-benchmarks.mdx New tabbed benchmarks page with methodology notes, code samples, and source links.
Docs/pages/10-complete-example.md “Complete example” documentation page placed after the new benchmarks page.
Docs/pages/00-index.md Fixes the complete-example link to point to 10-complete-example.md.

Comment on lines +10 to +16
These benchmarks measure Mockolate's runtime overhead against
[Moq](https://github.com/devlooped/moq),
[NSubstitute](https://nsubstitute.github.io/),
[FakeItEasy](https://fakeiteasy.github.io/),
[TUnit.Mocks](https://github.com/thomhurst/TUnit/) and
[Imposter](https://github.com/themidnightgospel/Imposter) for the same end-to-end mocking flow.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 3, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 3.69GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 63.92 ns 1.173 ns 1.097 ns 1.27 440 B 1.00
Mockolate 50.20 ns 0.242 ns 0.215 ns 1.00 440 B 1.00
Imposter 213.24 ns 1.488 ns 1.392 ns 4.25 2248 B 5.11
TUnitMocks 33.35 ns 0.145 ns 0.136 ns 0.66 224 B 0.51
Moq 1,019.91 ns 3.743 ns 3.501 ns 20.32 2096 B 4.76
NSubstitute 1,389.47 ns 2.824 ns 2.504 ns 27.68 5048 B 11.47
FakeItEasy 1,322.90 ns 2.958 ns 2.470 ns 26.35 2763 B 6.28
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.87GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 307.2 ns 2.62 ns 2.32 ns 0.95 1.78 KB 1.00
Mockolate 324.6 ns 6.76 ns 6.33 ns 1.00 1.78 KB 1.00
Imposter 1,355.0 ns 23.46 ns 21.95 ns 4.18 8.8 KB 4.94
TUnitMocks 178.6 ns 3.61 ns 3.38 ns 0.55 1.37 KB 0.77
Moq 14,308.8 ns 88.06 ns 78.06 ns 44.10 12.51 KB 7.02
NSubstitute 5,432.9 ns 173.97 ns 162.73 ns 16.75 9.05 KB 5.08
FakeItEasy 231,625.1 ns 1,499.54 ns 1,402.67 ns 713.92 15.26 KB 8.57
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.84GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 905.4 ns 7.24 ns 6.42 ns 1.02 3.81 KB 1.00
Mockolate 1 888.8 ns 8.31 ns 7.77 ns 1.00 3.81 KB 1.00
Imposter 1 884.5 ns 1.50 ns 1.40 ns 1.00 5.16 KB 1.35
Moq 1 217,755.2 ns 1,813.66 ns 1,696.50 ns 245.03 20.37 KB 5.34
NSubstitute 1 8,945.8 ns 19.83 ns 17.58 ns 10.07 12.84 KB 3.37
FakeItEasy 1 11,687.2 ns 74.42 ns 69.61 ns 13.15 13.63 KB 3.57
baseline* 10 2,486.7 ns 18.12 ns 16.95 ns 0.99 4.87 KB 1.00
Mockolate 10 2,524.1 ns 1.58 ns 1.24 ns 1.00 4.87 KB 1.00
Imposter 10 2,093.8 ns 5.77 ns 5.40 ns 0.83 7.97 KB 1.64
Moq 10 229,177.7 ns 901.80 ns 843.55 ns 90.80 29.89 KB 6.14
NSubstitute 10 21,947.7 ns 72.84 ns 68.14 ns 8.70 25.63 KB 5.27
FakeItEasy 10 24,130.6 ns 50.96 ns 45.17 ns 9.56 32.97 KB 6.77
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 367.7 ns 4.18 ns 3.49 ns 1.04 2.04 KB 1.00
Mockolate 1 354.7 ns 4.67 ns 4.36 ns 1.00 2.04 KB 1.00
Imposter 1 552.0 ns 5.96 ns 5.28 ns 1.56 4.04 KB 1.98
TUnitMocks 1 652.3 ns 4.41 ns 4.13 ns 1.84 2.9 KB 1.42
Moq 1 184,687.3 ns 957.45 ns 848.75 ns 520.82 14.58 KB 7.15
NSubstitute 1 5,731.4 ns 33.08 ns 29.32 ns 16.16 9.06 KB 4.44
FakeItEasy 1 6,046.5 ns 25.59 ns 23.94 ns 17.05 8.05 KB 3.95
baseline* 10 781.6 ns 11.34 ns 10.61 ns 1.18 2.25 KB 1.00
Mockolate 10 664.5 ns 2.69 ns 2.38 ns 1.00 2.25 KB 1.00
Imposter 10 1,128.5 ns 5.35 ns 4.74 ns 1.70 5.52 KB 2.45
TUnitMocks 10 1,668.5 ns 12.90 ns 12.07 ns 2.51 4.49 KB 2.00
Moq 10 190,311.0 ns 586.59 ns 489.83 ns 286.41 18.48 KB 8.21
NSubstitute 10 8,564.0 ns 42.57 ns 35.55 ns 12.89 11.52 KB 5.12
FakeItEasy 10 9,309.5 ns 35.36 ns 31.34 ns 14.01 15.42 KB 6.85
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 411.9 ns 2.95 ns 2.46 ns 0.81 2.46 KB 1.00
Mockolate 1 507.8 ns 4.77 ns 4.23 ns 1.00 2.46 KB 1.00
Imposter 1 441.5 ns 7.97 ns 7.45 ns 0.87 3.13 KB 1.27
TUnitMocks 1 702.7 ns 7.15 ns 6.34 ns 1.38 2.51 KB 1.02
Moq 1 11,898.2 ns 98.63 ns 92.26 ns 23.43 10.39 KB 4.22
NSubstitute 1 7,512.0 ns 66.53 ns 62.24 ns 14.79 11.45 KB 4.65
FakeItEasy 1 8,278.0 ns 89.89 ns 84.09 ns 16.30 11.24 KB 4.57
baseline* 10 796.0 ns 2.58 ns 2.29 ns 0.75 2.95 KB 1.00
Mockolate 10 1,065.5 ns 25.46 ns 23.81 ns 1.00 2.95 KB 1.00
Imposter 10 1,062.3 ns 9.83 ns 8.21 ns 1.00 4.67 KB 1.58
TUnitMocks 10 2,082.6 ns 12.27 ns 10.24 ns 1.96 4.66 KB 1.58
Moq 10 18,924.5 ns 106.47 ns 99.59 ns 17.77 18.28 KB 6.19
NSubstitute 10 16,896.4 ns 57.32 ns 47.86 ns 15.86 21.08 KB 7.14
FakeItEasy 10 19,459.6 ns 139.68 ns 116.64 ns 18.27 30.81 KB 10.43
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.203
[Host] : .NET 10.0.7 (10.0.7, 10.0.726.21808), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 356.5 ns 3.19 ns 2.66 ns 1.14 1.68 KB 1.00
Mockolate 311.9 ns 2.33 ns 2.18 ns 1.00 1.68 KB 1.00
Imposter 402.8 ns 1.96 ns 1.64 ns 1.29 2.38 KB 1.42
TUnitMocks 639.3 ns 9.21 ns 8.62 ns 2.05 2.63 KB 1.56
Moq 72,494.2 ns 643.39 ns 537.26 ns 232.45 8.99 KB 5.35
NSubstitute 4,184.9 ns 14.24 ns 11.89 ns 13.42 7.74 KB 4.61
FakeItEasy 4,391.4 ns 48.81 ns 43.27 ns 14.08 6.81 KB 4.05

baseline* rows show the corresponding Mockolate benchmark from the most recent successful main branch build with results, for regression comparison.

github-actions Bot added a commit that referenced this pull request May 3, 2026
github-actions Bot added a commit that referenced this pull request May 3, 2026
@github-actions
Copy link
Copy Markdown

This is addressed in release v3.2.0.

@github-actions github-actions Bot added the state: released The issue is released label May 11, 2026
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 state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants