Skip to content

Commit ce41329

Browse files
author
Petr Sramek
committed
updated benchmarks
1 parent bacad8a commit ce41329

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

benchmarks/PolylineAlgorithm.Benchmarks/DecodeBenchmark.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace PolylineAlgorithm.Benchmarks;
1515
[RankColumn]
1616
[MemoryDiagnoser]
1717
[MarkdownExporter]
18-
[Orderer(SummaryOrderPolicy.Method)]
18+
[Orderer(SummaryOrderPolicy.Declared)]
1919
public class DecodeBenchmark {
2020
private readonly Consumer _consumer = new();
2121
public static string String_Polyline { get; } = "}adrJh}}cVazlw@uykyNhaqeE`vfzG_~kY}~`eTsr{~Cwn~aOty_g@thapJvvoqKxt{sStfahDmtvmIfmiqBhjq|HujpgComs{Z}dhdKcidPymnvBqmquE~qrfI`x{lPf|ftGn~}d_@q}saAurjmu@bwr_DxrfaK~{rO~bidPwfduXwlioFlpum@twvfFpmi~VzxcsOqyejYhh|i@pbnr[twvfF_ueUujvbSa_d~ZkcnjZla~f[pmquEebxo[j}nr@xnn|H{gyiKbh{yH`oenn@y{mpIrbd~EmipgH}fuov@hjqtTp|flAttvkFrym_d@|eyCwn~aOfvdNmeawM??{yxdUcidPca{}D_atqGenzcAlra{@trgWhn{aZ??tluqOgu~sH";
@@ -29,17 +29,18 @@ public void PolylineDecoder_Decode() {
2929
decoder.Decode(in polyline).Consume(_consumer);
3030
}
3131

32+
3233
[Benchmark]
33-
public void Polyliner_Decode() {
34+
public void Cloudikka_PolylineEncoding_Decode() {
3435
string polyline = String_Polyline;
35-
var polyliner = new Polyliner();
36+
var polyliner = new PolylineEncoding();
3637
polyliner.Decode(polyline).Consume(_consumer);
3738
}
3839

3940
[Benchmark]
40-
public void Cloudikka_PolylineEncoding_Decode() {
41+
public void Polyliner_Decode() {
4142
string polyline = String_Polyline;
42-
var polyliner = new PolylineEncoding();
43+
var polyliner = new Polyliner();
4344
polyliner.Decode(polyline).Consume(_consumer);
4445
}
4546
}

benchmarks/PolylineAlgorithm.Benchmarks/EncodeBenchmark.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace PolylineAlgorithm.Benchmarks;
1515
[RankColumn]
1616
[MemoryDiagnoser]
1717
[MarkdownExporter]
18-
[Orderer(SummaryOrderPolicy.Method)]
18+
[Orderer(SummaryOrderPolicy.Declared)]
1919
public class EncodeBenchmark {
2020
public static IEnumerable<Coordinate> Coordinates_Enumerable { 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)];
2121
public static List<PolylinePoint> PolylinePoint_List { 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)];
@@ -28,15 +28,16 @@ public ReadOnlySpan<char> PolylineEncoder_Encode() {
2828
return encoder.Encode(Coordinates_Enumerable);
2929
}
3030

31-
[Benchmark]
32-
public string Polyliner_Encode() {
33-
var polyliner = new Polyliner();
34-
return polyliner.Encode(PolylinePoint_List);
35-
}
3631

3732
[Benchmark]
3833
public string Cloudikka_PolylineEncoding_Encode() {
3934
var polyliner = new PolylineEncoding();
4035
return polyliner.Encode(Tuple_Enumerable);
4136
}
37+
38+
[Benchmark]
39+
public string Polyliner_Encode() {
40+
var polyliner = new Polyliner();
41+
return polyliner.Encode(PolylinePoint_List);
42+
}
4243
}

benchmarks/PolylineAlgorithm.Benchmarks/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ namespace PolylineAlgorithm.Benchmarks;
1313
internal class Program {
1414
static void Main(string[] args) {
1515
var config = DefaultConfig.Instance
16-
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core20))
17-
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core21))
18-
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core22))
19-
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core30))
20-
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core31))
16+
//.AddJob(Job.Default.WithRuntime(CoreRuntime.Core20))
17+
//.AddJob(Job.Default.WithRuntime(CoreRuntime.Core21))
18+
//.AddJob(Job.Default.WithRuntime(CoreRuntime.Core22))
19+
//.AddJob(Job.Default.WithRuntime(CoreRuntime.Core30))
20+
//.AddJob(Job.Default.WithRuntime(CoreRuntime.Core31))
2121
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core50))
2222
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core60))
2323
.AddJob(Job.Default.WithRuntime(CoreRuntime.Core70))

0 commit comments

Comments
 (0)