Today i tried do some optimization to foreach statement, that works on XDocument.
foreach
XDocument
Before optimization:
foreach (XElement el
Yes exactly, Document.Load(...) locks the file and due to resource contention between threads, TPL is unable to use the power of multiple threads. Try to load the XML into a Stream and then use Parallel.For(...).
Document.Load(...)
Stream
Parallel.For(...)