This commit is contained in:
@@ -10,7 +10,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using AyaNova.Util;
|
using AyaNova.Util;
|
||||||
using AyaNova.Models;
|
using AyaNova.Models;
|
||||||
using System.Diagnostics;
|
//using System.Diagnostics;
|
||||||
|
|
||||||
|
|
||||||
namespace AyaNova.Biz
|
namespace AyaNova.Biz
|
||||||
@@ -336,24 +336,10 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var watch = new System.Diagnostics.Stopwatch();//###################### PROFILING
|
// var watch = new System.Diagnostics.Stopwatch();//###################### PROFILING
|
||||||
watch.Start();//###################### PROFILING
|
// watch.Start();//###################### PROFILING
|
||||||
|
|
||||||
watch.Start();//###################### PROFILING
|
//Get names using best performing technique
|
||||||
|
|
||||||
|
|
||||||
//EF CORE METHOD
|
|
||||||
// //Build the return list from the remaining matching objects list
|
|
||||||
// foreach (AyaTypeId i in OrderedMatchingObjects)
|
|
||||||
// {
|
|
||||||
// SearchResult SR = new SearchResult();
|
|
||||||
// SR.Name = BizObjectNameFetcher.Name(i, ct);//THIS IS CAUSING ALL THE SLOWNESS IN RETURNING SEARCH RESULTS
|
|
||||||
// SR.Id = i.ObjectId;
|
|
||||||
// SR.Type = i.ObjectType;
|
|
||||||
// ResultList.Add(SR);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//TEST DIRECT METHOD ##############
|
|
||||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -371,11 +357,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// watch.Stop();//###################### PROFILING
|
||||||
watch.Stop();//###################### PROFILING
|
// var TimeToBuildSearchResultReturnList = watch.ElapsedMilliseconds;//###################### PROFILING
|
||||||
var TimeToBuildSearchResultReturnList = watch.ElapsedMilliseconds;//###################### PROFILING
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ResultList;
|
return ResultList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -453,7 +453,6 @@ namespace raven_integration
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async void ConstrainedBigDataSearchShouldHonourMaxResultsAndBeRelativelyFast()
|
public async void ConstrainedBigDataSearchShouldHonourMaxResultsAndBeRelativelyFast()
|
||||||
{
|
{
|
||||||
|
|
||||||
//THIS test is a bit different in that it relies partly on the big dataset for testing
|
//THIS test is a bit different in that it relies partly on the big dataset for testing
|
||||||
//so it has different paths depending upon if it's testing against the big data or not
|
//so it has different paths depending upon if it's testing against the big data or not
|
||||||
const string TEST_SEARCH_PHRASE = "et*";
|
const string TEST_SEARCH_PHRASE = "et*";
|
||||||
@@ -480,8 +479,11 @@ namespace raven_integration
|
|||||||
//assert it's not unbounded
|
//assert it's not unbounded
|
||||||
ResultCount.Should().BeLessOrEqualTo(1000);
|
ResultCount.Should().BeLessOrEqualTo(1000);
|
||||||
|
|
||||||
//1755ms is the longest I've seen in initial testing with all 1000 results so setting slightly above
|
//1500 ms is the longest I've seen in initial testing with all 1000 results so setting 10% above
|
||||||
TimeToSearch.Should().BeLessThan(2476, "Constrained big data search should not be too slow");
|
TimeToSearch.Should().BeLessThan(1650, "Constrained big data search should not be too slow");
|
||||||
|
|
||||||
|
//1291, 1384, 1343, 1466, 1479, 1500, 1313, 1381
|
||||||
|
//when running all tests: 2456, 3620,
|
||||||
|
|
||||||
}//eot
|
}//eot
|
||||||
|
|
||||||
@@ -489,7 +491,6 @@ namespace raven_integration
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async void UnboundBigDataSearchShouldBeRelativelyFast()
|
public async void UnboundBigDataSearchShouldBeRelativelyFast()
|
||||||
{
|
{
|
||||||
|
|
||||||
//THIS test is a bit different in that it relies partly on the big dataset for testing
|
//THIS test is a bit different in that it relies partly on the big dataset for testing
|
||||||
//so it has different paths depending upon if it's testing against the big data or not
|
//so it has different paths depending upon if it's testing against the big data or not
|
||||||
const string TEST_SEARCH_PHRASE = "et*";
|
const string TEST_SEARCH_PHRASE = "et*";
|
||||||
@@ -513,9 +514,10 @@ namespace raven_integration
|
|||||||
|
|
||||||
//Now validate the return list
|
//Now validate the return list
|
||||||
var ResultCount = ((JArray)a.ObjectResponse["result"]).Count;
|
var ResultCount = ((JArray)a.ObjectResponse["result"]).Count;
|
||||||
|
|
||||||
|
|
||||||
TimeToSearch.Should().BeLessThan(38427, "Unconstrained big data search should not be too slow");
|
//Set this time based on testing. Slowest run plus 10%
|
||||||
|
TimeToSearch.Should().BeLessThan(15400, "Unconstrained big data search should not be too slow");
|
||||||
//Fastest is 17227 ms with 14143 results
|
//Fastest is 17227 ms with 14143 results
|
||||||
/*
|
/*
|
||||||
Indexing improvements testing runs.
|
Indexing improvements testing runs.
|
||||||
@@ -527,7 +529,9 @@ namespace raven_integration
|
|||||||
18647, 17137, 16836, 17379, 17637 = avg: 17527
|
18647, 17137, 16836, 17379, 17637 = avg: 17527
|
||||||
Not a huge change, but it is positive
|
Not a huge change, but it is positive
|
||||||
|
|
||||||
Adding more indexes...
|
After much work:
|
||||||
|
11390, 10570, 11515
|
||||||
|
13926, 12411, 12007, 12438, 12023, 12492
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user