-
Notifications
You must be signed in to change notification settings - Fork 550
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
Optimize NumUtils.CRC16 #198
Conversation
Huh, |
|
@PaulusParssinen I am seeing dotnet format making changes when run locally... |
That formatting seems unfortunate 😬I'm running .NET 9 Preview which may be the reason. Testing if I can reproduce it by downgrading. $ dotnet format --version
9.0.508102+36b6b8610f4d7530bc3bc290aaf85f48012e9d7a |
Yup.. $ dotnet-format --version
8.0.453106+2651752953c0d41c8c7b8d661cf2237151af33d0
$ dotnet-format --verify-no-changes
C:\src\garnet\libs\common\NumUtils.cs(408,20): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s\s\s\s\s'. [C:\src\garnet\libs\common\Garnet.common.csproj]
C:\src\garnet\libs\common\NumUtils.cs(408,28): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s\s\s\s\s'. [C:\src\garnet\libs\common\Garnet.common.csproj]
[omitted]
C:\src\garnet\libs\common\NumUtils.cs(439,68): error WHITESPACE: Fix whitespace formatting. Replace 1 characters with '\r\n\s\s\s\s\s\s\s\s\s\s\s\s'. [C:\src\garnet\libs\common\Garnet.common.csproj]
NativeCommandExitException: Program "dotnet-format.exe" ended with non-zero exit code: 2.
$ dotnet tool install -g dotnet-format --version "9.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
Skipping NuGet package signature verification.
$ dotnet-format --version
9.0.517501+06fb492cb53e558598e9bf5ee4dd09acc5888a01
$ dotnet-format --verify-no-changes
[nothing] Well, that's annoying.. |
Agreed, that is unfortunate... |
I think this can be considered as |
Filed dotnet/sdk#39898 (dotnet format recently moved there) I will format it using .NET 8 rules and move it to end of the |
Sure, no worries! Hopefully they'll address that... |
I just realized I can just use normal array initializer to avoid the horrible formatting 😄 |
Ah excellent! |
This PR changes the
NumUtils.CRC16
method to use RVA instead ofreadonly static
for the precomputed CRC16 table.Full diff
Garnet.common.NumUtils:CRC16