的巨大的名單,我從文件中
選擇從文件
// selecting around 80-120 files from 20,000 - 25,000
FileInfo[] files = (new DirectoryInfo(dirPath)).GetFiles("*.xml");
string[] selectedFiles = (from c in files
where c.CreationTime >= DateTime.Today.AddDays(-1) && c.CreationTime < DateTime.Today.AddHours(-2.0)
select c.FullName).ToArray();
的巨大列表中選擇前一天的文件上面大約需要4-5分鐘跑前一天的文件,能否請你告訴我如何優化它,而不改變功能!
// file selection is between yesterday 0:00 to yesterday 22:00 <br >
如上面的代碼所示。
請諮詢。
你需要運行它同步,如果沒有,使用異步 – 2013-02-22 17:02:34
@CuongLe手段? – Pratik 2013-02-22 17:03:17
你可以在不同的線程下運行這段代碼 – 2013-02-22 17:03:53