Releases: dadhi/FastExpressionCompiler
## v3.0.2 Bug-fix release
v3.0.2 Bug-fix release
- fixed: #300 Bad label content in ILGenerator in the Mapster benchmark with FEC V3
- fixed: Small issues with the
ToCSharpString()
, specifically in the TryCatch, and the Goto, and the Label expressions
v3.0.1 Bug-fix release
v3.0.1 Bug-fix release
fixed: #298 LightExpression with the NewExpression of 4 arguments has ArgumentCount = 3
v3.0.0 - Major feature release
v3.0.0 - Major feature release
This version contains a lot of fixes and improvements and as-little-as-possible breaking changes.
FastExpressionCompiler and FastExpressionCompiler.LightExpression
- Performance and memory consumption are improved, especially for the expressions with the closure and for expressions with the nested lambdas.
- More expression types are supported.
- Many fixes in the IL Emit.
- Added
ToCSharpString()
extension method to output the compile-able C# code described by the expression (tries hard). - Added
ToExpressionString()
extension method to output the valid expression construction syntax, so given an expression object you'll get e.g.Lambda(New(...))
. - Added optional
enum CompilerFlags { Default, NoInvocationLambdaInlining, EnableDelegateDebugInfo}
parameter for the compilation EnableDelegateDebugInfo
adds the diagnostic info into the compiled delegate including its source Expression and C# code. Can be used as following:
var f = e.CompileFast(true, CompilerFlags.EnableDelegateDebugInfo);
var di = f.Target as IDelegateDebugInfo;
Assert.IsNotNull(di.Expression);
Assert.IsNotNull(di.ExpressionString);
Assert.IsNotNull(di.CSharpString);
FastExpressionCompiler.LightExpression
- Now includes the
ExpressionVisitor
. - Improves the compatibility (the drop-in replacement) between the
FastExpressionCompiler.LightExpression.Expression
and theSystem.Linq.Expression
. - Decreasing the memory consumed by the created expressions partially via implementing the
IArgumentProvider
andIParameterProvider
for some expressions.
The full list of the closed issues
v2.0.0
Major release
Contains breaking changes, but likely or lucky you'll need to re-compile only.
Thanks
V2 was developed with a strong help of @jogibear9988, @dzmitry-lahoda, @MaceWindu,
and other contributors - kudos to all of them!
The main change
FEC package now is split in two: [FastExpressionCompiler (FEC)] and [FastExpressionCompiler.LightExpression (FEC.LE)]. The packages are not dependent on each other and may be used together.
FEC.LightExpression allows a drop-in replacement for manually created expression, the only change is different namespace using. LE.Expression is "lighter" because it is faster created and consumes less memory. It does it by avoiding most of compatibility and verification checks. But it does not mean it is not safe! You can convert it to System Expression as easy as calling ToExpression
or ToLambdaExpression
and it will run the usual verification. This conversation also enables fallback to Expression.Compile
inside the CompileFast
.
ExpressionInfo
and supporting logic is moved from FEC to FEC.LEExpressionInfo
is renamed toExpression
but moved into new namespaceFastExpressionCompiler.LightExpression
- FastExpressionCompiler.cs stripped from
ExpressionInfo
noise and now is much simpler and lost 33% LOC. - FastExpressionCompiler.cs is shared between FEC and FEC.LE with
LIGHT_EXPRESSION
build variable controlling what to compile:System.Linq.Expressions.Expression
orFastExpressionCompiler.LightExpression
Features
- added: #57 Consider signed package version!
- added: #59 Support compiling delegates with ref and out parameters
- added: #78 Lambda<Func>(Block(Label(Label(typeof(int)), Constant(7)))) is not supported
- added: #88 Lambda<Func>(Block(Constant(IntPtr.Zero)))
- added: #91 Support for MultiplyAssign, AddAsiggn, DivideAssign
- added: #98 % and bit operators are not supported
- added: #101 Some Assign Modes are not yet supported
- added: #102 Label and Goto Expression not yet implemented
- added: #105 Bit Expression Types are not yet supported
- added: #106 ExpressionType.Power not supported
- added: #107 Check if xxxAssigns also work with Variables
- added: #118 Support for Expression.Variable (in a Expression.Block)
- added: #127 Switch is not supported
- added: #130 Net Framework Expression compiler generates perfromanter Code for isNull check
- added: #138 Optimize Compilation of nested Lambdas
Fixes
- fixed: #83 Issues with linq2db tests
- fixed: #92 Expression not compilable
- fixed: #93 Comparison to "null" does not work when not Typed
- fixed: #95 Ref support not yet working completely
- fixed: #124 LightExpression wrong Type
- fixed: #131 Linq2db - Test for JIT compiler internal limitation
- fixed: #137 Problem with Reading & Writing of Struct Fields.
- fixed: #146 Boolean parameter value changed from false to true
- fixed: #147 'Common Language Runtime detected an invalid program' with
int.TryParse
- fixed: #151 'Attempt to read protected memory'
- fixed: #152 int.MinValue access throws 'Method not supported'
- fixed: #154 Equals Expression does not call "Equals" of class (in MS Code)
- fixed: #156 Invoking an Action constant fails with 'Common Language Runtime detected an invalid program'
- fixed: #159 Condition with converted numeric comparisons gives unexpected result
- fixed: #162 Float - short numeric comparisons with conversions gives unexpected result
- fixed: #163 Add of Nullable Int, etc does not work correctly
- fixed: #165 Int and Decimal to Double conversion issues
- fixed: #170 Problems with ref parameters
- fixed: #172 Using FEC to compile a property setter with an enum value sets the property to random values