Back to Mapster

Packages - Fast Expression Compiler Support

docs/articles/packages/FastExpressionCompiler.md

10.0.7856 B
Original Source

Need more speed? Let's compile with FastExpressionCompiler.

Installation

Getting the package:

nuget
     PM> Install-Package FastExpressionCompiler

Then add following code on start up

csharp
TypeAdapterConfig.GlobalSettings.Compiler = exp => exp.CompileFast();

That's it. Now your code will enjoy performance boost. Here is result.

MethodMeanStdDevErrorGen 0Gen 1Gen 2Allocated
'Mapster 4.1.1'115.31 ms0.849 ms1.426 ms31000.0000--124.36 MB
'Mapster 4.1.1 (FEC)'54.70 ms1.023 ms1.546 ms29600.0000--118.26 MB