Overview of Mediator performance and features
mainMediator is a high-performance .NET implementation of the Mediator pattern that uses source generators instead of reflection.
Key features include:
- Native AOT Support: Full support without reflection or runtime code generation, making it ideal for serverless, edge, and mobile environments.
- Build-time Safety: The source generator emits diagnostics (warnings/errors) during development if handlers are missing or configuration is incorrect, preventing runtime errors.
- High Performance: Uses monomorphized
Sendmethods and fast dictionary lookups. For maximum performance, use the concreteMediatorclass instead of theIMediatorinterface. - Low Cold Start: Optimized for fast startup times.