-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Stephen 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: Stephen Toub <stoub@microsoft.com>
- Loading branch information
1 parent
b54d6ef
commit e0c94f8
Showing
2 changed files
with
93 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters