Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frameworks/CSharp/simplew/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>SimpleW</RootNamespace>
Expand All @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SimpleW" Version="16.1.0" />
<PackageReference Include="SimpleW" Version="26.0.0-beta.20260213-1430" />
</ItemGroup>

</Project>
52 changes: 19 additions & 33 deletions frameworks/CSharp/simplew/Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,25 @@ internal static class Program
{
public static async Task Main(string[] args)
{
var server = new SimpleWServer(IPAddress.Any, 8080);
server.AddDynamicContent("/api");
server.Start();
SimpleWServer server = new(IPAddress.Any, 8080);

await Task.Delay(-1);
// minimal api
server.MapGet("/json", (HttpSession session) => {
return session.Response
.Json(new { message = "Hello, World!" })
.AddHeader("Server", "SimpleW")
.AddHeader("Date", DateTime.Now.ToString("R"))
.NoCompression();
});
server.MapGet("/plaintext", (HttpSession session) => {
return session.Response
.Text("Hello, World!")
.AddHeader("Server", "SimpleW")
.AddHeader("Date", DateTime.Now.ToString("R"))
.NoCompression();
});

await server.RunAsync();
}

public class BenchmarksController : Controller {
[Route("GET", "/json")]
public object Json() {
return Response.MakeResponse(
new { message = "Hello, World!" }, // object will be serialized
addHeaders: new Dictionary<string, string>()
{
{ "Server", "SimpleW" },
{ "Date", DateTime.Now.ToString("R") }
}
// compress parameter is default to null, so no compression
);
}

[Route("GET", "/plaintext")]
public object Plaintext() {
return Response.MakeResponse(
"Hello, World!",
"text/plain",
addHeaders: new Dictionary<string, string>()
{
{ "Server", "SimpleW" },
{ "Date", DateTime.Now.ToString("R") }
}
// compress parameter is default to null, so no compression
);
}
}
}
}
6 changes: 3 additions & 3 deletions frameworks/CSharp/simplew/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SimpleW Tests on Linux

See the [SimpleW website](https://stratdev3.github.io/SimpleW/) for more information.
See the [SimpleW website](https://simplew.net) for more information.

## Infrastructure Software Versions

Expand All @@ -10,9 +10,9 @@ See the [SimpleW website](https://stratdev3.github.io/SimpleW/) for more informa

**Platforms**

* .NET 8/9
* .NET 8/9/10

## Paths & Source for Tests

* [Plaintext](Benchmarks/Program.cs): "/api/plaintext"
* [JSON](Benchmarks/Tests/JsonResource.cs): "/api/json"
* [JSON](Benchmarks/Tests/JsonResource.cs): "/api/json"
3 changes: 2 additions & 1 deletion frameworks/CSharp/simplew/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"framework": "simplew",
"maintainers": ["stratdev3"],
"tests": [{
"default": {
"plaintext_url": "/api/plaintext",
Expand All @@ -12,7 +13,7 @@
"language": "C#",
"orm": "None",
"platform": ".NET",
"webserver": "Netcoreserver",
"webserver": "SimpleW",
"os": "Linux",
"database_os": "Linux",
"display_name": "SimpleW",
Expand Down
4 changes: 2 additions & 2 deletions frameworks/CSharp/simplew/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ os = "Linux"
database_os = "Linux"
orm = "None"
platform = ".NET"
webserver = "Netcoreserver"
versus = "None"
webserver = "SimpleW"
versus = "None"
4 changes: 2 additions & 2 deletions frameworks/CSharp/simplew/simplew.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
WORKDIR /source

# copy csproj and restore as distinct layers
Expand All @@ -10,7 +10,7 @@ COPY Benchmarks/ .
RUN dotnet publish -c release -o /app -r linux-musl-x64 --no-restore --self-contained

# final stage/image
FROM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine

ENV DOTNET_GCDynamicAdaptationMode=0
ENV DOTNET_ReadyToRun=0
Expand Down
Loading