Prescriptive Architecture
Checklist: XML Performance
 

Patterns and Practices home

Improving .NET Application Performance and Scalability

J.D. Meier, Srinath Vasireddy, Ashish Babbar, and Alex Mackman
Microsoft Corporation

May 2004

Related Links

Home Page for Improving .NET Application Performance and Scalability

Send feedback to Scale@microsoft.com

patterns & practices Library

How to Use This Checklist

This checklist is a companion to Chapter 9, "Improving XML Performance"

Design Considerations

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifChoose the appropriate XML class for the job.
ms979180.checkbox(en-us,MSDN.10).gifConsider validating large documents.
ms979180.checkbox(en-us,MSDN.10).gifProcess large documents in chunks, if possible.
ms979180.checkbox(en-us,MSDN.10).gifUse streaming interfaces.
ms979180.checkbox(en-us,MSDN.10).gifConsider hard-coded transformations.
ms979180.checkbox(en-us,MSDN.10).gifConsider element and attribute name lengths.
ms979180.checkbox(en-us,MSDN.10).gifConsider sharing the XmlNameTable.

Parsing XML

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifUse XmlTextReader to parse large XML documents.
ms979180.checkbox(en-us,MSDN.10).gifUse XmlValidatingReader for validation.
ms979180.checkbox(en-us,MSDN.10).gifConsider combining XmlReader and XmlDocument.
ms979180.checkbox(en-us,MSDN.10).gifOn the XmlReader, use the MoveToContent and Skip methods to skip unwanted items.

Validating XML

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifUse XmlValidatingReader.
ms979180.checkbox(en-us,MSDN.10).gifDo not validate the same document more than once.
ms979180.checkbox(en-us,MSDN.10).gifConsider caching the schema.

Writing XML

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifUse XmlTextWriter.

XPath Queries

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifUse XPathDocument to process XPath statements.
ms979180.checkbox(en-us,MSDN.10).gifAvoid the // operator by reducing the search scope.
ms979180.checkbox(en-us,MSDN.10).gifCompile both dynamic and static XPath expressions.

XSLT Processing

CheckDescription
ms979180.checkbox(en-us,MSDN.10).gifUse XPathDocument for faster XSLT transformations.
ms979180.checkbox(en-us,MSDN.10).gifConsider caching compiled style sheets.
ms979180.checkbox(en-us,MSDN.10).gifConsider splitting complex transformations into several stages.
ms979180.checkbox(en-us,MSDN.10).gifMinimize the size of the output document.
ms979180.checkbox(en-us,MSDN.10).gifWrite efficient XSLT.

Patterns and Practices home

Page view tracker