-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement IUtf8SpanFormattable on Guid #84553
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsContributes to #81500
private Guid _guid = Guid.Parse("C0513D69-6782-48C9-9542-09E133447BF2");
private char[] _chars = new char[100];
private byte[] _bytes = new byte[100];
[Benchmark] public string ToStringDefault() => _guid.ToString();
[Benchmark] public string ToStringD() => _guid.ToString("D");
[Benchmark] public string ToStringB() => _guid.ToString("B");
[Benchmark] public string ToStringN() => _guid.ToString("N");
[Benchmark] public string ToStringX() => _guid.ToString("X");
[Benchmark] public bool TryFormatD() => _guid.TryFormat(_chars, out _, "D");
[Benchmark] public bool TryFormatP() => _guid.TryFormat(_chars, out _, "P");
[Benchmark] public bool TryFormatN() => _guid.TryFormat(_chars, out _, "N");
[Benchmark] public bool Utf8FormatterDefault() => Utf8Formatter.TryFormat(_guid, _bytes, out _);
[Benchmark] public bool Utf8FormatterD() => Utf8Formatter.TryFormat(_guid, _bytes, out _, new StandardFormat('D'));
[Benchmark] public bool Utf8FormatterP() => Utf8Formatter.TryFormat(_guid, _bytes, out _, new StandardFormat('P'));
[Benchmark] public bool Utf8FormatterN() => Utf8Formatter.TryFormat(_guid, _bytes, out _, new StandardFormat('N'));
|
641984a
to
54b7025
Compare
This was rebased on the corelib additions and is ready for review. |
Contributes to #81500