Compiler
Hyperbee.Expressions.Compiler is a high-performance, IR-based compiler for .NET expression trees. It is a drop-in replacement for Expression.Compile() that emits IL directly, bypassing the System expression interpreter.
Installation
dotnet add package Hyperbee.Expressions.Compiler
Quick Start
using Hyperbee.Expressions.Compiler;
// Direct replacement for lambda.Compile()
var fn = HyperbeeCompiler.Compile( lambda );
// Or use the IExpressionCompiler interface for DI
services.AddSingleton<IExpressionCompiler>( HyperbeeExpressionCompiler.Instance );
Topics
| Topic | Description |
|---|---|
| Overview | Architecture, compilation pipeline, optimization passes |
| API Reference | HyperbeeCompiler, HyperbeeExpressionCompiler, CompileToMethod |
| Diagnostics | IR capture, CompilerDiagnostics, IRFormatter |
| Performance | Benchmarks vs System compiler and FastExpressionCompiler |
Highlights
- 9-34x faster compilation than the System compiler
- 1.16-1.54x of FastExpressionCompiler (FEC) compilation time
- Up to 50% fewer allocations than the System compiler
- Supports all expression patterns – including those FEC does not support
- Fully compatible with
AsyncBlockExpressionstate machines via ambient context IExpressionCompilerinterface for DI-friendly injection