We are using AutoMapper 3.1.1.0 in our Dot net application. We are having lots of classes which neeed to map. Time required to initialize mapping is almost 22 seconds. We are having almost 1327 DTO which need to mapped.
And we can say that each DTO having average 8 properties.
My concern is for each message we check in list of 1327 mapped DTO,
and then use
if (MappingManager.MessageMappings.ContainsKey(message.GetType()))
{
var myMessage = Mapper.Map(message, message.GetType(), MappingManagerFile.MessageMappings[message.GetType()]);
So it hurts performance. Do we need to Dispose after use, or automapper take care itself? In task manager the component which do this conversion is taking lots of memory.
So please suggest what alterantives we need to use to improve performance.