Skip to content

Commit 30eadac

Browse files
author
Petr Sramek
committed
Revert "refacroteed benchmarks"
This reverts commit 3b4b275.
1 parent 3b4b275 commit 30eadac

File tree

4 files changed

+14
-24
lines changed

4 files changed

+14
-24
lines changed

.github/workflows/dotnet.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
strategy:
6161
matrix:
6262
os: [ubuntu-latest, windows-latest, macos-latest]
63+
netversion: [7, 8, 9]
6364

6465
concurrency:
6566
group: benchmark
@@ -69,26 +70,23 @@ jobs:
6970

7071
steps:
7172
- uses: actions/checkout@v3
72-
- name: Setup .NET 7
73+
- name: Setup .NET ${{ matrix.netversion }}
7374
uses: actions/setup-dotnet@v3
7475
with:
75-
dotnet-version: 7.x
76-
- name: Setup .NET 8
77-
uses: actions/setup-dotnet@v3
78-
with:
79-
dotnet-version: 8.x
80-
- name: Setup .NET 9
81-
uses: actions/setup-dotnet@v3
82-
with:
83-
dotnet-version: 9.x
76+
dotnet-version: ${{ matrix.netversion }}.x
77+
- name: Fix libssl
78+
if: ${{ matrix.netversion == 5 && matrix.os == 'ubuntu-latest' }}
79+
run: |
80+
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
81+
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb
8482
- uses: actions/download-artifact@v4
8583
with:
8684
name: build
8785
path: .
8886
merge-multiple: true
8987
- name: Decode Benchmark
9088
working-directory: ./benchmarks/PolylineAlgorithm.Benchmarks
91-
run: dotnet run --configuration Release
89+
run: dotnet run --configuration Release --framework net${{ matrix.netversion }}.0 --filter '*DecodeBenchmark*'
9290
- name: Encode Benchmark
9391
working-directory: ./benchmarks/PolylineAlgorithm.Benchmarks
94-
run: dotnet run --configuration Release
92+
run: dotnet run --configuration Release --framework net${{ matrix.netversion }}.0 --filter '*EncodeBenchmark*'

benchmarks/PolylineAlgorithm.Benchmarks/DecodeBenchmark.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ namespace PolylineAlgorithm.Benchmarks;
77

88
using BenchmarkDotNet.Attributes;
99
using BenchmarkDotNet.Engines;
10-
using BenchmarkDotNet.Jobs;
1110
using BenchmarkDotNet.Order;
1211
using Cloudikka.PolylineAlgorithm.Encoding;
1312
using PolylineAlgorithm;
1413
using PolylinerNet;
14+
using System.Collections.Generic;
1515

1616
[RankColumn]
1717
[MemoryDiagnoser]
18-
[SimpleJob(RuntimeMoniker.Net70, baseline: true)]
19-
[SimpleJob(RuntimeMoniker.Net80)]
20-
[SimpleJob(RuntimeMoniker.Net90)]
2118
[Orderer(SummaryOrderPolicy.Default)]
2219
public class DecodeBenchmark {
2320
private readonly Consumer _consumer = new();

benchmarks/PolylineAlgorithm.Benchmarks/EncodeBenchmark.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace PolylineAlgorithm.Benchmarks;
77

88
using BenchmarkDotNet.Attributes;
99
using BenchmarkDotNet.Engines;
10-
using BenchmarkDotNet.Jobs;
1110
using BenchmarkDotNet.Order;
1211
using Cloudikka.PolylineAlgorithm.Encoding;
1312
using PolylineAlgorithm;
@@ -16,9 +15,6 @@ namespace PolylineAlgorithm.Benchmarks;
1615

1716
[RankColumn]
1817
[MemoryDiagnoser]
19-
[SimpleJob(RuntimeMoniker.Net70, baseline: true)]
20-
[SimpleJob(RuntimeMoniker.Net80)]
21-
[SimpleJob(RuntimeMoniker.Net90)]
2218
[Orderer(SummaryOrderPolicy.Default)]
2319
public class EncodeBenchmark {
2420
public static IEnumerable<Coordinate> PolylineAlgorithm_Coordinates { get; } = [new(60.81071, -121.40005), new(70.05664, -38.43130), new(37.52379, -84.83755), new(41.85003, 26.25620), new(68.04709, 110.63120), new(61.48922, 50.16245), new(-4.46018, -58.11880), new(-32.16061, -3.27505), new(-50.89185, -55.30630), new(-28.52070, 90.94370), new(35.26009, 93.75620), new(54.83622, 128.91245), new(1.16022, 37.50620), new(-44.26398, -131.24380), new(-33.34325, 154.22495), new(-59.65879, 90.94370), new(-62.38215, 0.94370), new(72.32117, 40.31870), new(64.66910, 2.34995), new(-61.04971, -84.83755), new(77.10238, -91.86880), new(-72.88859, -129.83755), new(-69.24987, -24.36880), new(77.41254, 119.06870), new(-70.69409, 83.91245), new(78.85650, 75.47495), new(26.83989, 140.16245), new(-24.75069, -108.74380), new(30.53968, -145.30630), new(79.12503, 145.78745), new(-34.51006, 133.13120), new(-73.29753, -60.93130), new(-74.08712, 23.44370), new(-76.57404, 100.78745), new(-76.57404, 100.78745), new(39.72082, 103.59995), new(70.99412, 148.59995), new(82.27591, 138.75620), new(78.29964, -3.27505), new(78.29964, -3.27505), new(-8.65039, 47.34995)];

benchmarks/PolylineAlgorithm.Benchmarks/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ namespace PolylineAlgorithm.Benchmarks;
99

1010
internal class Program {
1111
static void Main(string[] args) {
12-
BenchmarkRunner
13-
.Run<EncodeBenchmark>();
14-
BenchmarkRunner
15-
.Run<DecodeBenchmark>();
12+
BenchmarkSwitcher
13+
.FromAssembly(typeof(Program).Assembly)
14+
.Run(args);
1615
}
1716
}

0 commit comments

Comments
 (0)