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

CompareTo pwrformance #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

they-see-me-unrolling
Copy link

Hallo, I noticed you have some performance problem.

Was:

BenchmarkDotNet v0.13.12, Kubuntu Linux
Intel Atom x5-Z8350 CPU 1.44GHz, 1 CPU, 4 logical and 4 physical cores
.NET SDK 8.0.108
  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
  DefaultJob : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2

| Method | matchingProbability | Mean      | Error     | StdDev    |
|------------------- |-------------------- |----------:|----------:|----------:|
| CompareToBenchmark | 0                   |  3.112 ns | 0.0110 ns | 0.0092 ns |
| CompareToBenchmark | 0.001               |  3.090 ns | 0.0151 ns | 0.0133 ns |
| CompareToBenchmark | 0.002               | 12.132 ns | 0.0189 ns | 0.0157 ns |
| CompareToBenchmark | 0.005               | 12.036 ns | 0.0138 ns | 0.0122 ns |
| CompareToBenchmark | 0.01                | 12.231 ns | 0.0908 ns | 0.0758 ns |
| CompareToBenchmark | 0.02                | 12.184 ns | 0.0327 ns | 0.0290 ns |
| CompareToBenchmark | 0.05                | 12.256 ns | 0.0258 ns | 0.0229 ns |
| CompareToBenchmark | 0.1                 | 12.277 ns | 0.0113 ns | 0.0100 ns |
| CompareToBenchmark | 0.2                 | 12.720 ns | 0.0271 ns | 0.0226 ns |
| CompareToBenchmark | 0.3                 | 13.385 ns | 0.0247 ns | 0.0206 ns |
| CompareToBenchmark | 0.5                 | 14.508 ns | 0.0555 ns | 0.0492 ns |
| CompareToBenchmark | 0.8                 | 13.859 ns | 0.0330 ns | 0.0293 ns |
| CompareToBenchmark | 0.9                 | 13.641 ns | 0.0245 ns | 0.0204 ns |
| CompareToBenchmark | 0.99                | 13.471 ns | 0.0380 ns | 0.0355 ns |
| CompareToBenchmark | 1                   | 13.546 ns | 0.0566 ns | 0.0501 ns |

Become:

| Method             | matchingProbability | Mean     | Error     | StdDev    |
|------------------- |-------------------- |---------:|----------:|----------:|
| CompareToBenchmark | 0                   | 2.610 ns | 0.0120 ns | 0.0112 ns |
| CompareToBenchmark | 0.001               | 2.717 ns | 0.0124 ns | 0.0104 ns |
| CompareToBenchmark | 0.002               | 2.765 ns | 0.0113 ns | 0.0094 ns |
| CompareToBenchmark | 0.005               | 2.791 ns | 0.0060 ns | 0.0050 ns |
| CompareToBenchmark | 0.01                | 2.764 ns | 0.0121 ns | 0.0107 ns |
| CompareToBenchmark | 0.02                | 2.914 ns | 0.0165 ns | 0.0137 ns |
| CompareToBenchmark | 0.05                | 3.327 ns | 0.0211 ns | 0.0197 ns |
| CompareToBenchmark | 0.1                 | 3.943 ns | 0.0087 ns | 0.0077 ns |
| CompareToBenchmark | 0.2                 | 5.310 ns | 0.0189 ns | 0.0167 ns |
| CompareToBenchmark | 0.3                 | 6.685 ns | 0.0893 ns | 0.0835 ns |
| CompareToBenchmark | 0.5                 | 7.771 ns | 0.0265 ns | 0.0248 ns |
| CompareToBenchmark | 0.8                 | 5.015 ns | 0.0158 ns | 0.0124 ns |
| CompareToBenchmark | 0.9                 | 4.033 ns | 0.0309 ns | 0.0274 ns |
| CompareToBenchmark | 0.99                | 3.096 ns | 0.0276 ns | 0.0258 ns |
| CompareToBenchmark | 1                   | 2.986 ns | 0.0293 ns | 0.0274 ns |

Don't know why first two are small, maybe a bad cpu.

Hope I didn't break anything,I mostly python developer.

{
new byte[]
{
237,

Choose a reason for hiding this comment

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

in case somebody uses long instead of ulong

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.

1 participant