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

Code and project cleanup #61

Merged
merged 10 commits into from
Apr 2, 2022
Merged

Code and project cleanup #61

merged 10 commits into from
Apr 2, 2022

Conversation

manigandham
Copy link
Collaborator

No description provided.

src/Hashids.net/Hashids.net.csproj Outdated Show resolved Hide resolved
test/Hashids.net.test/Hashids.net.test.csproj Outdated Show resolved Hide resolved
@KeterSCP
Copy link
Contributor

KeterSCP commented Apr 1, 2022

Should this also be refactored?

/// <remarks>This method uses <c>out</c> params instead of returning a ValueTuple so it works with .NET 4.6.1.</remarks>

@manigandham
Copy link
Collaborator Author

Should this also be refactored?

/// <remarks>This method uses <c>out</c> params instead of returning a ValueTuple so it works with .NET 4.6.1.</remarks>

Yes, that's done.

src/Hashids.net/Hashids.cs Outdated Show resolved Hide resolved
@manigandham
Copy link
Collaborator Author

manigandham commented Apr 2, 2022

Some slight performance improvements. Considering this to be more than enough optimization at this point.

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
AMD Ryzen 9 3900X, 1 CPU, 24 logical and 12 physical cores
.NET SDK=6.0.201
  [Host]     : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
  Job-NSPSJG : .NET 5.0.15 (5.0.1522.11506), X64 RyuJIT
  Job-GOGBQN : .NET 6.0.3 (6.0.322.12309), X64 RyuJIT
  Job-PKPZSW : .NET Framework 4.8 (4.8.4470.0), X64 RyuJIT

OutlierMode=DontRemove  MemoryRandomization=True
|               Method |        Job |            Runtime |       Mean |    Error |   StdDev |  Gen 0 | Code Size | Allocated |
|--------------------- |----------- |------------------- |-----------:|---------:|---------:|-------:|----------:|----------:|
|        RoundtripInts | Job-XEDAQS |           .NET 5.0 | 3,642.3 ns | 71.33 ns | 70.06 ns | 0.0610 |      50 B |     512 B |
|       RoundtripLongs | Job-XEDAQS |           .NET 5.0 | 4,161.7 ns | 72.26 ns | 67.59 ns | 0.0610 |   3,310 B |     512 B |
|         RoundtripHex | Job-XEDAQS |           .NET 5.0 | 3,554.4 ns | 67.29 ns | 66.08 ns | 0.1602 |      49 B |   1,344 B |
|         SingleNumber | Job-XEDAQS |           .NET 5.0 |   795.3 ns | 15.07 ns | 16.75 ns | 0.0076 |     153 B |      64 B |
| SingleNumberAsParams | Job-XEDAQS |           .NET 5.0 |   842.3 ns | 12.04 ns | 11.26 ns | 0.0191 |   2,059 B |     160 B |
|                      |            |                    |            |          |          |        |           |           |
|        RoundtripInts | Job-FYFVBK |           .NET 6.0 | 3,596.6 ns | 61.46 ns | 57.49 ns | 0.0610 |      50 B |     512 B |
|       RoundtripLongs | Job-FYFVBK |           .NET 6.0 | 4,049.1 ns | 80.22 ns | 95.50 ns | 0.0610 |   3,256 B |     512 B |
|         RoundtripHex | Job-FYFVBK |           .NET 6.0 | 3,338.9 ns | 20.16 ns | 18.86 ns | 0.1602 |      49 B |   1,344 B |
|         SingleNumber | Job-FYFVBK |           .NET 6.0 |   772.8 ns | 12.47 ns | 11.66 ns | 0.0076 |     145 B |      64 B |
| SingleNumberAsParams | Job-FYFVBK |           .NET 6.0 |   852.2 ns | 16.66 ns | 16.36 ns | 0.0191 |   2,042 B |     160 B |
|                      |            |                    |            |          |          |        |           |           |
|        RoundtripInts | Job-TPPQKV | .NET Framework 4.8 | 4,022.2 ns | 33.66 ns | 31.48 ns | 0.1221 |      51 B |     794 B |
|       RoundtripLongs | Job-TPPQKV | .NET Framework 4.8 | 4,625.8 ns | 39.48 ns | 36.93 ns | 0.1373 |   4,993 B |     907 B |
|         RoundtripHex | Job-TPPQKV | .NET Framework 4.8 | 5,241.2 ns | 55.17 ns | 51.60 ns | 0.2747 |      52 B |   1,781 B |
|         SingleNumber | Job-TPPQKV | .NET Framework 4.8 |   982.6 ns | 19.00 ns | 21.12 ns | 0.0362 |   3,240 B |     241 B |
| SingleNumberAsParams | Job-TPPQKV | .NET Framework 4.8 |   992.3 ns | 12.64 ns | 11.82 ns | 0.0362 |   3,240 B |     241 B |

@manigandham manigandham self-assigned this Apr 2, 2022
@manigandham manigandham merged commit a4a1688 into master Apr 2, 2022
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