Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Copilot wants to merge 3 commits into
main from
copilot/augment-binary-writer-tests
Open

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

Conversation

Copilot AI commented Feb 16, 2026
edited
Loading

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.

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
Comment thread src/benchmarks/micro/libraries/System.IO/BinaryWriterTests.cs
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

Reviewers

@adamsitnik adamsitnik Awaiting requested review from adamsitnik
1 more reviewer
@jeffhandley jeffhandley jeffhandley approved these changes
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /