Perfomance of Mapping C# Poco objects 3
03/23/2018
In the last part of this series I will come up with a more generalized way of mapping objects one to another.
In the previous episodes
In the previous posts we have used AutoMapper to map People1, People2 and God1, God2 types respectively to each other. I have seen it is very easy to use AutoMapper, but when doing a performance measurement, it was shown that it takes 237ms to run our test sample.
In the second post, we repeated the same measurement, but instead of using AutoMapper, we used poor man's type, and manually created an extension method to map each type to the other. This approach was significantly faster, the same test took only 40ms to run. It has a huge disadvantage on the other hand, each mapping method has to be written by hand, which is significant amount of work.