Skip to content

Commit a0f2e6c

Browse files
committed
Merge branch 'master' of github.com:TechEmpower/FrameworkBenchmarks
2 parents 3948ba7 + 3b2e169 commit a0f2e6c

File tree

74 files changed

+984
-360
lines changed

Some content is hidden

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

74 files changed

+984
-360
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ benchmark.cfg
6969

7070
# python
7171
.venv/
72+
frameworks/CSharp/akazawayun.pro/Dockerfile
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36310.24 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AkazawaYun.FrameworkBenchmarks", "src/AkazawaYun.FrameworkBenchmarks.csproj", "{BB5587FE-E4A0-851D-6025-F5FF0EC54525}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{BB5587FE-E4A0-851D-6025-F5FF0EC54525}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {81EA49A3-BB25-4EC5-B861-02520931CF63}
24+
EndGlobalSection
25+
EndGlobal

frameworks/CSharp/akazawayun.pro/akazawayun.pro.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
99
WORKDIR /app
1010
COPY --from=publish /app/publish .
1111

12-
EXPOSE 2022
12+
EXPOSE 8080
1313
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]

frameworks/CSharp/akazawayun.pro/benchmark_config.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"display_name": "akazawayun.pro",
77
"framework": "akazawayun.pro",
88
"webserver": "akazawayun.pro",
9-
"plaintext_url": "/post/plaintext",
10-
"json_url": "/post/json",
11-
"db_url": "/post/db",
12-
"query_url": "/post/queries?queries=",
13-
"update_url": "/post/updates?queries=",
14-
"port": 2022,
9+
"plaintext_url": "/plaintext",
10+
"json_url": "/json",
11+
"db_url": "/db",
12+
"query_url": "/queries?queries=",
13+
"update_url": "/updates?queries=",
14+
"port": 8080,
1515
"classification": "Micro",
1616
"approach": "Realistic",
1717
"platform": ".NET",

frameworks/CSharp/akazawayun.pro/src/AkazawaYun.FrameworkBenchmarks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="AkazawaYun.PRO" Version="1.13.25.816" />
18+
<PackageReference Include="AkazawaYun.PRO" Version="1.14.25.1027" />
1919
<PackageReference Include="MySql.Data" Version="9.4.0" />
2020
</ItemGroup>
2121

frameworks/CSharp/akazawayun.pro/src/Program.cs

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

33
using AkazawaYun.AOT;
44
using AkazawaYun.PRO7;
5-
using AkazawaYun.PRO7.AkazawaYunWebFunctionAOP;
6-
using AkazawaYun.PRO7.AkazawaYunWebInterceptor;
7-
using System.Diagnostics.CodeAnalysis;
85

96
namespace AkazawaYun.FrameworkBenchmarks;
107

118
class Program : IPostFunctionWrapper
129
{
1310
static readonly akzWebBuilder builder;
1411
static readonly akzDbFactory mysql;
15-
12+
const int port = 8080;
1613

1714
static Program()
1815
{
1916
akzJson.Config(null, AotJsonContext.Default);
20-
builder = akzWebBuilder.Shared.SetDefault()
17+
builder = akzWebBuilder.Shared.SetPort(port)
2118
.Build()
2219
.Config<IWebReceptor, akzWebInterceptor>(itc =>
2320
{
2421
itc.ClearInterceptor();
25-
itc.AddInterceptor(new akzWebInterceptorNotOnlyPost());
22+
itc.AddInterceptor(new akzWebInterceptorAsPost());
2623
});
2724
mysql = new akzDbBuilderII()
28-
.SetServer("tfb-database:3306")
25+
.SetServer("tfb-database")
2926
//.SetServer("localhost:3306")
3027
.SetUser("benchmarkdbuser")
28+
//.SetUser("root")
3129
.SetPwd("benchmarkdbpass")
30+
//.SetPwd("123456")
3231
.SetDatabase("hello_world")
3332
.SetCharset()
3433
.SetOtherset()
@@ -37,7 +36,16 @@ static Program()
3736
static async Task Main()
3837
{
3938
await builder.Launch();
40-
akzLog.Default = akzLog.Output.None;
39+
40+
akzLog.Inf("[API SELF-TEST]");
41+
string url = $"http://localhost:{port}/plaintext";
42+
akzLog.Inf(" REQ URL :" + url);
43+
string res = await akzHttpClient.Shared.Get(url).FetchString();
44+
akzLog.Inf(" RES LEN :" + res.Length);
45+
akzLog.Inf(" RES BODY:" + res);
46+
akzLog.Inf("[OK, I WORK FINE]");
47+
48+
akzLog.Default = akzLog.Output.NoneButWar;
4149
await Task.Delay(-1);
4250
}
4351

@@ -91,3 +99,12 @@ static int ParseCount(string queries)
9199
}
92100

93101
}
102+
103+
public class akzWebInterceptorAsPost : WebInterceptor
104+
{
105+
public override ValueTask<InterceptorHttpRes> Intercept(IHttpContext http)
106+
{
107+
http.Method = "POST";
108+
return InterceptorHttpRes.No();
109+
}
110+
}

frameworks/CSharp/touchsocket/src/TouchSocketHttp/Program.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ private static async Task Main(string[] args)
1515

1616
await service.SetupAsync(new TouchSocketConfig()
1717
.SetListenIPHosts(port)
18-
.SetNoDelay(true)
19-
.SetTransportOption(options =>
20-
{
21-
options.ReceivePipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
22-
options.SendPipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
23-
})
2418
.SetMaxCount(1000000)
2519
.ConfigureContainer(a =>
2620
{

frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<Nullable>enable</Nullable>
66
<OutputType>Exe</OutputType>
77
<ImplicitUsings>enable</ImplicitUsings>
8+
<ServerGarbageCollection>true</ServerGarbageCollection>
89
<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-452b-beb6-47d798a5a131</UserSecretsId>
910
</PropertyGroup>
1011

1112
<ItemGroup>
1213
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
13-
<PackageReference Include="TouchSocket.Hosting" Version="4.0.0-beta.120" />
14-
<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.120" />
14+
<PackageReference Include="TouchSocket.Hosting" Version="4.0.0-rc.5" />
15+
<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-rc.5" />
1516
</ItemGroup>
1617
</Project>
1718

frameworks/CSharp/touchsocket/src/TouchSocketHttp31/TouchSocketHttp31.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ImplicitUsings>enable</ImplicitUsings>
88
<InvariantGlobalization>true</InvariantGlobalization>
99
<!--<PublishAot>true</PublishAot>-->
10-
<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-455b-beb6-47d798a5a131</UserSecretsId>
1110
<ServerGarbageCollection>true</ServerGarbageCollection>
11+
<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-455b-beb6-47d798a5a131</UserSecretsId>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ public static void Main(string[] args)
1818
builder.Services.AddServiceHostedService<IHttpService, HttpService>(config =>
1919
{
2020
config.SetListenIPHosts(8080)
21-
.SetNoDelay(true)
22-
.SetTransportOption(options =>
23-
{
24-
options.ReceivePipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
25-
options.SendPipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
26-
})
2721
.SetMaxCount(1000000)
2822
.ConfigureContainer(a =>
2923
{

0 commit comments

Comments
 (0)