Improve XmlDictionaryWriter UTF8 encoding performance (#73336)
* Speed up text encoding * Update implementation * Add tests for binary xml strings * limit counting code to 256 bit vectors * reword comment * rename test * move bytesmax * Fix bytesMax after moving variable initialization * use unicode escape value in test * fix test typo "*" -> "+" * Update src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs Co-authored-by: NStephen Toub <stoub@microsoft.com> * Remvoe vectorized code from UnsafeGetUTF8Length * Fix overfload * use for loop which seems faster * remove vector loop * make sealed encoding to allow devirtualisation * back some changes * use uint for UnsafeGetUTF8Chars comparison * revert more changes * Fix cutoff based on new measurements * use BinaryPrimitives.ReverseEndianness as suggested * Update cutoff from 24 to 32 chars before calling, due to regression for text based DataContractSerializer * Remove sealed encoding since it only improves XmlConvert --------- Co-authored-by: NStephen Toub <stoub@microsoft.com>
Showing
想要评论请 注册 或 登录