FYI I’ve completed the migration from
StringSegment to the System.Memory Span and Memory APIs in both ServiceStack.Text for all JSON/JSV deserialization and ServiceStack for all Template/Expression parsing.
I’ve still got some profiling to do but if anyone wants to check out the latest v5.1.1 on MyGet it has some optimizations enabled where the JSON/JSV text serializers now deserialize using .NET’s new Span/Memory System.Memory structs,
RecyclableMemoryStream is enabled by default so most usages of MemoryStream are pooled and deserializing JSON/JSV Request bodies should be faster courtesy of byte/char pooling and being able to use .NET Core’s native Span APIs for UTF-8 decoding.
For max performance add a reference to the new
ServiceStack.Memory NuGet package in a .NET Core App 2.1 and configure it with:
public override void Configure(Container container)
Which will bind ServiceStack.Text to use .NET Core’s native Span APIs which are only available in .NET Core 2.1.
If anyone wants to check out a live ServiceStack .NET Core 2.1 App with this enabled I’ve redeployed http://templates.servicestack.net running the latest v5.1.1 on MyGet.
Whilst this was a fairly significant refactor, all tests still pass so there should be minimal issues, but if you find any please report back any issues you find.