Skip to content
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

don't always aquite lock when calling RuntimeInformation.OSArchitecture and OSArchitecture.ProcessArchitecture #39196

Merged
merged 8 commits into from
Jul 14, 2020

Conversation

adamsitnik
Copy link
Member

[Benchmark]
public Architecture OSArchitecture() => RuntimeInformation.OSArchitecture;

[Benchmark]
public Architecture ProcessArchitecture() => RuntimeInformation.ProcessArchitecture;

BEFORE:

Method Mean Error StdDev Median Min Max Gen 0 Gen 1 Gen 2 Allocated
OSArchitecture 16.202 ns 0.1181 ns 0.1105 ns 16.184 ns 16.073 ns 16.362 ns - - - -
ProcessArchitecture 16.221 ns 0.0320 ns 0.0267 ns 16.217 ns 16.180 ns 16.288 ns - - - -

AFTER:

Method Mean Error StdDev Median Min Max Gen 0 Gen 1 Gen 2 Allocated
OSArchitecture 1.059 ns 0.0073 ns 0.0065 ns 1.059 ns 1.049 ns 1.070 ns - - - -
ProcessArchitecture 1.331 ns 0.0129 ns 0.0120 ns 1.328 ns 1.314 ns 1.354 ns - - - -

@adamsitnik adamsitnik added the tenet-performance Performance related issue label Jul 13, 2020
@adamsitnik adamsitnik added this to the 5.0.0 milestone Jul 13, 2020
@adamsitnik adamsitnik requested a review from stephentoub July 13, 2020 14:59
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks :)

@adamsitnik adamsitnik merged commit 7006ff2 into dotnet:master Jul 14, 2020
@adamsitnik adamsitnik deleted the fewerLocks_RuntimeInformation branch July 14, 2020 17:08
@adamsitnik
Copy link
Member Author

@stephentoub thanks for another great review!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants