C# PLINQ????б??????????
???????????? ???????[ 2016/3/30 10:52:48 ] ????????.NET ???????????
????????У?????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?????
???????????????????б??л???Щ?????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11