Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Enable faster mod ProcessorCount at tier1 #27600

Closed
wants to merge 2 commits into from

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Nov 1, 2019

For TimerQueueTimer and TlsOverPerCoreLockedStacksArrayPool.

As with #27543 ProcCount is now a stable readonly static, using it will convert the mod into a faster version at tier1.

Just changes from #27588 to enable a faster mod vs ProcessorCount at the call sites rather than changing GetCurrentProcessorId

/cc @jkotas @VSadov

@jkotas
Copy link
Member

jkotas commented Nov 1, 2019

This looks better. Does it make a measurable difference in the public API performance?

@benaadams
Copy link
Member Author

Might be worth it for TimerQueueTimer; but for the ArrayPool its one % vs up to 2 * ProcCount CompareExchanges (Monitor Enter/Leave) so bit of a wash

@benaadams benaadams closed this Nov 1, 2019
@benaadams benaadams deleted the fastmod-jit branch November 1, 2019 19:12
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.

2 participants