Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Binary Xml (XmlDictionaryWriter) performance (#71478)
* Improve perf of XmlBinaryWriter using Unsafe * Use ReverseEndianness to simplify writes * Use span in a few places * Add back old comparison, but only write float as int if it saves space * Use span in array writing to reduce bounds checks * Extract all unsafe code to shared method * Fix nodetype type * Avoid pinning and unsafe when writing arrays * add back CheckArray * Fix Assert condition * Apply suggestions from code review Co-authored-by: Stephen Toub <stoub@microsoft.com> * Fix review comments * use new span ctor * add tests * Add tests for very long arrays * Fixx overload resolution for WriteText method * Just copy guid arrays on LittleEndian platforms * Add testversion of XmlBinaryNodeType with hardcoded values to use same appoach as in reader PR * call corrreect version of getbuffer * Update src/libraries/System.Runtime.Serialization.Xml/tests/ReflectionOnly/System.Runtime.Serialization.Xml.ReflectionOnly.Tests.csproj * fix merge conflict * Fix merge conflicts. * Restored Big-Endian functionality. Ugly though. * Cleaned up arrays. * Remove leftover using in tests. --------- Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Steve Molloy <smolloy@microsoft.com>
- Loading branch information