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

Apply CA1837 and CA1840 #305

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

PaulusParssinen
Copy link
Contributor

@PaulusParssinen PaulusParssinen commented Apr 22, 2024

These two analyzers from Performance-category use specific intrinsic methods to fetch current ProcessId and current ThreadId which are faster. Doesn't matter for the hit in tests but reduces analyzer noise.

Might help in the ConcurrentCounter case. edit: Thread.CurrentThread.ManagedThreadId is specialized to the direct helper call too, oh well.. atleast it's little bit smaller IL I guess (2 -> 1 getter calls).. dotnet/runtime#91205 might improve things in future too.

Random note: I wonder how ThreadLocal would fare against the current cache-line partitioned ConcurrentCounter in Tsavorite (i.e. https://twitter.com/EgorBo/status/1697579906106896652) (TODO: Benchmark this)

@TedHartMS TedHartMS merged commit dc7b517 into microsoft:main Apr 24, 2024
30 checks passed
@PaulusParssinen PaulusParssinen deleted the apply-ca1837-ca1840 branch April 24, 2024 19:02
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants