Emit mapper vs valueinjecter or automapper performance

走远了吗. 提交于 2019-11-28 06:52:43

The reason is explained int the EmitMapper documentation:

It effectively uses the Emit library to generate mappers at run-time direct in IL as though these mappers are written by hand. Most other mappers use the Reflection library for mapping (or source code generation). Also EmitMapper minimizes boxing-unboxing operations and additional calls during mapping. For example it performs type conversion for value-types without boxing-unboxing and converts nested members without recursion (one-pass algorithm) when it is possible.

Reflection is extremely slow compared to handwritten code. EmitMapper instead, compared to handwritten mapping, has only the startup overhead when it emits.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!