Skip to content

Commit 29bd9c2

Browse files
committed
Add:Platform config
1 parent a171b3e commit 29bd9c2

File tree

4 files changed

+78
-2
lines changed

4 files changed

+78
-2
lines changed

frameworks/CSharp/touchsocket/README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,40 @@
22

33
See [touchsocket](https://touchsocket.net/) for more information.
44

5+
## Variants Included
6+
7+
* `touchsocket.webapi` (`TouchSocketWebApi`) – WebApi style.
8+
* `touchsocket.webapi31` (`TouchSocketWebApi31`) – WebApi targeting .NET 8.
9+
* `touchsocket.http` (`TouchSocketHttp`) – Minimal HTTP implementation.
10+
* `touchsocket.http31` (`TouchSocketHttp31`) – Minimal HTTP targeting .NET 8.
11+
* `touchsocket.httpplatform` (`TouchSocketHttpPlatform`) – High-performance custom pipeline-based HTTP server focusing on low-level parsing and zero-allocation response writing.
12+
513
## Infrastructure Software Versions
614

7-
**Language**
15+
**Language / Runtime**
16+
17+
* C# / .NET (8.0 & 9.0 depending on variant)
18+
19+
## Endpoints
20+
21+
All variants implement:
22+
23+
* `/plaintext` – Returns a plain text "Hello, World!" response.
24+
* `/json` – Returns a JSON object `{"message": "Hello, World!"}`.
25+
26+
The `httpplatform` variant manually parses request lines and headers via `System.IO.Pipelines` for maximum throughput.
27+
28+
## Dockerfiles
29+
30+
Each variant has a dedicated Dockerfile named:
31+
32+
* `touchsocket.dockerfile` (webapi)
33+
* `touchsocket-webapi31.dockerfile`
34+
* `touchsocket-http.dockerfile`
35+
* `touchsocket-http31.dockerfile`
36+
* `touchsocket-httpplatform.dockerfile`
37+
38+
## Notes
839

9-
* C# 8.0
40+
The `httpplatform` variant is intended for benchmarking raw server performance. It omits higher-level abstractions to reduce overhead.
1041

frameworks/CSharp/touchsocket/benchmark_config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@
7777
"display_name": "touchsocket.webapi31",
7878
"notes": "",
7979
"versus": "aspnetcore-mvc"
80+
},
81+
"httpplatform": {
82+
"plaintext_url": "/plaintext",
83+
"json_url": "/json",
84+
"port": 8080,
85+
"approach": "Realistic",
86+
"classification": "Platform",
87+
"database": "Postgres",
88+
"framework": "touchsocket.httpplatform",
89+
"language": "C#",
90+
"orm": "Micro",
91+
"platform": ".NET",
92+
"flavor": "CoreCLR",
93+
"webserver": "touchsocket",
94+
"os": "Linux",
95+
"database_os": "Linux",
96+
"display_name": "touchsocket.httpplatform",
97+
"notes": "High-performance custom pipeline-based implementation variant.",
98+
"versus": "aspnetcore"
8099
}
81100
}
82101
]

frameworks/CSharp/touchsocket/config.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@ orm = "Raw"
5252
platform = ".NET"
5353
webserver = "touchsocket.webapi31"
5454
versus = "aspcore-mvc"
55+
56+
[httpplatform]
57+
urls.plaintext = "/plaintext"
58+
urls.json = "/json"
59+
approach = "Realistic"
60+
classification = "Micro"
61+
database = "Postgres"
62+
database_os = "Linux"
63+
os = "Linux"
64+
orm = "Raw"
65+
platform = ".NET"
66+
webserver = "touchsocket.httpplatform"
67+
versus = "aspcore"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
2+
WORKDIR /app
3+
COPY src/TouchSocketHttpPlatform .
4+
RUN dotnet publish -c Release -o out
5+
6+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
7+
8+
WORKDIR /app
9+
COPY --from=build /app/out ./
10+
11+
EXPOSE 8080
12+
13+
ENTRYPOINT ["dotnet", "TouchSocketHttpPlatform.dll"]

0 commit comments

Comments
 (0)