????????У?????ASP.NET MVC????????????????????????????????????????估????????????????????????????????????????У??????????????????????
???????渽?????
????public class drugInfo
????{
????public int drug_nameid????{ get; set; }
????public string drug_name????{ get; set; }
????public string drug_search_code????{ get; set; }
????}
???????????????
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
key = key.ToLower();
var resultList = cacheList.Where(m => m.drug_name.ToLower().Contains(key) || m.drug_search_code.ToLower().Contains(key)).ToList();
stopWatch.Stop();
double eMseconds = Math.Max(0?? stopWatch.Elapsed.TotalSeconds);
?????????漸?Σ?????????????35MS?????
???????????????
??????????CPU???????????LINQ?????е??Сд?????????£?????????б?????Щ??????????????????????Сд?洢??
?????????????????????
public class drugInfo
{
public int drug_nameid????{ get; set; }
public string drug_name????{ get; set; }
public string drug_search_code????{ get; set; }
public string lower_drug_name????{ get; set; }
public string lower_drug_search_code????{ get; set; }
}
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
key = key.ToLower();
var
resultList = cacheList.Where(m =>
m.lower_drug_name.Contains(key) ||
m.lower_drug_search_code.Contains(key)).ToList();
stopWatch.Stop();
double eMseconds = Math.Max(0?? stopWatch.Elapsed.TotalSeconds);
ViewBag.useTime = string.Format("???{0}??rn"?? eMseconds);
?????????漸?Σ?????????????16MS?????
???????????????????б??л???Щ?????????????????????????????????