Skip to content

Commit

Permalink
Release 1.0.3 (#19)
Browse files Browse the repository at this point in the history
* fixed benchmark naming
* updated benchmarks
  • Loading branch information
skrasekmichael committed Apr 15, 2024
1 parent 636ea2f commit 43d9d3f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

<Authors>Michael Škrášek</Authors>
<Copyright>Copyright Michael Škrášek</Copyright>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public TeamMember? GetTeamMember(Guid memberId)
}
```

*Note: using railway-oriented programming results in cleaner and shorter code, however, it also brings additional overhead and inability to return early from function, thus making it less performant (see [benchmarks](benchmarks/v1.0.2.StatementBenchmark.md)).*
*Note: using railway-oriented programming results in cleaner and shorter code, however, it also brings additional overhead and inability to return early from function, thus making it less performant (see [benchmarks](benchmarks/v1.0.3.StatementBenchmark.md)).*

*Learn more about [when to not use railway-oriented programming](https://fsharpforfunandprofit.com/posts/against-railway-oriented-programming/).*
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public async Task<int> FailEarlyAsync_ROP()
}

[Benchmark]
public async Task<int> FailLateEarly_Exception()
public async Task<int> FailEarlyAsync_Exception()
{
try
{
Expand Down
24 changes: 24 additions & 0 deletions benchmarks/v1.0.3.StatementBenchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22000.2538/21H2/SunValley)
Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
.NET SDK 8.0.204
[Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2
.NET 8.0 : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2
```
| Method | Mean | Error | StdDev | Median | Allocated |
|------------------------- |--------------:|--------------:|--------------:|--------------:|----------:|
| FailEarly_RP | 94.89 ns | 1.348 ns | 1.126 ns | 94.78 ns | 208 B |
| FailEarly_ROP | 173.77 ns | 7.086 ns | 20.894 ns | 160.36 ns | 480 B |
| FailEarly_Exception | 44,994.84 ns | 1,903.919 ns | 5,613.747 ns | 43,244.88 ns | 360 B |
| FailLate_RP | 101.73 ns | 4.296 ns | 12.531 ns | 93.17 ns | 208 B |
| FailLate_ROP | 172.96 ns | 7.115 ns | 20.979 ns | 161.75 ns | 480 B |
| FailLate_Exception | 40,186.82 ns | 614.771 ns | 513.361 ns | 40,076.39 ns | 360 B |
| FailEarlyAsync_RP | 179.41 ns | 7.942 ns | 23.418 ns | 176.30 ns | 352 B |
| FailEarlyAsync_ROP | 534.59 ns | 10.212 ns | 9.053 ns | 531.06 ns | 1200 B |
| FailEarlyAsync_Exception | 198,423.50 ns | 14,817.917 ns | 42,989.463 ns | 194,465.33 ns | 2384 B |
| FailLateAsync_RP | 183.84 ns | 8.554 ns | 24.680 ns | 182.01 ns | 352 B |
| FailLateAsync_ROP | 596.60 ns | 24.610 ns | 71.789 ns | 560.14 ns | 1200 B |
| FailLateAsync_Exception | 161,790.74 ns | 8,262.378 ns | 24,232.125 ns | 148,200.29 ns | 2384 B |

0 comments on commit 43d9d3f

Please sign in to comment.