Skip to content
Merged
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
19 changes: 2 additions & 17 deletions frameworks/genhttp-11/Project.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System.IO.Compression;
using GenHTTP.Api.Content;

using GenHTTP.Api.Content;
using GenHTTP.Modules.Compression;
using GenHTTP.Modules.IO;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.Layouting.Provider;
using GenHTTP.Modules.ServerCaching;
using GenHTTP.Modules.Webservices;
using GenHTTP.Modules.Websockets;

Expand Down Expand Up @@ -38,19 +35,7 @@ private static LayoutBuilder AddStaticFiles(this LayoutBuilder app)
{
if (Directory.Exists("/data/static"))
{
var tree = ResourceTree.FromDirectory("/data/static");

var compression = CompressedContent.Default()
.Level(CompressionLevel.Optimal);

var cache = ServerCache.TemporaryFiles()
.Invalidate(true);

var handler = Resources.From(tree) // serve static resources
.Add(compression) // compress them on-the-fly
.Add(cache); // cache the compressed results

app.Add("static", handler);
app.Add("static", Resources.From(ResourceTree.FromDirectory("/data/static")));
}

return app;
Expand Down
4 changes: 3 additions & 1 deletion frameworks/genhttp-11/Tests/EchoHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

namespace genhttp.Tests;

class EchoHandler : IImperativeHandler
public sealed class EchoHandler : IImperativeHandler
{

public async ValueTask HandleAsync(IImperativeConnection connection)
{
while (true)
Expand All @@ -20,4 +21,5 @@ public async ValueTask HandleAsync(IImperativeConnection connection)
}
}
}

}
16 changes: 9 additions & 7 deletions frameworks/genhttp-11/genhttp.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>true</ServerGarbageCollection>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>

<PackageReference Include="GenHTTP.Core" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.Compression" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.ServerCaching" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.IO" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.Layouting" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.Webservices" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Modules.Websockets" Version="11.0.0-preview.8" />
<PackageReference Include="GenHTTP.Core" Version="11.0.0-preview.10" />
<PackageReference Include="GenHTTP.Modules.Compression" Version="11.0.0-preview.10" />
<PackageReference Include="GenHTTP.Modules.IO" Version="11.0.0-preview.10" />
<PackageReference Include="GenHTTP.Modules.Layouting" Version="11.0.0-preview.10" />
<PackageReference Include="GenHTTP.Modules.Webservices" Version="11.0.0-preview.10" />
<PackageReference Include="GenHTTP.Modules.Websockets" Version="11.0.0-preview.10" />

<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.8" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.8" />

<PackageReference Include="Npgsql" Version="10.0.2" />

</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions frameworks/genhttp-11/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"crud",
"static",
"echo-ws",
"echo-ws-pipeline",
"api-4",
"api-16"
],
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-16-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,28 +388,28 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 116025,
"avg_latency": "7.70ms",
"p99_latency": "35.70ms",
"cpu": "1528.3%",
"memory": "288MiB",
"rps": 122771,
"avg_latency": "7.08ms",
"p99_latency": "32.60ms",
"cpu": "1527.0%",
"memory": "282MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "588.53MB/s",
"input_bw": "6.53MB/s",
"reconnects": 347941,
"status_2xx": 1740382,
"bandwidth": "623.14MB/s",
"input_bw": "6.91MB/s",
"reconnects": 368254,
"status_2xx": 1841565,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 652468,
"tpl_json": 653084,
"tpl_baseline": 689717,
"tpl_json": 691365,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 434828
"tpl_async_db": 460483
},
{
"framework": "genhttp-kestrel",
Expand Down
24 changes: 12 additions & 12 deletions site/data/api-4-256.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,28 +388,28 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 39577,
"avg_latency": "5.67ms",
"p99_latency": "22.10ms",
"cpu": "392.9%",
"memory": "142MiB",
"rps": 45959,
"avg_latency": "4.52ms",
"p99_latency": "17.50ms",
"cpu": "389.6%",
"memory": "147MiB",
"connections": 256,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "200.67MB/s",
"input_bw": "2.23MB/s",
"reconnects": 118708,
"status_2xx": 593668,
"bandwidth": "232.99MB/s",
"input_bw": "2.59MB/s",
"reconnects": 137882,
"status_2xx": 689395,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0,
"tpl_baseline": 222721,
"tpl_json": 222453,
"tpl_baseline": 258725,
"tpl_json": 258524,
"tpl_db": 0,
"tpl_upload": 0,
"tpl_static": 0,
"tpl_async_db": 148494
"tpl_async_db": 172146
},
{
"framework": "genhttp-kestrel",
Expand Down
18 changes: 9 additions & 9 deletions site/data/async-db-1024.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,19 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 173341,
"avg_latency": "5.26ms",
"p99_latency": "12.70ms",
"cpu": "3522.3%",
"memory": "334MiB",
"rps": 171582,
"avg_latency": "5.32ms",
"p99_latency": "12.50ms",
"cpu": "3387.4%",
"memory": "330MiB",
"connections": 1024,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "671.46MB/s",
"input_bw": "11.57MB/s",
"reconnects": 69140,
"status_2xx": 1733418,
"bandwidth": "664.70MB/s",
"input_bw": "11.45MB/s",
"reconnects": 68576,
"status_2xx": 1715825,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,19 +412,19 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 1446129,
"avg_latency": "2.61ms",
"p99_latency": "12.40ms",
"cpu": "5809.5%",
"memory": "545MiB",
"rps": 1428408,
"avg_latency": "2.56ms",
"p99_latency": "11.80ms",
"cpu": "5652.8%",
"memory": "448MiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "177.86MB/s",
"input_bw": "111.71MB/s",
"bandwidth": "175.68MB/s",
"input_bw": "110.34MB/s",
"reconnects": 0,
"status_2xx": 7230646,
"status_2xx": 7142040,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/baseline-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,19 +412,19 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 1460048,
"avg_latency": "350us",
"p99_latency": "3.45ms",
"cpu": "5726.1%",
"memory": "217MiB",
"rps": 1486774,
"avg_latency": "343us",
"p99_latency": "2.84ms",
"cpu": "5787.6%",
"memory": "218MiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "179.58MB/s",
"input_bw": "112.79MB/s",
"bandwidth": "182.87MB/s",
"input_bw": "114.85MB/s",
"reconnects": 0,
"status_2xx": 7300243,
"status_2xx": 7433873,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
16 changes: 8 additions & 8 deletions site/data/crud-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 454457,
"avg_latency": "8.51ms",
"rps": 454082,
"avg_latency": "8.53ms",
"p99_latency": "29.50ms",
"cpu": "4081.8%",
"memory": "615MiB",
"cpu": "4049.0%",
"memory": "626MiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "173.68MB/s",
"input_bw": "39.01MB/s",
"reconnects": 32099,
"status_2xx": 6816866,
"bandwidth": "173.80MB/s",
"input_bw": "38.97MB/s",
"reconnects": 32107,
"status_2xx": 6811234,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/echo-ws-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 1574650,
"avg_latency": "8.16ms",
"p99_latency": "42.30ms",
"cpu": "5776.0%",
"memory": "1.8GiB",
"rps": 1875182,
"avg_latency": "6.09ms",
"p99_latency": "16.50ms",
"cpu": "5749.5%",
"memory": "1.5GiB",
"connections": 16384,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "11.11MB/s",
"bandwidth": "13.08MB/s",
"reconnects": 0,
"status_2xx": 7873253,
"status_2xx": 9375913,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/echo-ws-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 1769589,
"avg_latency": "2.21ms",
"p99_latency": "11.50ms",
"cpu": "5896.0%",
"memory": "768MiB",
"rps": 2033859,
"avg_latency": "1.85ms",
"p99_latency": "5.39ms",
"cpu": "5868.1%",
"memory": "704MiB",
"connections": 4096,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "11.93MB/s",
"bandwidth": "13.71MB/s",
"reconnects": 0,
"status_2xx": 8847949,
"status_2xx": 10169297,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
14 changes: 7 additions & 7 deletions site/data/echo-ws-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@
{
"framework": "genhttp-11",
"language": "C#",
"rps": 1729463,
"avg_latency": "295us",
"p99_latency": "1.81ms",
"cpu": "5802.1%",
"memory": "167MiB",
"rps": 2072434,
"avg_latency": "246us",
"p99_latency": "1.05ms",
"cpu": "6102.4%",
"memory": "196MiB",
"connections": 512,
"threads": 64,
"duration": "5s",
"pipeline": 1,
"bandwidth": "11.54MB/s",
"bandwidth": "13.83MB/s",
"reconnects": 0,
"status_2xx": 8647315,
"status_2xx": 10362173,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
Expand Down
19 changes: 19 additions & 0 deletions site/data/echo-ws-pipeline-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@
"status_4xx": 0,
"status_5xx": 0
},
{
"framework": "genhttp-11",
"language": "C#",
"rps": 3687198,
"avg_latency": "3.20ms",
"p99_latency": "3.28ms",
"cpu": "6062.3%",
"memory": "974MiB",
"connections": 16384,
"threads": 64,
"duration": "5s",
"pipeline": 16,
"bandwidth": "24.91MB/s",
"reconnects": 0,
"status_2xx": 18435991,
"status_3xx": 0,
"status_4xx": 0,
"status_5xx": 0
},
{
"framework": "node-websocket",
"language": "JS",
Expand Down
Loading