Use Sse2 instrinsics to make NeedsEscaping check faster for large JSON strings (dotne...
authorAhson Khan <ahson_ahmedk@yahoo.com>
Tue, 22 Oct 2019 07:59:19 +0000 (00:59 -0700)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2019 07:59:19 +0000 (00:59 -0700)
commit0089be53b8b475509fd4b39c59358418cb65d8d0
tree4e58ed881e5d46736e2404e114fbf9a80cb52f8f
parent8830130b93fafa268d25a10aa508de99177cf4c7
Use Sse2 instrinsics to make NeedsEscaping check faster for large JSON strings (dotnet/corefx#41845)

* Use Sse2 instrinsics to make NeedsEscaping check faster for large
strings.

* Update the utf-8 bytes needsescaping and add tests.

* Remove unnecessary bitwise OR and add more tests

* Add more tests around surrogates, invalid strings, and characters >
short.MaxValue.

Commit migrated from https://github.com/dotnet/corefx/commit/7cae92b39d2fed2e4e88e900f2e7d787ed9f6cfa
src/libraries/System.Text.Json/src/System.Text.Json.csproj
src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.Escaping.cs
src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs