移行すると、次のループでパフォーマンスの問題が発生します。もともとはVS2003で書かれました。このループは、VS2003で実行するのに約20秒かかります。VS2005、VS2008、VS2010、およびVS2012では、この同じループの実行に5時間かかります。コードの変更はなく、すべてのバージョンが同じPCで実行されています。Visual Studioに移行しようとしたときに、このようなパフォーマンスの問題が発生したことはありますか?次のバージョンのVisualStudioでこのループを実行しました。これが、h / mm/ss形式の結果です。
VS2003 VS2005 VS2008 VS2010 VS2012
0:00:20 9:50:15 20:15:02 8:42:08 4:58:09
//dstPrvTbleSeq has 114881 rows
//dstPrvTbl has 104070 rows
foreach (DataRow dr in drSeq)
{ // in query PrvLocID is selected as PrvID to match with extract requirements
DataRow[] drSelect = dstPrvTbl.Tables[0].Select("PrvID=" + dr["PrvID"].ToString() + " and TermDate is null");
if (drSelect.Length > 0)
{
dr.Delete();
}
else
{
//delete duplicate term record with different fee schedule, only the first sequence fee schedule should show up as term
DataRow[] drSelect2 = dstPrvTbl.Tables[0].Select("PrvID=" + dr["PrvID"].ToString() + " and TermDate is not null");
if (drSelect2.Length > 0)
{
if (dr["TermDate"].ToString() != "")//if a term record for provider location id is already there and a new term record for another plan code comes across then delete the new one from file
dr.Delete();
else if (sPrvFileName.Trim().ToUpper() == "NEPTUNE.TXT" || sPrvFileName.Trim().ToUpper() == "PROV.TXT") //if Neptune file then remove the previous old term record and keep the new active record
{
drSelect2[0].Delete();//delete the old term record for neptune file
dstPrvTbl.AcceptChanges();
}
}
}
}