I did the same with C#. Almost everything that requires more than a few bytes handles alloc/free on umanaged memory from high performance allocators that can be configured at startup. You will notice a class called VNString. An immutable heap string that is very similar to the string type in C# but stored on the unmanaged heap and 0 copy slices.

https://github.com/VnUgE/VNLib.Core/tree/develop/lib/Utils/src/Memory

Reply to this note

Please Login to reply.

Discussion

yeah, it's a huge cost, managing garbage, and for Go the immutable string is definitely a liability for fast network message processing... i mean, switching to mutable bytes (not immutable string) sped JSON processing almost to equal to raw binary!