StringBuilder vs XmlTextWriter

Posted by Wololo on Stack Overflow See other posts from Stack Overflow or by Wololo
Published on 2010-03-19T15:20:45Z Indexed on 2010/03/19 17:51 UTC
Read the original article Hit count: 423

Filed under:
|

I am trying to squeeze as much performance as i can from a custom HttpHandler that serves Xml content.

I' m wondering which is better for performance. Using the XmlTextWriter class or ad-hoc StringBuilder operations like:

StringBuilder sb = new StringBuilder("<?xml version="1.0" encoding="UTF-8" ?>");    
sb.AppendFormat("<element>{0}</element>", SOMEVALUE);

Does anyone have first hand experience?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml