DapperLib / Dapper

Dapper - a simple object mapper for .Net
https://www.learndapper.com/
Other
17.33k stars 3.67k forks source link

Use source generators instead of reflection #1743

Open musictopia2 opened 2 years ago

musictopia2 commented 2 years ago

I notice that one area where dapper can still be maybe too slow is it uses reflection to map to objects which is too slow. I would suggest the possibility of using source generators so a person can have as fast performance as possible.

mgravell commented 2 years ago

See https://github.com/DapperLib/DapperAOT/

Totally agree; have done some initial exploration; needs dedicated thought.

alex-jitbit commented 1 year ago

While Marc and the team are still working on this, you can use our source-generator-based mapper (datareader-to-object) here https://github.com/jitbit/MapDataReader/

You can use it with Dapper too, by overloading the Query<T> extension method (see the example in the Readme)