Skip to content

Commit af6d9a2

Browse files
author
Martin Boje Carpentier
committed
Should now store result
1 parent 23cede7 commit af6d9a2

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

.github/workflows/continous-benchmark.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
5.0.x
2222
6.0.x
2323
# Run benchmark with `go test -bench` and stores the output to a file
24-
- name: Show locations
25-
run: ls
2624
- name: Run benchmark
2725
run: dotnet run --project ./GeoJSON.Text.Test.Benchmark/GeoJSON.Text.Test.Benchmark.csproj --framework net6 -c Release -- --job short --filter *
2826
# Download previous benchmark result from cache (if exists)
@@ -32,15 +30,24 @@ jobs:
3230
path: ./cache
3331
key: ${{ runner.os }}-benchmark
3432
# Run `github-action-benchmark` action
35-
- name: Store benchmark result
33+
- name: Store benchmark result for serialize feature collection
3634
uses: rhysd/github-action-benchmark@v1
3735
with:
3836
# What benchmark tool the output.txt came from
3937
tool: 'benchmarkdotnet'
4038
# Where the output from the benchmark tool is stored
41-
output-file-path: output.txt
42-
# Where the previous data file is stored
43-
external-data-json-path: ./cache/benchmark-data.json
39+
output-file-path: BenchmarkDotNet.Artifacts/results/GeoJSON.Text.Test.Benchmark.Serialize.SerializeFeatureCollectionLinestring-report-full-compressed.json
4440
# Workflow will fail when an alert happens
4541
fail-on-alert: true
46-
# Upload the updated cache file for the next job by actions/cache
42+
# Upload the updated cache file for the next job by actions/cache
43+
# Run `github-action-benchmark` action
44+
- name: Store benchmark result for deserialize feature collection
45+
uses: rhysd/github-action-benchmark@v1
46+
with:
47+
# What benchmark tool the output.txt came from
48+
tool: 'benchmarkdotnet'
49+
# Where the output from the benchmark tool is stored
50+
output-file-path: BenchmarkDotNet.Artifacts/results/GeoJSON.Text.Test.Benchmark.Deserialize.DeserializeFeatureCollectionLinestring-report-full-compressed.json
51+
# Workflow will fail when an alert happens
52+
fail-on-alert: true
53+
# Upload the updated cache file for the next job by actions/cache

src/GeoJSON.Text.Test.Benchmark/Deserialize/DeserializeFeatureCollectionLinestring.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public void Setup()
1919
}
2020

2121
[Benchmark]
22-
public Net.Feature.FeatureCollection DeserializeNewtonsoft() => Newtonsoft.Json.JsonConvert.DeserializeObject<Net.Feature.FeatureCollection>(fileContents ?? "")
22+
public Net.Feature.FeatureCollection DeserializeFeatureCollectionNewtonsoft() => Newtonsoft.Json.JsonConvert.DeserializeObject<Net.Feature.FeatureCollection>(fileContents ?? "")
2323
?? throw new NullReferenceException("Deserialization should not return a null value.");
2424

2525

2626
[Benchmark]
27-
public Text.Feature.FeatureCollection DeserializeSystemTextJson() => System.Text.Json.JsonSerializer.Deserialize<Text.Feature.FeatureCollection>(fileContents)
27+
public Text.Feature.FeatureCollection DeserializeFeatureCollectionSystemTextJson() => System.Text.Json.JsonSerializer.Deserialize<Text.Feature.FeatureCollection>(fileContents)
2828
?? throw new NullReferenceException("Deserialization should not return a null value.");
2929
}
3030
}

src/GeoJSON.Text.Test.Benchmark/TestConfig.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using BenchmarkDotNet.Environments;
55
using BenchmarkDotNet.Exporters;
66
using BenchmarkDotNet.Exporters.Csv;
7+
using BenchmarkDotNet.Exporters.Json;
78
using BenchmarkDotNet.Jobs;
89
using BenchmarkDotNet.Order;
910
using BenchmarkDotNet.Reports;
@@ -33,7 +34,10 @@ public TestConfig()
3334
.WithIterationCount(3)); // 3 target iteration);
3435

3536
AddColumn(RankColumn.Roman);
36-
AddExporter(CsvMeasurementsExporter.Default, RPlotExporter.Default);
37+
AddExporter(CsvMeasurementsExporter.Default,
38+
RPlotExporter.Default,
39+
JsonExporter.Full,
40+
JsonExporter.FullCompressed);
3741
AddDiagnoser(MemoryDiagnoser.Default);
3842

3943
WithOrderer(new FastestToSlowestOrderer());

src/GeoJSON.Text.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7AFBD129-E5A1-48D0-B7F6-7CCD6D06AF17}"
77
ProjectSection(SolutionItems) = preProject
88
..\.github\workflows\ci-build.yml = ..\.github\workflows\ci-build.yml
9+
..\.github\workflows\continous-benchmark.yml = ..\.github\workflows\continous-benchmark.yml
910
..\LICENSE.md = ..\LICENSE.md
1011
..\README.md = ..\README.md
1112
EndProjectSection
@@ -14,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoJSON.Text", "GeoJSON.Tex
1415
EndProject
1516
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoJSON.Text.Test.Unit", "GeoJSON.Text.Test.Unit\GeoJSON.Text.Test.Unit.csproj", "{6C93B314-9208-4684-B873-172F7EC81689}"
1617
EndProject
17-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeoJSON.Text.Test.Benchmark", "GeoJSON.Text.Test.Benchmark\GeoJSON.Text.Test.Benchmark.csproj", "{7C065EE0-D877-4D1C-AF2C-A6A6665C64DC}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoJSON.Text.Test.Benchmark", "GeoJSON.Text.Test.Benchmark\GeoJSON.Text.Test.Benchmark.csproj", "{7C065EE0-D877-4D1C-AF2C-A6A6665C64DC}"
1819
EndProject
1920
Global
2021
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0 commit comments

Comments
 (0)