Serializing and restoring automapper's configuration

54 views
Skip to first unread message

Dan Plaskon

unread,
May 12, 2015, 1:34:31 PM5/12/15
to automapp...@googlegroups.com
I'm looking to try and reduce the start up time of my application - much of which is spent creating maps (using a method like this, for reference: http://stackoverflow.com/questions/11724326/automatic-discovery-of-automapper-configurations)

What I'm curious about is...can the automapper configuration be serialized and restored? I use a similar method with NHibernate (http://lucisferre.net/2009/06/18/speed-up-nhibernate-startup-with-object-serialization/) and have had great results with that.

Thanks in advance!

Jimmy Bogard

unread,
May 12, 2015, 1:45:24 PM5/12/15
to automapper-users
Where is the time actually being spent? Have you run in a profiler?

--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Plaskon

unread,
May 12, 2015, 1:50:43 PM5/12/15
to automapp...@googlegroups.com
I have indeed, and it is being spent in CreateMap calls - specifically System.Reflection.Emit.DynamicMethod.CreateDelegate

We have a fairly large domain, and quite a few dtos/viewmodels - so I'm looking at about 5-6 seconds being spent creating a few hundred maps.

Jimmy Bogard

unread,
May 12, 2015, 1:59:59 PM5/12/15
to automapper-users
Huh, do you have a bigger stack trace? I only explicitly call that method for creating interface implementations on the fly for INotifyPropertyChanged junk.
Reply all
Reply to author
Forward
0 new messages