Skip to content

Add BinaryWriter benchmarks for _useFastUtf8 true and false code paths - #5121

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/augment-binary-writer-tests
Open

Copilot wants to merge 5 commits into
mainfrom
copilot/augment-binary-writer-tests

Conversation

ghost commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor
  • Analyze the _useFastUtf8 condition in BinaryWriter (true for UTF-8 encoding, false for non-UTF-8)
  • Review existing benchmark coverage (only covers _useFastUtf8 = true path via default UTF-8 encoding, ASCII only)
  • Add benchmarks to cover both _useFastUtf8 = true and _useFastUtf8 = false paths
    • BinaryWriterExtendedTests: Added WriteNonAsciiCharArray and WriteNonAsciiString benchmarks (UTF-8, _useFastUtf8 = true with multi-byte chars)
    • BinaryWriterUnicodeEncodingTests: New class using Encoding.Unicode for Write(string) and Write(char[]) (_useFastUtf8 = false)
    • BinaryWriterUnicodeEncodingCharTests: New class using Encoding.Unicode for Write(char) (_useFastUtf8 = false)
  • Add comments explaining the significance of '\u00E0' character selection (2-byte UTF-8 encoding)
  • Run code review (no issues found)
  • Run CodeQL security check (timed out - expected for benchmark-only changes with no security implications)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

Couldn't load assignees.