{"action":"opened","issue":{"url":"https://api.github.com/repos/expressmapper/ExpressMapper/issues/53","labels_url":"https://api.github.com/repos/expressmapper/ExpressMapper/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/expressmapper/ExpressMapper/issues/53/comments","events_url":"https://api.github.com/repos/expressmapper/ExpressMapper/issues/53/events","html_url":"https://github.com/expressmapper/ExpressMapper/issues/53","id":115931820,"number":53,"title":"Mapping too slow with nested object","user":{"login":"Mariana1980","id":15738038,"avatar_url":"https://avatars.githubusercontent.com/u/15738038?v=3","gravatar_id":"","url":"https://api.github.com/users/Mariana1980","html_url":"https://github.com/Mariana1980","followers_url":"https://api.github.com/users/Mariana1980/followers","following_url":"https://api.github.com/users/Mariana1980/following{/other_user}","gists_url":"https://api.github.com/users/Mariana1980/gists{/gist_id}","starred_url":"https://api.github.com/users/Mariana1980/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mariana1980/subscriptions","organizations_url":"https://api.github.com/users/Mariana1980/orgs","repos_url":"https://api.github.com/users/Mariana1980/repos","events_url":"https://api.github.com/users/Mariana1980/events{/privacy}","received_events_url":"https://api.github.com/users/Mariana1980/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-09T18:01:54Z","updated_at":"2015-11-09T18:01:54Z","closed_at":null,"body":"Hello!!!\r\nWe are testing your mapping class and we have a problem. Our class has a complex object list (Unidad).\r\nThe first time mapping is very slow , apox. 2 minutes.  The second time is immediately. \r\nWhat can we do to improve the performance? \r\n\r\nWPF App:\r\n   public partial class App : Application\r\n    {\r\n        private void OnStartup(object sender, StartupEventArgs e)\r\n        {\r\n\r\n            Mapper_Inspector_Punitiva mapper = new Mapper_Inspector_Punitiva();\r\n            mapper.RegisterMapping();\r\n            Mapper.Compile();\r\n            Mapper.PrecompileCollection<List<pesada_punitiva>, List<Pesada>>(); // 2 minutes\r\n            \r\n        }\r\n    }\r\n\r\n\r\nClass:\r\n    [Serializable]\r\n    public class Pesada\r\n    {      \r\n        public long id_pesada { get; set; }   \r\n public List<Unidad> unidades_punitiva { get; set; }             \r\n    }\r\n\r\n        [Serializable]\r\n    public class Unidad\r\n    {\r\n        public long id_pesada { get; set; }\r\n        public int id_balanza { get; set; }\r\n        public System.DateTime fecha_pesada { get; set; }\r\n        public int id_unidad { get; set; }   \r\n\r\n        public List<Grupo> grupos_punitiva { get; set; }\r\n        public List<Infraccion> infracciones_punitiva { get; set; }\r\n    }\r\n\r\n   [Serializable]\r\n    public class Grupo\r\n    {\r\n        public long id_pesada { get; set; }\r\n        public System.DateTime fecha_pesada { get; set; }\r\n        public int id_balanza { get; set; }\r\n        public int id_unidad { get; set; }\r\n        public int id_grupo { get; set; }\r\n        public long? peso_maximo { get; set; }\r\n        public int? peso_grupo { get; set; }\r\n        public int? tolerancia_adicional { get; set; }\r\n        public int? tipificacion_matricula_cantidad_neumaticos_dnt { get; set; }\r\n        public string tipificacion_matricula_suspension_dnt { get; set; }\r\n        public string tipificacion_matricula_tipo_neumaticos_dnt { get; set; }\r\n        public List<Eje> ejes_punitiva { get; set; }\r\n    }\r\n\r\n    [Serializable]    \r\n    public class Eje\r\n    {\r\n        \r\n        public long id_pesada { get; set; }\r\n        public System.DateTime fecha_pesada { get; set; }\r\n        public int id_balanza { get; set; }\r\n        public int id_unidad { get; set; }\r\n        public int id_grupo { get; set; }\r\n        public int id_eje { get; set; }\r\n        public long? distancia_eje { get; set; }\r\n        public int? peso_eje { get; set; }\r\n        public int? tolerancia_adicional { get; set; }\r\n        public int? tipificacion_matricula_cantidad_neumaticos_dnt { get; set; }\r\n        public string tipificacion_matricula_suspension_dnt { get; set; }\r\n        public string tipificacion_matricula_tipo_neumaticos_dnt { get; set; }\r\n        public int? peso_maximo { get; set; }\r\n        public List<InfoSensorPeso> info_sensor_peso_punitiva { get; set; }\r\n    }\r\n\r\nMapping:\r\n\r\n            Mapper.Register<pesada_punitiva, Pesada>();\r\n            Mapper.Register<unidad_punitiva, Unidad>();\r\n            Mapper.Register<grupo_punitiva, Grupo>();\r\n            Mapper.Register<eje_punitiva, Eje>();\r\n"}}