以下のステートメントは、SecurityInfoMasterList に約 11,000 項目があり、listClassiNode に約 750 項目がある場合、出力を生成するのに約 6 秒かかります。
同じ結果を達成するためにこれを行う他の方法はありますが、パフォーマンスは向上しますか?
List<SecurityInfo> listSecurityInfo = SecurityInfoMasterList.Where(c =>
listClassiNode.Any(d =>
c.SX == d.Exch && c.Instrument == d.Instrument)).ToList();
for ループを使用しようとしましたが、あまり改善が見られませんでした。
更新しました:
listClassiNode はリストです
[Serializable]
public class SecurityInfo
{
public string SecurityID { get; set; }
public int SecurityTypeID { get; set; }
public string Code { get; set; }
public string SecurityName { get; set; }
public int DB { get; set; }
public string ExchangeName { get; set; }
public DateTime FirstDate { get; set; }
public int StatusCode { get; set; }
public long GICS { get; set; }
public string ICB { get; set; }
public string Sector { get; set; }
public string IndustryGroup { get; set; }
public string Industry { get; set; }
public string Instrument { get; set; }
public string TypeDescription { get; set; }
public string SX { get; set; }
public string GUID { get; set; }
}
[Serializable()]
public class ClassificationNode
{
public string Exch { get; set; }
public string Instrument { get; set; }
public string Prefix { get; set; }
public string Name { get; set; }
public string Level { get; set; }
}
アラン