after perf improvements and experimentation
This commit is contained in:
@@ -87,13 +87,27 @@ namespace AyaNova.Biz
|
||||
var TheContext = ct;
|
||||
if (TheContext == null)
|
||||
TheContext = ServiceProviderProvider.DBContext;
|
||||
await TheContext.Widget.AddAsync(outObj);
|
||||
await TheContext.SaveChangesAsync();
|
||||
//TEST SPEED IMPROVEMENTS
|
||||
|
||||
//ORIGINALLY
|
||||
// await TheContext.Widget.AddAsync(outObj);
|
||||
// await TheContext.SaveChangesAsync();
|
||||
|
||||
//add syncronously and don't save but let the log save
|
||||
//THIS SAVED 1 SECOND OUT OF 22 for seeding 500 widgets
|
||||
TheContext.Widget.Add(outObj);
|
||||
|
||||
//Handle child and associated items:
|
||||
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), TheContext);
|
||||
|
||||
|
||||
//This takes 16 seconds out of 22 when seeding 500 widgets
|
||||
SearchIndex(outObj, true);
|
||||
TagUtil.ProcessUpdateTagsInRepository(TheContext, outObj.Tags, null);
|
||||
|
||||
|
||||
//This takes 2 seconds out of 22 when seeding 500 widgets
|
||||
TagUtil.ProcessUpdateTagsInRepository(TheContext, outObj.Tags, null);
|
||||
|
||||
return outObj;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user