Skip to content

Commit 627416d

Browse files
committed
Merge branch 'master' of github.com:TechEmpower/FrameworkBenchmarks
2 parents d1b1c53 + f99bb89 commit 627416d

Some content is hidden

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

75 files changed

+1227
-1165
lines changed

frameworks/CSharp/watson/Benchmarks/Benchmarks.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44

5-
<TargetFramework>net5.0</TargetFramework>
6-
<LangVersion>9.0</LangVersion>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<LangVersion>13.0</LangVersion>
77

88
<AssemblyTitle>EmbedIO Benchmarks</AssemblyTitle>
99
<Description>Test suite to be executed with TechEmpower FrameworkBenchmarks.</Description>
@@ -17,8 +17,8 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="System.Text.Json" Version="5.0.0" />
21-
<PackageReference Include="Watson" Version="4.0.0.3" />
20+
<PackageReference Include="System.Text.Json" Version="9.0.10" />
21+
<PackageReference Include="Watson" Version="6.4.0" />
2222
</ItemGroup>
2323

2424
</Project>

frameworks/CSharp/watson/Benchmarks/Program.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using System;
2-
using System.Linq;
3-
using System.Net;
42
using System.Text.Json;
53
using System.Threading;
64
using System.Threading.Tasks;
75

86
using WatsonWebserver;
7+
using WatsonWebserver.Core;
98

109
namespace Benchmarks
1110
{
@@ -23,7 +22,7 @@ public class JsonResult
2322

2423
public static class Program
2524
{
26-
private static readonly ManualResetEvent _WaitEvent = new ManualResetEvent(false);
25+
private static readonly ManualResetEvent WaitEvent = new(false);
2726

2827
public static async Task<int> Main(string[] args)
2928
{
@@ -33,21 +32,23 @@ public static async Task<int> Main(string[] args)
3332
var host = "tfb-server";
3433
#endif
3534

36-
using var server = new Server(host, 8080, false, DefaultRoute);
35+
var settings = new WebserverSettings(host, 8080, false);
3736

38-
server.Routes.Static.Add(HttpMethod.GET, "/plaintext", PlaintextRoute);
39-
server.Routes.Static.Add(HttpMethod.GET, "/json", JsonRoute);
37+
using var server = new Webserver(settings, DefaultRoute);
38+
39+
server.Routes.PreAuthentication.Static.Add(HttpMethod.GET, "/plaintext", PlaintextRoute);
40+
server.Routes.PreAuthentication.Static.Add(HttpMethod.GET, "/json", JsonRoute);
4041

4142
try
4243
{
4344
AppDomain.CurrentDomain.ProcessExit += (_, __) =>
4445
{
45-
_WaitEvent.Set();
46+
WaitEvent.Set();
4647
};
4748

4849
await server.StartAsync();
4950

50-
_WaitEvent.WaitOne();
51+
WaitEvent.WaitOne();
5152

5253
return 0;
5354
}
@@ -59,22 +60,21 @@ public static async Task<int> Main(string[] args)
5960
}
6061
}
6162

62-
static async Task DefaultRoute(HttpContext ctx)
63+
static async Task DefaultRoute(HttpContextBase ctx)
6364
{
6465
ctx.Response.StatusCode = 404;
65-
ctx.Response.StatusDescription = "Not Found";
6666

6767
await ctx.Response.Send("Not found.");
6868
}
6969

70-
static async Task PlaintextRoute(HttpContext ctx)
70+
static async Task PlaintextRoute(HttpContextBase ctx)
7171
{
7272
ctx.Response.Headers.Add("Content-Type", "text/plain; charset=UTF-8");
7373

7474
await ctx.Response.Send("Hello, World!");
7575
}
7676

77-
static async Task JsonRoute(HttpContext ctx)
77+
static async Task JsonRoute(HttpContextBase ctx)
7878
{
7979
var response = new JsonResult() { Message = "Hello, World!" };
8080
var serialized = JsonSerializer.Serialize(response);

frameworks/CSharp/watson/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ See the [project website](https://github.com/jchristn/WatsonWebserver) for more
66

77
**Language**
88

9-
* C# 9.0
9+
* C# 13.0
1010

1111
**Platforms**
1212

13-
* .NET 5
13+
* .NET 9
1414

1515
**Web Servers**
1616

frameworks/CSharp/watson/benchmark_config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"os": "Linux",
1717
"database_os": "Linux",
1818
"display_name": "Watson Webserver",
19-
"notes": "",
20-
"tags": ["broken"]
19+
"notes": ""
2120
}
2221
}]
2322
}

frameworks/CSharp/watson/watson.dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
22
WORKDIR /source
33

44
# copy csproj and restore as distinct layers
@@ -7,10 +7,10 @@ RUN dotnet restore -r linux-musl-x64
77

88
# copy and publish app and libraries
99
COPY Benchmarks/ .
10-
RUN dotnet publish -c release -o /app -r linux-musl-x64
10+
RUN dotnet publish -c release -o /app -r linux-musl-x64 --no-restore --self-contained
1111

1212
# final stage/image
13-
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-alpine
13+
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine
1414
WORKDIR /app
1515
COPY --from=build /app .
1616

frameworks/CSharp/wiredio/Benchmarks/Benchmarks.csproj

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

frameworks/CSharp/wiredio/Benchmarks/Program.cs

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

frameworks/CSharp/wiredio/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ See the [Wired.IO Documentation](https://mda2av.github.io/Wired.IO.Docs/) for mo
1010

1111
**Platforms**
1212

13-
* .NET 8/9
13+
* .NET 9
1414

1515
**Web Servers**
1616

1717
* [Wired.IO](https://github.com/MDA2AV/Wired.IO)
1818

19-
## Paths & Source for Tests
19+
**Engines**
2020

21-
* [Plaintext](Benchmarks/Program.cs): "/plaintext"
22-
* [JSON](Benchmarks/Program.cs): "/json"
21+
* [Wired.IO](https://github.com/MDA2AV/Wired.IO)
22+
* [Unhinged](https://github.com/MDA2AV/Unhinged)

frameworks/CSharp/wiredio/benchmark_config.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"framework": "wiredio",
3+
"maintainers": ["MDA2AV"],
34
"tests": [
45
{
56
"default": {
@@ -17,8 +18,25 @@
1718
"os": "Linux",
1819
"database_os": "Linux",
1920
"display_name": "Wired.IO",
20-
"notes": "Only plaintext and JSON benchmarks implemented"
21+
"notes": "Only plaintext and JSON benchmarks implemented yet"
22+
},
23+
"plt": {
24+
"plaintext_url": "/plaintext",
25+
"json_url": "/json",
26+
"port": 8080,
27+
"approach": "Realistic",
28+
"classification": "Platform",
29+
"database": "None",
30+
"framework": "Unhinged",
31+
"language": "C#",
32+
"orm": "None",
33+
"platform": ".NET",
34+
"webserver": "Unhinged",
35+
"os": "Linux",
36+
"database_os": "Linux",
37+
"display_name": "Wired.IO [Unhinged]",
38+
"notes": "Not a framework"
2139
}
2240
}
2341
]
24-
}
42+
}

frameworks/CSharp/wiredio/config.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,15 @@ orm = "None"
1212
platform = ".NET"
1313
webserver = "Wired.IO"
1414
versus = "None"
15+
16+
[plt]
17+
urls.plaintext = "/plaintext"
18+
urls.json = "/json"
19+
approach = "Realistic"
20+
classification = "Platform"
21+
os = "Linux"
22+
database_os = "Linux"
23+
orm = "None"
24+
platform = ".NET"
25+
webserver = "Unhinged"
26+
versus = "None"

0 commit comments

Comments
 (0)