Description
Possible optimization found.
Current implementation of writing primitive types fallbacks to string using XmlConvert.ToString(..).
|
protected void WriteTypedPrimitive(string? name, string? ns, object o, bool xsiType) |
Regression?
No
Analysis
How to optimize:
Write to char[] and then use XmlWriter.WriteChars(...). This should eliminate all temporary string for int/DateTime/guid.... types, which should be majority when serializing custom types. This change will help us later to use XmlSerializationWriter.WriteTypedPrimitive method in XmlSerializationWriterILGen instead of again creating strings and using XmlConvert.ToString(...)