Conversation
|
Tagging subscribers to this area: @dotnet/area-system-runtime |
There was a problem hiding this comment.
Pull request overview
Optimizes Guid formatting by streamlining the default ToString path and adding an AVX-512 VBMI+VL vectorized implementation for fast hex formatting, with related tweaks in Utf8Formatter for Guid.
Changes:
- Reworks
Guid.ToString/TryFormatCoreto use a flags-based fast path and adds an AVX-512 VBMI+VL implementation for D/N/B/P formats. - Refactors
Guidcomparison operators /CompareToto use unsigned comparisons for_b/_cand a big-endianulongcompare for the trailing bytes. - Updates
Utf8Formatter.TryFormat(Guid, ...)to compute and pass the newGuidformatting flags directly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Guid.cs | Adds new vectorized formatting path and adjusts comparison logic and ToString fast path to use flags-based formatting. |
| src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Utf8Formatter/Utf8Formatter.Guid.cs | Updates Utf8Formatter’s Guid formatting to use flags directly and streamline default-format handling. |
You can also share your feedback on Copilot code review. Take the survey.
...libraries/System.Private.CoreLib/src/System/Buffers/Text/Utf8Formatter/Utf8Formatter.Guid.cs
Show resolved
Hide resolved
|
This seems like a lot of churn for what amounts to about a nanosecond of savings and which will only light up on a small portion of available hardware today. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
...libraries/System.Private.CoreLib/src/System/Buffers/Text/Utf8Formatter/Utf8Formatter.Guid.cs
Show resolved
Hide resolved
I dropped the AVX-512 part and removed comparsion operator changes also (will create a separate PR for that). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
Streamline the default path and use more powerful vector intrinsics for faster formatting.
Benchmark code