Hi folks
I'm using the auto-mappings and noticed that they're taking quite a
long time to run. I've only got about 6 entities, and the automapping
code and the entities are in the same assembly.
Here's the timing data...
NH configured from file after 925 ms
AutoMappings created after 5020 ms <--(roughly 4 seconds!)
SessionFactory created after 7791 ms <--(roughly 2 seconds)
Here's the code...
=========
cfg.Configure(configFileLocation);
Console.WriteLine("NH configured after {0} ms"
factory = Fluently.Configure(cfg)
.Mappings(m =>m.AutoMappings.Add
(CustomAutoMappings.CreateAutopersistenceModel()))
.ExposeConfiguration(cc => { Console.WriteLine
("AutoMappings created after {0} ms", sw.ElapsedMilliseconds); })
.BuildSessionFactory();
Console.WriteLine("SessionFactory created after {0} ms",
sw.ElapsedMilliseconds);
=========
And the code for the auto mappings..
=========
public static AutoPersistenceModel CreateAutopersistenceModel()
{
var model = new AutoPersistenceModel();
model
//Load in types from the assembly containing
entities
.AddEntityAssembly(typeof(CustomAutoMappings).Assembly)
//Schedules don't need their own table
.Setup(s=>s.IsComponentType = type => type ==
typeof(Schedule))
//We don't map Entity as a separate table
.IgnoreBase<EntityWithTypedId<Guid>>()
//Only interestd in mapping classes that derive
from Entity
.Where(t => t.BaseType ==
typeof(EntityWithTypedId<Guid>))
.Override<Booking>(map => map.References(x =>
x.Contact).Cascade.All())
;
return model;
}
======
And ideas on how I can reduce that 4 seconds for AutoMapping down?
Thanks
T
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---