TL;DR: XmlDocument.Validate is not a read-only operation. but changes the document tree. XDocument.Load(XmlReader) adds attributes, even if they are marked as unspecified.
This post is just a summary of a few things I learned about performance optimization of CPU-bound / memory-bound processes in C#/.NET.
I was able to accelerate two different low-level image processing algorithms by a factor of 10 while learning a lot and enjoying the process.