Skip to content

Commit 49ec139

Browse files
committed
Merge branch 'main' into FortunesRazorComponentResult
2 parents 20301ed + 80aab30 commit 49ec139

File tree

6 files changed

+74
-54
lines changed

6 files changed

+74
-54
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ASP.NET Benchmarks CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- "**/*.md"
8+
9+
pull_request:
10+
paths-ignore:
11+
- "**/*.md"
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest]
20+
runs-on: ${{ matrix.os }}
21+
name: Build & Test
22+
env:
23+
DOTNET_CLI_TELEMETRY_OPTOUT: true
24+
DOTNET_NOLOGO: true
25+
SuppressNETCoreSdkPreviewMessage: true
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Install .NET SDK (global.json)
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
global-json-file: global.json
33+
34+
- name: Print .NET info
35+
run: dotnet --info
36+
37+
- name: Build
38+
run: dotnet build ./src/BenchmarksApps.sln
39+
40+
- name: Test
41+
run: >
42+
dotnet test ./src/BenchmarksApps.sln
43+
--no-build --logger console --logger trx --logger html --logger GitHubActions
44+
--results-directory ./TestResults --blame
45+
46+
- name: Publish Test Results
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: TestResults_${{ matrix.os }}
50+
path: ./TestResults

.github/workflows/pr.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Custom
22
.build/
33
.vscode/
4-
global.json
54

65
## Ignore Visual Studio temporary files, build results, and
76
## files generated by popular Visual Studio add-ons.

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.100",
4+
"rollForward": "latestMajor"
5+
}
6+
}

src/BenchmarksApps/TechEmpower/PlatformBenchmarks/BenchmarkApplication.Fortunes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ await RawDb.LoadFortunesRows(),
2424

2525
private async Task FortunesDapper(PipeWriter pipeWriter)
2626
{
27-
await OutputFortunes(pipeWriter, await DapperDb.LoadFortunesRows(), Templates.FortunesUtf8.Create);
27+
await OutputFortunes(pipeWriter, await DapperDb.LoadFortunesRows(), Templates.FortunesUtf16.Create);
2828
}
2929

3030
private async Task FortunesEf(PipeWriter pipeWriter)
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Threading.Tasks;
43
using Dapper;
54
using Npgsql;
65

7-
namespace PlatformBenchmarks
6+
namespace PlatformBenchmarks;
7+
8+
public sealed class DapperDb
89
{
9-
public sealed class DapperDb
10-
{
11-
private readonly string _connectionString;
10+
private readonly string _connectionString;
1211

13-
public DapperDb(AppSettings appSettings)
14-
=> _connectionString = appSettings.ConnectionString;
12+
public DapperDb(AppSettings appSettings)
13+
=> _connectionString = appSettings.ConnectionString;
1514

16-
public async Task<List<FortuneUtf16>> LoadFortunesRows()
17-
{
18-
List<FortuneUtf16> result;
15+
public async Task<List<FortuneUtf16>> LoadFortunesRows()
16+
{
17+
List<FortuneUtf16> result;
1918

20-
using (var db = new NpgsqlConnection(_connectionString))
21-
{
22-
// Note: don't need to open connection if only doing one thing; let dapper do it
23-
result = (await db.QueryAsync<FortuneUtf16>("SELECT id, message FROM fortune")).AsList();
24-
}
19+
using (var db = new NpgsqlConnection(_connectionString))
20+
{
21+
// Note: don't need to open connection if only doing one thing; let dapper do it
22+
result = (await db.QueryAsync<FortuneUtf16>("SELECT id, message FROM fortune")).AsList();
23+
}
2524

26-
result.Add(new FortuneUtf16(id: 0, message: "Additional fortune added at request time." ));
27-
result.Sort();
25+
result.Add(new FortuneUtf16(id: 0, message: "Additional fortune added at request time." ));
26+
result.Sort();
2827

29-
return result;
30-
}
28+
return result;
3129
}
3230
}

0 commit comments

Comments
 (0)