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

Add benchmarks for not bool/float/double primitive arrays. #145

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

pCYSl5EDgo
Copy link
Contributor

Current benchmark code for long[] only examines the values which would be encoded into 9 bytes in most cases.
This might lead to over-optimization on .NET runtime level and CPU arch level.

@pCYSl5EDgo
Copy link
Contributor Author

CommitId:3ba732774238b9172135fb2ac700d3891789ea4e

Method MultipleCategory Accelerated Mean Error StdDev Median Gen0 Allocated
Int8_Serialize False False 12.527 μs 0.2340 μs 0.2074 μs 12.445 μs - -
Int8_Serialize False True 6.135 μs 0.0187 μs 0.0166 μs 6.134 μs - -
Int8_Serialize True False 13.060 μs 0.2584 μs 0.5220 μs 13.182 μs - -
Int8_Serialize True True 5.778 μs 0.0978 μs 0.1306 μs 5.751 μs - -
Int16_Serialize False False 17.145 μs 0.2996 μs 0.2802 μs 17.043 μs - -
Int16_Serialize False True 9.391 μs 0.0781 μs 0.0652 μs 9.379 μs - -
Int16_Serialize True False 13.727 μs 0.2725 μs 0.2798 μs 13.625 μs - -
Int16_Serialize True True 8.047 μs 0.0642 μs 0.0601 μs 8.041 μs - -
Int32_Serialize False False 13.609 μs 0.2659 μs 0.4140 μs 13.515 μs - -
Int32_Serialize False True 12.313 μs 0.2434 μs 0.4390 μs 12.270 μs - -
Int32_Serialize True False 16.761 μs 0.2995 μs 0.3076 μs 16.787 μs - -
Int32_Serialize True True 16.057 μs 0.2573 μs 0.2407 μs 16.025 μs - -
Int64_Serialize False False 13.874 μs 0.0811 μs 0.0719 μs 13.856 μs - -
Int64_Serialize False True 9.314 μs 0.1237 μs 0.0965 μs 9.270 μs - -
Int64_Serialize True False 22.245 μs 0.1376 μs 0.1220 μs 22.254 μs - -
Int64_Serialize True True 19.422 μs 0.2838 μs 0.2654 μs 19.334 μs - -
UInt16_Serialize False False 12.796 μs 0.0291 μs 0.0272 μs 12.788 μs - -
UInt16_Serialize False True 6.420 μs 0.0169 μs 0.0158 μs 6.420 μs - -
UInt16_Serialize True False 11.722 μs 0.0385 μs 0.0321 μs 11.716 μs - -
UInt16_Serialize True True 7.871 μs 0.0220 μs 0.0195 μs 7.868 μs - -
UInt32_Serialize False False 11.681 μs 0.0529 μs 0.0469 μs 11.675 μs - -
UInt32_Serialize False True 6.305 μs 0.0195 μs 0.0173 μs 6.308 μs - -
UInt32_Serialize True False 13.841 μs 0.2360 μs 0.2092 μs 13.750 μs - -
UInt32_Serialize True True 11.307 μs 0.0479 μs 0.0448 μs 11.312 μs - -
UInt64_Serialize False False 12.765 μs 0.0219 μs 0.0204 μs 12.758 μs - -
UInt64_Serialize False True 6.426 μs 0.0103 μs 0.0096 μs 6.426 μs - -
UInt64_Serialize True False 16.327 μs 0.0628 μs 0.0587 μs 16.320 μs - -
UInt64_Serialize True True 13.499 μs 0.2675 μs 0.6146 μs 13.290 μs - -
Int8_Deserialize False False 40.912 μs 0.8083 μs 1.2820 μs 40.186 μs 1.1597 10024 B
Int8_Deserialize False True 41.592 μs 0.8243 μs 1.1556 μs 41.201 μs 1.1597 10024 B
Int8_Deserialize True False 22.697 μs 0.3013 μs 0.2352 μs 22.668 μs 1.1902 10024 B
Int8_Deserialize True True 23.563 μs 0.4057 μs 0.3168 μs 23.486 μs 1.1902 10024 B
Int16_Deserialize False False 29.758 μs 0.2264 μs 0.1891 μs 29.776 μs 2.3804 20024 B
Int16_Deserialize False True 30.095 μs 0.5636 μs 0.5536 μs 29.930 μs 2.3804 20024 B
Int16_Deserialize True False 51.549 μs 0.7337 μs 0.6863 μs 51.742 μs 2.3804 20024 B
Int16_Deserialize True True 53.990 μs 0.8923 μs 1.1603 μs 53.647 μs 2.3804 20024 B
Int32_Deserialize False False 31.815 μs 1.0380 μs 2.9276 μs 30.621 μs 4.7607 40024 B
Int32_Deserialize False True 38.274 μs 2.8955 μs 8.5375 μs 34.730 μs 4.7607 40024 B
Int32_Deserialize True False 85.063 μs 0.6525 μs 0.5785 μs 85.208 μs 4.7607 40024 B
Int32_Deserialize True True 84.948 μs 0.7719 μs 0.6027 μs 84.801 μs 4.7607 40024 B
Int64_Deserialize False False 25.597 μs 0.1626 μs 0.1521 μs 25.517 μs 9.5215 80024 B
Int64_Deserialize False True 25.985 μs 0.0797 μs 0.0706 μs 25.971 μs 9.5215 80024 B
Int64_Deserialize True False 102.368 μs 0.4098 μs 0.3833 μs 102.286 μs 9.5215 80024 B
Int64_Deserialize True True 103.035 μs 0.5793 μs 0.4838 μs 103.188 μs 9.5215 80024 B
UInt16_Deserialize False False 20.498 μs 0.0901 μs 0.0843 μs 20.522 μs 2.3804 20024 B
UInt16_Deserialize False True 20.804 μs 0.0990 μs 0.0927 μs 20.809 μs 2.3804 20024 B
UInt16_Deserialize True False 41.087 μs 0.1939 μs 0.1814 μs 41.078 μs 2.3804 20024 B
UInt16_Deserialize True True 45.570 μs 0.9072 μs 1.3010 μs 45.596 μs 2.3804 20024 B
UInt32_Deserialize False False 20.126 μs 0.0838 μs 0.0743 μs 20.117 μs 4.7607 40024 B
UInt32_Deserialize False True 20.175 μs 0.1530 μs 0.1356 μs 20.151 μs 4.7607 40024 B
UInt32_Deserialize True False 76.661 μs 1.1948 μs 1.0592 μs 76.552 μs 4.7607 40024 B
UInt32_Deserialize True True 75.040 μs 0.8359 μs 0.6981 μs 75.007 μs 4.7607 40024 B
UInt64_Deserialize False False 19.894 μs 0.1653 μs 0.1290 μs 19.921 μs 9.5215 80024 B
UInt64_Deserialize False True 19.870 μs 0.0560 μs 0.0468 μs 19.866 μs 9.5215 80024 B
UInt64_Deserialize True False 86.000 μs 0.4914 μs 0.4596 μs 86.037 μs 9.5215 80024 B
UInt64_Deserialize True True 88.205 μs 0.2382 μs 0.2228 μs 88.157 μs 9.5215 80024 B

Copy link
Owner

@AArnott AArnott left a comment

Choose a reason for hiding this comment

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

Thanks. I'll take the change, but can you first add a code comment on the new benchmark class explaining what multiple category means and why it's useful?

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.91%. Comparing base (e4e5c37) to head (d0eb3c4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   76.81%   76.91%   +0.10%     
==========================================
  Files         140      140              
  Lines        9968     9968              
  Branches     1385     1385              
==========================================
+ Hits         7657     7667      +10     
+ Misses       1906     1897       -9     
+ Partials      405      404       -1     
Flag Coverage Δ
Linux 76.91% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AArnott AArnott merged commit 11a069e into AArnott:main Dec 6, 2024
4 checks passed
@pCYSl5EDgo pCYSl5EDgo deleted the hw-benchmark branch December 6, 2024 04:18
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