### Summary * Optimized GetString by eliminating the intermediate string allocation. ** Note **: Encoding.GetChars() is still really inefficient, especially when strings are not aligned or have regular ascii/unicode characters. Thankfully we generally don't have to worry about these odd edge cases, but if they happen then GetChars can allocate hundreds of bytes. This is a benchmark for just the related changes. NonSpecial are just ascii characters, while the other tests include control codes. ```cs | Method | Mean | Error | StdDev | Gen0 | Allocated | |------------------------------- |---------:|--------:|--------:|-------:|----------:| | GetString | 306.7 ns | 5.96 ns | 6.86 ns | 0.0124 | 200 B | | GetStringNotSpecial | 257.0 ns | 4.83 ns | 4.52 ns | 0.0114 | 184 B | | GetStringSpanHelpers | 166.4 ns | 3.26 ns | 3.48 ns | - | - | | GetStringSpanHelpersNotSpecial | 137.3 ns | 1.57 ns | 1.22 ns | - | - | ``` |
||
|---|---|---|
| .. | ||
| Application | ||
| Logger | ||
| Server | ||
| Server.Tests | ||
| UOContent | ||
| UOContent.Tests | ||