Skip to content

Optimize Number.BitCount() on newer runtimes#1814

Open
stevenaw wants to merge 1 commit into
nissl-lab:masterfrom
stevenaw:optimize-number-bitcount
Open

Optimize Number.BitCount() on newer runtimes#1814
stevenaw wants to merge 1 commit into
nissl-lab:masterfrom
stevenaw:optimize-number-bitcount

Conversation

@stevenaw
Copy link
Copy Markdown

Use an intrinsic operation to count the number of set bits for builds whose runtimes support it.

Benchmarks:

Method Mean Error StdDev Median Ratio Code Size Gen0 Allocated Alloc Ratio
Original 22.6572 ns 0.1990 ns 0.1553 ns 22.6226 ns 1.000 1,697 B 0.0102 64 B 1.00
Optimized 0.0177 ns 0.0222 ns 0.0185 ns 0.0097 ns 0.001 11 B - - 0.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant