mediatorlite-benchmarks

Run BenchmarkDotNet comparisons between MediatorLite and MediatR with pre-configured DI containers.

4|1|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-benchmarks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mediatorlite-benchmarks
Source: https://github.com/behl1anmol/MediatorLite/tree/main/.cursor/skills/mediatorlite-benchmarks
Command: npx skills add https://github.com/behl1anmol/MediatorLite --skill mediatorlite-benchmarks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually setting up fair, apples-to-apples performance comparisons between MediatorLite and MediatR is tedious and error-prone, requiring careful DI container configuration, observability disablement, and BenchmarkDotNet setup to avoid skewed, non-representative results.

Core Features & Use Cases

  • Pre-configured Benchmark Harness: Includes ready-to-run BenchmarkDotNet setup with MemoryDiagnoser, standard warmup/iteration counts, and pre-built DI containers for both MediatorLite and MediatR to ensure test parity.
  • Comprehensive Scenario Coverage: Four pre-built benchmark classes test simple request dispatch, single pipeline behavior, multiple stacked behaviors, and sequential/parallel notification publishing.
  • Use Case: .NET library maintainers can use this skill to validate performance regressions in MediatorLite's source-generated dispatch, or contributors can add new benchmark scenarios for features like streaming or open generic behaviors.

Quick Start

Use the mediatorlite-benchmarks skill to run the full performance benchmark suite and retrieve the latest MediatorLite vs MediatR comparison results.

Frequently Asked Questions about mediatorlite-benchmarks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark MediatorLite performance against MediatR using BenchmarkDotNet?

You can benchmark MediatorLite against MediatR using a pre-configured BenchmarkDotNet harness that ensures DI parity and standard memory diagnosis settings. This setup eliminates manual configuration errors and produces reproducible performance comparison results.

What is the best way to measure .NET mediator library overhead for request dispatch and notifications?

Measuring .NET mediator library overhead requires running four pre-built benchmark scenarios covering simple request dispatch, stacked pipeline behaviors, and sequential or parallel notification publishing. This approach captures source generator dispatch and pipeline overhead accurately.

How does DI container configuration affect MediatR vs MediatorLite performance testing?

DI container configuration affects performance testing by introducing unfair variations if not matched correctly. Using pre-built DI containers for both libraries ensures test parity, while disabling observability prevents skewed, non-representative benchmark results.

Can I use BenchmarkDotNet to validate performance regressions in source-generated dispatch code?

Yes, you can validate performance regressions in source-generated dispatch code by running the benchmark suite. The harness applies standard warmup and iteration counts to provide reproducible measurements for .NET library maintenance workflows.

What scenarios are covered when benchmarking pipeline behaviors and notification publishing in .NET?

Benchmarking pipeline behaviors and notification publishing covers single pipeline behavior, multiple stacked behaviors, and sequential or parallel notification publishing. These scenarios measure the overhead introduced by MediatorLite and MediatR during request execution.