Files
UA-.NETStandard/Stack
bhnaphade 4c58c1ff16 Improve JsonEncoder.EscapeString and fix test warnings for ToString() (#2527)
Update the function to improve performance. 
Fix test code warnings (CA1305) related to ToString() method

Based on the results of the benchmark runs, `EscapeStringLegacyPlus` was picked for all platforms that do not support `StreamWriter.Write(ReadOnlySpan<char>)`, e.g. .NET Framework. There is a slight improvement for the cases which require a 4 digit hex encoding.
For platforms that support Span end to end `EscapeStringSpanCharsInline` was picked. The functions tries to optimize how often the underlying StreamWriter is called by combining calls to Write into to slices. It was also noted that up to three character strings, it performs better to do single character writes than calling with a small string.
2024-02-21 13:59:16 +01:00
..