Benchmark async vs sync parsing and parallel processing for single and multiple files.
- None of the
XmlReader.ReadToXxx() functions support async processing, plus there is extra overhead in the internal async implementation. OTOH, most of the ReadToXxx() are simple enough to replicate with use of ReadAsync() instead of Read().
Since a single report file seems the most common use case, we keep this sync for now.
- Parallel processing of a single file is not possible with
XmlReader. Parallel processing of XDocument/XElement via Linq is really fast, but requires the entire file to be loaded as DOM, which not only negates those performance gains, but is about three times slower than sync processing with XmlReader.
Benchmark async vs sync parsing and parallel processing for single and multiple files.
XmlReader.ReadToXxx()functions support async processing, plus there is extra overhead in the internal async implementation. OTOH, most of theReadToXxx()are simple enough to replicate with use ofReadAsync()instead ofRead().Since a single report file seems the most common use case, we keep this sync for now.
XmlReader. Parallel processing ofXDocument/XElementvia Linq is really fast, but requires the entire file to be loaded as DOM, which not only negates those performance gains, but is about three times slower than sync processing withXmlReader.