nats-io / nats.net.v2

Full Async C# / .NET client for NATS
https://nats-io.github.io/nats.net.v2/
Apache License 2.0
202 stars 40 forks source link

StoredMessage.Data as System.Buffers.Text #518

Open mtmk opened 3 weeks ago

mtmk commented 3 weeks ago

System.Buffers.Text has To/From for utf8 byte sequences and it looks like they work with netstandard20, adapting to such an approach longer term may help consolidate this code as well as lower the deserialization cost of KV and other stream reads in NET8 (as we can hold the base64 in UTF8 bytes rather than UTF16 string, maybe pool in future too? Not sure how easy it would be to do that part though...)

see also https://github.com/nats-io/nats.net.v2/pull/513#discussion_r1642041779