Skip to content

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

Open
Copilot wants to merge 3 commits intomainfrom
copilot/augment-binary-writer-tests
Open

Add BinaryWriter benchmarks for _useFastUtf8 true and false code paths#5121
Copilot wants to merge 3 commits intomainfrom
copilot/augment-binary-writer-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

  • 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.

Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
Copilot AI changed the title [WIP] Augment BinaryWriterTests benchmark coverage Add BinaryWriter benchmarks for _useFastUtf8 true and false code paths Feb 16, 2026
Copilot AI requested a review from jeffhandley February 16, 2026 02:26
Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
@jeffhandley jeffhandley marked this pull request as ready for review February 16, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments