|
1 | 1 | # Hyperbee Expression Compiler |
2 | 2 |
|
3 | 3 | A high-performance, IR-based expression compiler for .NET. Drop-in replacement for `Expression.Compile()` |
4 | | -that is **9-34x faster and allocates up to 50% less than the System compiler** and supports **all expression tree patterns** — including |
5 | | -those that [FastExpressionCompiler](https://github.com/dadhi/FastExpressionCompiler) doesn't. |
| 4 | +that is **9-34x faster and allocates up to 50% less than the System compiler** and supports **all expression tree patterns**. |
6 | 5 |
|
7 | 6 | ## Why Another Expression Compiler? |
8 | 7 |
|
9 | | -We :heart: [FastExpressionCompiler](https://github.com/dadhi/FastExpressionCompiler). FEC is faster than Hyperbee Expression Compiler, and allocates less memory — and for many workloads it's the right choice. If FEC compiles your expressions correctly, use it. |
| 8 | +We :heart: [FastExpressionCompiler](https://github.com/dadhi/FastExpressionCompiler). FEC is faster than Hyperbee Expression Compiler, and allocates less memory - and for many workloads it's the right choice. If FEC compiles your expressions correctly, use it. |
10 | 9 |
|
11 | 10 | FEC's single-pass, low allocation, IL emission approach supports most, but not **all**, expression patterns. See [FEC issues](https://github.com/dadhi/FastExpressionCompiler/issues); patterns like compound assignments inside `TryCatch`, complex closure captures, and certain value-type operations aren't supported. |
12 | 11 |
|
13 | 12 | Hyperbee takes a middle ground: a **multi-pass IR pipeline** that lowers expression trees to an intermediate representation, runs optimization passes, validates structural correctness, and then emits IL. This architecture trades a small amount of speed and allocation overhead for **correct IL across all expression tree patterns** while significantly outperforming the System Compiler. |
14 | 13 |
|
15 | 14 | ## Performance |
16 | 15 |
|
17 | | -HEC is consistently **9-34x faster than the System Compiler** and within **1.16-1.54x of FEC** across all tiers — while producing correct IL for the sub-set of patterns FEC doesn't support (`NegateChecked` overflow, `NaN` comparisons, value-type instance calls, compound assignments in `TryCatch`, etc.). |
| 16 | +HEC is consistently **9-34x faster than the System Compiler** and within **1.16-1.54x of FEC** across all tiers - while producing correct IL for the sub-set of patterns FEC doesn't support (`NegateChecked` overflow, `NaN` comparisons, value-type instance calls, compound assignments in `TryCatch`, etc.). |
18 | 17 |
|
19 | 18 | The Complex tier standout (~34x vs System) is where the multi-pass IR architecture pays off against the System compiler's heavyweight compilation pipeline. The Switch tier at 1.54x is the widest gap vs FEC. |
20 | 19 |
|
|
0 commit comments