Skip to content

Commit b355a48

Browse files
author
Petr Sramek
committed
refactoring
1 parent a5ee525 commit b355a48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+135
-963
lines changed

Diff for: PolylineAlgorithm.slnx

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
</Folder>
66
<Folder Name="/samples/" />
77
<Folder Name="/src/">
8-
<Project Path="src/PolylineAlgorithm.Abstraction/PolylineAlgorithm.Abstraction.csproj" />
9-
<Project Path="src/PolylineAlgorithm.IO.Pipelines/PolylineAlgorithm.IO.Pipelines.csproj" />
108
<Project Path="src/PolylineAlgorithm/PolylineAlgorithm.csproj" />
119
</Folder>
1210
<Folder Name="/tests/">
11+
<File Path="tests/Directory.Build.props" />
1312
<Project Path="tests/PolylineAlgorithm.Tests/PolylineAlgorithm.Tests.csproj" />
1413
</Folder>
1514
</Solution>

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/AsyncReadWriteBenchmark.cs

-129
This file was deleted.

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/Internal/CoordinateFactory.cs

-9
This file was deleted.

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/Internal/ValueProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
public static class ValueProvider {
55
private static readonly ConcurrentDictionary<int, CoordinatePair> _cache = new();
6-
private static readonly PolylineEncoder _encoder = new();
6+
private static readonly DefaultPolylineEncoder _encoder = new();
77

88
public static IEnumerable<Coordinate> GetCoordinates(int count) {
99
var entry = GetCaheEntry(count);

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/PolylineBenchmark.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace PolylineAlgorithm.Benchmarks;
99
using BenchmarkDotNet.Engines;
1010
using PolylineAlgorithm;
1111
using PolylineAlgorithm.Benchmarks.Internal;
12-
using System.Text;
1312

1413
/// <summary>
1514
/// Benchmarks for the <see cref="PolylineValue"/> struct.
@@ -18,7 +17,7 @@ namespace PolylineAlgorithm.Benchmarks;
1817
public class PolylineBenchmark {
1918
private static readonly Consumer consumer = new();
2019

21-
[Params(1, 10, 100, 1_000, 10_000, 100_000, 1_000_000)]
20+
[Params(1, 10, 100, 250, 500, 1_000, 2_500, 5_000, 7_500, 10_000, 15_000, 20_000, 25_000, 50_000, 75_000, 100_000, 250_000, 500_000, 750_000, 1_000_000)]
2221
public int Length;
2322

2423
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/PolylineDecoderBenchmark.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ namespace PolylineAlgorithm.Benchmarks;
88
using BenchmarkDotNet.Attributes;
99
using BenchmarkDotNet.Engines;
1010
using PolylineAlgorithm;
11-
using PolylineAlgorithm.Abstraction;
1211
using PolylineAlgorithm.Benchmarks.Internal;
13-
using System.Text;
12+
using PolylineAlgorithm.Extensions;
1413

1514
/// <summary>
1615
/// Benchmarks for the <see cref="PolylineDecoder"/> class.
@@ -19,7 +18,7 @@ namespace PolylineAlgorithm.Benchmarks;
1918
public class PolylineDecoderBenchmark {
2019
private readonly Consumer _consumer = new();
2120

22-
[Params(1, 10, 100, 1_000, 10_000, 100_000, 1_000_000)]
21+
[Params(1, 10, 100, 250, 500, 1_000, 2_500, 5_000, 7_500, 10_000, 15_000, 20_000, 25_000, 50_000, 75_000, 100_000, 250_000, 500_000, 750_000, 1_000_000)]
2322
public int N;
2423

2524
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
@@ -43,7 +42,7 @@ public class PolylineDecoderBenchmark {
4342
/// <summary>
4443
/// The polyline decoder instance.
4544
/// </summary>
46-
public PolylineDecoder<Coordinate> Decoder = new(new CoordinateFactory());
45+
public DefaultPolylineDecoder Decoder = new();
4746

4847
/// <summary>
4948
/// Sets up the data for the benchmarks.

Diff for: benchmarks/PolylineAlgorithm.Benchmarks/PolylineEncoderBenchmark.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace PolylineAlgorithm.Benchmarks;
1616
/// </summary>
1717
[RankColumn]
1818
public class PolylineEncoderBenchmark {
19-
[Params(1, 10, 100, 1_000, 10_000, 100_000, 1_000_000)]
19+
[Params(1, 10, 100, 250, 500, 1_000, 2_500, 5_000, 7_500, 10_000, 15_000, 20_000, 25_000, 50_000, 75_000, 100_000, 250_000, 500_000, 750_000, 1_000_000)]
2020
public int N;
2121

2222
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
@@ -36,7 +36,7 @@ public class PolylineEncoderBenchmark {
3636
/// <summary>
3737
/// The polyline encoder instance.
3838
/// </summary>
39-
public PolylineEncoder Encoder = new();
39+
public DefaultPolylineEncoder Encoder = new();
4040

4141
/// <summary>
4242
/// The async polyline encoder instance.

Diff for: benchmarks/PolylineAlgorithm.Comparison.Benchmarks/Internal/CoordinateFactory.cs

-9
This file was deleted.

Diff for: benchmarks/PolylineAlgorithm.Comparison.Benchmarks/Internal/ValueProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
public static class ValueProvider {
55
private static readonly ConcurrentDictionary<int, CoordinatePair> _cache = new();
6-
private static readonly PolylineEncoder _encoder = new();
6+
private static readonly DefaultPolylineEncoder _encoder = new();
77

88
public static IEnumerable<Coordinate> GetCoordinates(int count) {
99
var entry = GetCaheEntry(count);

Diff for: benchmarks/PolylineAlgorithm.Comparison.Benchmarks/PolylineDecoderBenchmark.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace PolylineAlgorithm.Comparison.Benchmarks;
1010
using global::PolylineEncoder.Net.Utility;
1111
using PolylineAlgorithm;
1212
using PolylineAlgorithm.Comparison.Benchmarks.Internal;
13+
using PolylineAlgorithm.Extensions;
1314
using PolylinerNet;
1415
using PolylineEncoding = Cloudikka.PolylineAlgorithm.Encoding.PolylineEncoding;
1516

@@ -20,7 +21,7 @@ namespace PolylineAlgorithm.Comparison.Benchmarks;
2021
public class PolylineDecoderBenchmark {
2122
private readonly Consumer _consumer = new();
2223

23-
[Params(1, 10, 100, 1_000, 10_000, 100_000, 1_000_000)]
24+
[Params(1, 10, 100, 250, 500, 1_000, 2_500, 5_000, 7_500, 10_000, 15_000, 20_000, 25_000, 50_000, 75_000, 100_000, 250_000, 500_000, 750_000, 1_000_000)]
2425
public int N;
2526

2627
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
@@ -39,7 +40,7 @@ public class PolylineDecoderBenchmark {
3940
/// <summary>
4041
/// The polyline decoder instance.
4142
/// </summary>
42-
public PolylineDecoder<Coordinate> PolylineAlgorithm = new(new CoordinateFactory());
43+
public DefaultPolylineDecoder PolylineAlgorithm = new();
4344

4445
public PolylineEncoding Cloudikka = new();
4546

Diff for: benchmarks/PolylineAlgorithm.Comparison.Benchmarks/PolylineEncoderBenchmark.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class PolylineEncoderBenchmark {
3939
/// <summary>
4040
/// The polyline encoder instance.
4141
/// </summary>
42-
public PolylineEncoder PolylineAlgorithm = new();
42+
public DefaultPolylineEncoder PolylineAlgorithm = new();
4343

4444
public PolylineEncoding Cloudikka = new();
4545

Diff for: src/PolylineAlgorithm.Abstraction/Defaults.cs

-112
This file was deleted.

0 commit comments

Comments
 (0)