Reading millions of small files with C#
问题 I have millions of log files which generating every day and I need to read all of them and put together as a single file to do some process on it in other app. I'm looking for the fastest way to do this. Currently I'm using Threads, Tasks and parallel like this: Parallel.For(0, files.Length, new ParallelOptions { MaxDegreeOfParallelism = 100 }, i => { ReadFiles(files[i]); }); void ReadFiles(string file) { try { var txt = File.ReadAllText(file); filesTxt.Add(tmp); } catch { } GlobalCls