若汝棋茗 fe17a488a2 Performance (touchsocket): Optimize PipeOptions scheduling to Inline (#10408) 12 hours ago
..
src fe17a488a2 Performance (touchsocket): Optimize PipeOptions scheduling to Inline (#10408) 12 hours ago
.gitignore c3132d0faa [CSharp] Add TouchSocket (#9768) 8 months ago
Benchmarks.sln 5060bd2bee Add touchsocket platform test (#10278) 4 weeks ago
README.md 5060bd2bee Add touchsocket platform test (#10278) 4 weeks ago
benchmark_config.json b0ad9a31a6 update(touchsocket):display name (#10379) 1 week ago
config.toml 5060bd2bee Add touchsocket platform test (#10278) 4 weeks ago
touchsocket-http.dockerfile ba8bfe90bb Optimization (TouchSocket): Upgrade the target framework and dependen… (#10330) 2 weeks ago
touchsocket-http31.dockerfile ba8bfe90bb Optimization (TouchSocket): Upgrade the target framework and dependen… (#10330) 2 weeks ago
touchsocket-httpplatform.dockerfile ba8bfe90bb Optimization (TouchSocket): Upgrade the target framework and dependen… (#10330) 2 weeks ago
touchsocket-webapi31.dockerfile ba8bfe90bb Optimization (TouchSocket): Upgrade the target framework and dependen… (#10330) 2 weeks ago
touchsocket.dockerfile ba8bfe90bb Optimization (TouchSocket): Upgrade the target framework and dependen… (#10330) 2 weeks ago

README.md

touchsocket benchmarks

See touchsocket for more information.

Variants Included

  • touchsocket.webapi (TouchSocketWebApi) – WebApi style.
  • touchsocket.webapi31 (TouchSocketWebApi31) – WebApi targeting .NET 8.
  • touchsocket.http (TouchSocketHttp) – Minimal HTTP implementation.
  • touchsocket.http31 (TouchSocketHttp31) – Minimal HTTP targeting .NET 8.
  • touchsocket.httpplatform (TouchSocketHttpPlatform) – High-performance custom pipeline-based HTTP server focusing on low-level parsing and zero-allocation response writing.

Infrastructure Software Versions

Language / Runtime

  • C# / .NET (8.0 & 9.0 depending on variant)

Endpoints

All variants implement:

  • /plaintext – Returns a plain text "Hello, World!" response.
  • /json – Returns a JSON object {"message": "Hello, World!"}.

The httpplatform variant manually parses request lines and headers via System.IO.Pipelines for maximum throughput.

Dockerfiles

Each variant has a dedicated Dockerfile named:

  • touchsocket.dockerfile (webapi)
  • touchsocket-webapi31.dockerfile
  • touchsocket-http.dockerfile
  • touchsocket-http31.dockerfile
  • touchsocket-httpplatform.dockerfile

Notes

The httpplatform variant is intended for benchmarking raw server performance. It omits higher-level abstractions to reduce overhead.