안녕 내가 이상한 최적화 질문이 모두 여기에 일부 상당히 관여 분석을 위해 사용되는 블랙 박스 (즉 I를 본질적으로 mycollobj중첩 루프 최적화
CollectionObject mycollobj = new CollectionObject();
List<string> MyProducts = new List<string>();
//get collection of selected customers that were passed in
var chckedValues = form.GetValues("assignChkBx");
foreach(string customer in chckedValues)
{
MyProducts.Clear();
//MyProducts is then set to a data access method in my data access class
MyProducts = DataLayerClass.GetProductsFromCustomer(customer);
foreach(string product in MyProducts)
{
string item1 = DataLayerClass.GetItem1(product);
string item2 = DataLayerClass.GetItem2(product);
mycollobj.loaditems(item1, item2);
}
}
통제 할 수 없다). 이 중첩 알고리즘을 실행하는 더 좋은 방법이 있습니까? 어떤 제안이라도 가치가 있으며 어떤 것에 대한 설명이 필요한지 물어보십시오. 감사!
FYI this all works, 그저 느리다. – Badmiral
'mycollobj.loaditems'가 느린 부분 인 경우 그 호출을 백그라운드 스레드로 옮길 수 있습니까? – davisoa
나는 느린 것을 실제로 확신하지 못한다. 전체 과정이 느리다. (이 재료는 아직 초보자이다.) – Badmiral