Skip to content

Commit 390c2d5

Browse files
Daniel-SvenssonstephentoubStephenMolloy
authored
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>
1 parent 9a8cc5e commit 390c2d5

File tree

2 files changed

+221
-412
lines changed

2 files changed

+221
-412
lines changed

0 commit comments

Comments
 (0)