trampster / JsonSrcGen

Json library that uses .NET 5 Source Generators
MIT License
148 stars 4 forks source link

Serialize From ReadOnlySpan<char> instead of string #37

Closed trampster closed 3 years ago

trampster commented 3 years ago

String can be converted to ReadOnlySpan very cheaply but converting a ReadOnlySpan to a string is expensive because it requires allocating memory.

Therefore it is better for all around performance to serialize from ReadOnlySpan

trampster commented 3 years ago

Done