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 256bit and 512bit vectorized hex decode #7226

Merged
merged 4 commits into from
Jun 27, 2024
Merged

Conversation

benaadams
Copy link
Member

Changes

  • We already have a 128bit simd path; add 256bit and 512bit simd paths

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • Yes

If yes, did you write tests?

  • Yes

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Tests & Benchmarks?

src/Nethermind/Nethermind.Core/Extensions/HexConverter.cs Outdated Show resolved Hide resolved
@benaadams
Copy link
Member Author

Method ByteLength Mean Error StdDev Median Ratio Alloc Ratio
Scalar 32 32.720 ns 0.8425 ns 1.2349 ns 32.698 ns 1.00 NA
Vector128 32 5.188 ns 0.2228 ns 0.3334 ns 5.134 ns 0.16 NA
Vector256 32 3.229 ns 0.0289 ns 0.0423 ns 3.234 ns 0.10 NA
Vector512 32 3.009 ns 0.1658 ns 0.2431 ns 3.133 ns 0.09 NA
Scalar 64 56.427 ns 0.3364 ns 0.5035 ns 56.424 ns 1.00 NA
Vector128 64 7.598 ns 0.0354 ns 0.0530 ns 7.599 ns 0.13 NA
Vector256 64 4.812 ns 0.0415 ns 0.0608 ns 4.807 ns 0.09 NA
Vector512 64 4.123 ns 0.1851 ns 0.2655 ns 4.134 ns 0.07 NA
Scalar 128 107.334 ns 0.4501 ns 0.6310 ns 107.531 ns 1.00 NA
Vector128 128 13.617 ns 0.0754 ns 0.1105 ns 13.625 ns 0.13 NA
Vector256 128 7.892 ns 0.1306 ns 0.1787 ns 7.840 ns 0.07 NA
Vector512 128 6.161 ns 0.1522 ns 0.2182 ns 6.157 ns 0.06 NA
Scalar 256 211.792 ns 0.6895 ns 1.0320 ns 211.823 ns 1.00 NA
Vector128 256 25.945 ns 0.0814 ns 0.1193 ns 25.958 ns 0.12 NA
Vector256 256 14.105 ns 0.0597 ns 0.0893 ns 14.090 ns 0.07 NA
Vector512 256 11.926 ns 0.0554 ns 0.0830 ns 11.913 ns 0.06 NA
Scalar 512 423.199 ns 2.1657 ns 3.2415 ns 422.230 ns 1.00 NA
Vector128 512 50.393 ns 0.4069 ns 0.5964 ns 50.362 ns 0.12 NA
Vector256 512 27.170 ns 0.1839 ns 0.2753 ns 27.170 ns 0.06 NA
Vector512 512 23.254 ns 0.3293 ns 0.4827 ns 22.974 ns 0.05 NA
Scalar 1024 837.884 ns 4.0460 ns 5.9305 ns 836.344 ns 1.00 NA
Vector128 1024 102.157 ns 0.3440 ns 0.5149 ns 102.196 ns 0.12 NA
Vector256 1024 50.981 ns 0.2298 ns 0.3368 ns 50.946 ns 0.06 NA
Vector512 1024 46.550 ns 0.0828 ns 0.1240 ns 46.521 ns 0.06 NA

@benaadams
Copy link
Member Author

512 likely stronger on next version of Zen

@benaadams benaadams requested a review from LukaszRozmej June 27, 2024 18:26
@benaadams benaadams merged commit 82b84b2 into master Jun 27, 2024
68 checks passed
@benaadams benaadams deleted the 256-and-512-hexdecode branch June 27, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants