Movatterモバイル変換


[0]ホーム

URL:


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

Use TryParseUInt32HexNumberStyle directly from Guid.TryParse#44918

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stephentoub merged 1 commit intodotnet:masterfromstephentoub:guidparse
Nov 20, 2020

Conversation

@stephentoub
Copy link
Member

@stephentoubstephentoub commentedNov 19, 2020
edited
Loading

Skips public entry points of uint.TryParse, including argument validation, branches for style, but most impactfully fetching the current number culture when it won't actually be needed.

Noticed while looking at startup costs, as it was causing current culture to be initialized unexpectedly.

usingBenchmarkDotNet.Attributes;usingBenchmarkDotNet.Diagnosers;usingBenchmarkDotNet.Running;usingSystem;[MemoryDiagnoser]publicclassProgram{staticvoidMain(string[]args)=>BenchmarkSwitcher.FromAssemblies(new[]{typeof(Program).Assembly}).Run(args);[Benchmark]publicboolTryParse()=>Guid.TryParse("dd16f057-4f29-495c-9f09-7201d8bee53d",out_);[Benchmark]publicboolTryParseD()=>Guid.TryParseExact("dd16f057-4f29-495c-9f09-7201d8bee53d","D",out_);[Benchmark]publicboolTryParseN()=>Guid.TryParseExact("6e76bbd10361464b980309a281d17180","N",out_);}
MethodToolchainMeanRatio
TryParse\master\corerun.exe86.38 ns1.00
TryParse\pr\corerun.exe74.42 ns0.87
TryParseD\master\corerun.exe82.14 ns1.00
TryParseD\pr\corerun.exe71.21 ns0.89
TryParseN\master\corerun.exe96.77 ns1.00
TryParseN\pr\corerun.exe60.36 ns0.62

Contributes to#44598

pentp reacted with hooray emoji
Skips public entry points of uint.TryParse, including argument validation, branches for style, but most impactfully fetching the current number culture when it won't actually be needed.
@stephentoubstephentoub added this to the6.0.0 milestoneNov 19, 2020
Copy link
Member

@danmoseleydanmoseley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we already have micro benchmark coverage?

@stephentoubstephentoub merged commitf22d7c5 intodotnet:masterNov 20, 2020
@stephentoubstephentoub deleted the guidparse branchNovember 20, 2020 15:40
@kunalspathak
Copy link
Contributor

Perf lab data shows improvements -DrewScoggins/performance-2#3513

@ghostghost locked asresolvedand limited conversation to collaboratorsDec 24, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@danmoseleydanmoseleydanmoseley approved these changes

Assignees

No one assigned

Labels

area-System.Runtimetenet-performancePerformance related issue

Projects

None yet

Milestone

6.0.0

Development

Successfully merging this pull request may close these issues.

3 participants

@stephentoub@kunalspathak@danmoseley

[8]ページ先頭

©2009-2025 Movatter.jp