Some advicesadvice:
- Replace
File.ReadAllLines
withFile.ReadLines
— firstReadAllLines will read all file content into memory before startthe iteration, andforeach
is really designed toforIEnumerable
. - DefinetlyDefinitely replace
for (int row = 0; row < numbers.Count; row++)
,for (int j=0; j<rowTotal.Length; j++)
andfor (int i = 1; i <= iterations; i++)
with plinq PLinq as @ANeves adviced you beforesuggested - Not sure that replacing
foreach (string line in File.ReadAllLines(@"data.txt"))
will help you, as it is heavily dependdependent on disc I/O operations.
Some advices:
- Replace
File.ReadAllLines
withFile.ReadLines
— first will read all file content into memory before start, andforeach
is really designed toIEnumerable
- Definetly replace
for (int row = 0; row < numbers.Count; row++)
,for (int j=0; j<rowTotal.Length; j++)
andfor (int i = 1; i <= iterations; i++)
with plinq as @ANeves adviced you before - Not sure that replacing
foreach (string line in File.ReadAllLines(@"data.txt"))
will help you, as it is heavily depend on disc I/O operations.
Some advice:
- Replace
File.ReadAllLines
withFile.ReadLines
— ReadAllLines will read all file content into memory before the iteration, andforeach
is really designed forIEnumerable
. - Definitely replace
for (int row = 0; row < numbers.Count; row++)
,for (int j=0; j<rowTotal.Length; j++)
andfor (int i = 1; i <= iterations; i++)
with PLinq as @ANeves suggested - Not sure that replacing
foreach (string line in File.ReadAllLines(@"data.txt"))
will help you, as it is heavily dependent on disc I/O operations.
Some advices:
- Replace
File.ReadAllLines
withFile.ReadLines
— first will read all file content into memory before start, andforeach
is really designed toIEnumerable
- Definetly replace
for (int row = 0; row < numbers.Count; row++)
,for (int j=0; j<rowTotal.Length; j++)
andfor (int i = 1; i <= iterations; i++)
with plinq as @ANeves adviced you before - Not sure that replacing
foreach (string line in File.ReadAllLines(@"data.txt"))
will help you, as it is heavily depend on disc I/O operations.
lang-cs