For a situation like capturing text incrementally, for example if you were receiving all of the output.write calls when a page was rendering, and those were being appended into a textwriter over a stringbuilder.
Is there a more efficient way to do this? Something that exists in dotnet already preferably? Especially if there’s a total size over a hundred k. Maybe something more like an array of pages rather than contiguous memory?
I think StringBuilder is the most efficient way to append text in .net. To be more efficient you can specify the initial size of the StringBuilder when you create it.