This commit is contained in:
@@ -15,6 +15,25 @@ After round one of improvements (less text in seed data notes, not calling savec
|
||||
2020-01-23 16:57:57.0422|INFO|Seeder|75 Users seeded in 2398 ms
|
||||
2020-01-23 16:58:11.9983|INFO|Seeder|500 Widgets seeded in 14958 ms
|
||||
|
||||
TODO: Find out if this is linear time for more widgets or exponential to see if it exposes part of the issue
|
||||
X widgets, ms per widget:
|
||||
100=32
|
||||
500=29 (27 in non debug mode)
|
||||
5000=29
|
||||
|
||||
|
||||
Stripped out all text to index except single letter a in notes and c2
|
||||
500=20
|
||||
|
||||
Now going to try the opposite, a *lot* of text 10 paragraphs in both c2 and notes
|
||||
500=59ms
|
||||
|
||||
So the quantity of text directly affects the performance, so it's not just some overhead from the query being run, it's the amount of work it needs to do in the queries
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TODO: Search indexing is painfully slow, it accounts for 16 of 22 seconds when creating 500 widgets with full paragraphs of text
|
||||
- Try to see if it's just one part of the operation by timing it
|
||||
- Re-code it not using EF but directly interacting with the DB
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace AyaNova
|
||||
{
|
||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _newLog);
|
||||
//NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -7);//.Wait();//#############################################################################################
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -7);//#############################################################################################
|
||||
}
|
||||
//TESTING
|
||||
#endif
|
||||
|
||||
@@ -463,7 +463,6 @@ namespace AyaNova.Biz
|
||||
private static void ProcessKeywords(SearchIndexProcessObjectParameters p, bool newRecord)//long localeId, long objectID, AyaType objectType, string name, params string[] text)
|
||||
{
|
||||
|
||||
//AyContext ct = ServiceProviderProvider.DBContext;
|
||||
#if (DEBUG)
|
||||
if (p.ObjectType == AyaType.JobOperations || p.ObjectType == AyaType.Locale)
|
||||
{
|
||||
@@ -483,13 +482,7 @@ namespace AyaNova.Biz
|
||||
|
||||
//BREAK NAME STRING
|
||||
List<string> NameKeyWordList = Break(p.LocaleId, p.Name);
|
||||
|
||||
//BUILD ALL KEYWORDS LIST
|
||||
// List<string> tempList = new List<string>();
|
||||
// tempList.AddRange(KeyWordList);
|
||||
// tempList.AddRange(p.Tags);
|
||||
// var DistinctAllKeywordsCombinedList = tempList.Distinct();
|
||||
// AllKeyWordsCombinedList=((IEnumerable<string>)AllKeyWordsCombinedList).Distinct();
|
||||
|
||||
|
||||
//EARLY EXIT IF NO KEYWORDS OR NAME RECORD OR TAGS TO PROCESS
|
||||
if (KeyWordList.Count == 0 && string.IsNullOrWhiteSpace(p.Name))
|
||||
@@ -503,7 +496,7 @@ namespace AyaNova.Biz
|
||||
|
||||
//ITERATE ALL THE KEYWORDS, SEARCH IN THE SEARCHDICTIONARY TABLE AND COLLECT ID'S OF ANY PRE-EXISTING IN DB KEYWORDS
|
||||
var ExistingKeywordMatches = ServiceProviderProvider.DBContext.SearchDictionary.AsNoTracking().Where(m => KeyWordList.Contains(m.Word)).ToDictionary(m => m.Id, m => m.Word);
|
||||
//var ExistingKeywordMatches = ServiceProviderProvider.DBContext.SearchDictionary.AsNoTracking().Where(m => DistinctAllKeywordsCombinedList.Contains(m.Word)).ToDictionary(m => m.Id, m => m.Word);
|
||||
|
||||
//Put the matching keyword ID's into the list
|
||||
foreach (KeyValuePair<long, string> K in ExistingKeywordMatches)
|
||||
{
|
||||
@@ -562,8 +555,7 @@ namespace AyaNova.Biz
|
||||
throw ex;
|
||||
}
|
||||
|
||||
//FETCH THE WORD ID, PLACE IN MATCHINGKEYWORDLIST AND MOVE ON TO THE NEXT WORD
|
||||
//LOOKAT: 2018-10-10 15:34:34.0587|ERROR|Server Exception|Error=>System.InvalidOperationException: Sequence contains no elements
|
||||
//FETCH THE WORD ID, PLACE IN MATCHINGKEYWORDLIST AND MOVE ON TO THE NEXT WORD
|
||||
var SearchDictionaryMatchFoundInDB = ServiceProviderProvider.DBContext.SearchDictionary.AsNoTracking().Where(x => x.Word == KeyWord).FirstOrDefault();
|
||||
if (SearchDictionaryMatchFoundInDB != null)
|
||||
{
|
||||
|
||||
@@ -615,7 +615,7 @@ namespace AyaNova.Util
|
||||
var c3 = f.Random.Int(1, 99999999);
|
||||
var c4 = f.Random.Bool().ToString().ToLowerInvariant();
|
||||
var c5 = f.Random.Decimal();
|
||||
//2019-05-01T21:38:07Z
|
||||
|
||||
o.CustomFields = $@"{{c1:""{c1}"",c2:""{c2}"",c3:{c3},c4:{c4},c5:{c5}}}";
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user