You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce string allocations in IConsoleOutput implementations (#3978)
* Change IConsoleOutput.Write(string) overload parameter to ReadOnlySpan<char>
Allows the caller more flexibility about choosing a buffer per use case.
* NetOutput: Write StringBuilder directly to the std out text stream
* Add EscSeqUtils.CSI_WriteCursorPosition
Writes cursor position sequence to text writer without string allocation.
* NetOutput: Skip cursor position escape sequence string allocation
* Replace CSI_(Enable|Disable)MouseEvents static properties with readonly fields
Changed for the sake of consistency with rest of the EscSegutils fields rather than performance. Also prevents bugs from accidentally setting the properties.
* Use EscSeqUtils.CSI_Append(Foreground|Background)ColorRGB in v2 drivers
* WindowsOutput SetCursorVisibility: Remove intermediate string builder
* WindowsOutput.WriteToConsole: Use rented array as intermediate write buffer
The large intermediate string builder remains a challenge. :)
* NetOutput: Console.Out for the sake of consistency
Also might have missed one of the Console.Out.Write(StringBuilder) calls...
* Avoid Rune.ToString() in NetOutput.Write(IOutputBuffer)
---------
Co-authored-by: Tig <[email protected]>
$"{nameof(CSI_WriteCursorPosition)} buffer (len: {buffer.Length}) is too short for cursor position sequence '{tooLongCursorPositionSequence}' (len: {tooLongCursorPositionSequence.Length}).");
0 commit comments