surrealdb / surrealdb.net

SurrealDB SDK for .NET
https://surrealdb.com
Apache License 2.0
93 stars 18 forks source link

⚡️ add benchmark for DurationParser from int array vs. span #93

Closed Odonno closed 3 months ago

Odonno commented 7 months ago

Added 2 benchmarks method to parse Duration

Result:

| Method     | Param          | Mean         | Error      | StdDev     | Ratio | RatioSD | Gen0   | Allocated | Alloc Ratio |
|----------- |--------------- |-------------:|-----------:|-----------:|------:|--------:|-------:|----------:|------------:|
| Superpower | 0ns            |   481.745 ns |  5.3422 ns |  4.4610 ns |  1.00 |    0.00 | 0.0429 |     720 B |        1.00 |
| Pidgin     | 0ns            |   518.948 ns |  5.8655 ns |  5.4865 ns |  1.08 |    0.02 | 0.0191 |     320 B |        0.44 |
| FromSpan   | 0ns            |    32.940 ns |  0.4281 ns |  0.3795 ns |  0.07 |    0.00 | 0.0114 |     192 B |        0.27 |
| FromArray  | 0ns            |     7.218 ns |  0.1512 ns |  0.1263 ns |  0.01 |    0.00 | 0.0048 |      80 B |        0.11 |
|            |                |              |            |            |       |         |        |           |       |
| Superpower | 5y4w3h115ms4ns | 3,410.964 ns | 29.3004 ns | 25.9740 ns |  1.00 |    0.00 | 0.1831 |    3072 B |        1.00 |
| Pidgin     | 5y4w3h115ms4ns | 2,536.325 ns | 18.6825 ns | 17.4756 ns |  0.74 |    0.01 | 0.0267 |     488 B |        0.16 |
| FromSpan   | 5y4w3h115ms4ns |   128.111 ns |  0.7486 ns |  0.6251 ns |  0.04 |    0.00 | 0.0229 |     384 B |        0.12 |
| FromArray  | 5y4w3h115ms4ns |    69.696 ns |  0.4898 ns |  0.4582 ns |  0.02 |    0.00 | 0.0229 |     384 B |        0.12 |
codecov-commenter commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.32%. Comparing base (aff390a) to head (a3c5c90).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #93 +/- ## ======================================= Coverage 69.32% 69.32% ======================================= Files 110 110 Lines 4482 4482 Branches 438 438 ======================================= Hits 3107 3107 Misses 1155 1155 Partials 220 220 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.