Skip to content

Conversation

@bitfaster
Copy link
Owner

@bitfaster bitfaster commented Sep 22, 2022

Unroll the reset loop to improve throughput. Not earth shattering, but worth almost 1 ms for a 1 million element table.

Method Size Mean Error StdDev Ratio
Reset1 4 8.893 ns 0.0390 ns 0.0304 ns 1.00
Reset2 4 6.170 ns 0.0873 ns 0.0816 ns 0.70
Reset4 4 5.883 ns 0.0722 ns 0.0675 ns 0.66
Reset1 128 282.571 ns 2.4478 ns 2.2896 ns 1.00
Reset2 128 176.850 ns 0.7743 ns 0.6045 ns 0.63
Reset4 128 160.341 ns 0.9347 ns 0.7806 ns 0.57
Reset1 8192 17,454.963 ns 84.2848 ns 74.7163 ns 1.00
Reset2 8192 10,810.292 ns 36.0139 ns 30.0733 ns 0.62
Reset4 8192 10,252.838 ns 36.5366 ns 30.5097 ns 0.59
Reset1 1048576 2,258,716.657 ns 7,187.0479 ns 6,371.1308 ns 1.00
Reset2 1048576 1,481,100.085 ns 28,584.5228 ns 28,073.8235 ns 0.66
Reset4 1048576 1,391,683.608 ns 13,086.8858 ns 11,601.1834 ns 0.62

@bitfaster bitfaster mentioned this pull request Sep 26, 2022
@bitfaster bitfaster merged commit 2bc47a5 into main Sep 28, 2022
@bitfaster bitfaster deleted the users/alexpeck/reset2 branch September 28, 2022 05:29
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.

2 participants