Skip to content

Commit 995da70

Browse files
authored
Merge branch 'TechEmpower:master' into master
2 parents cc8cbae + 065ada5 commit 995da70

Some content is hidden

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

62 files changed

+910
-344
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/Clojure/kit/deps.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
;; HTML templating
1717
selmer/selmer {:mvn/version "1.12.62"}
18-
org.clojars.jj/majavat {:mvn/version "1.12.1"}
18+
org.clojars.jj/majavat {:mvn/version "1.12.3"}
1919

2020
;; Database
2121
org.postgresql/postgresql {:mvn/version "42.7.8"}

frameworks/Clojure/kit/src/clj/io/github/kit_clj/te_bench/web/controllers/bench.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[next.jdbc :as jdbc]
55
[next.jdbc.result-set :as rs]
66
[jj.majavat :as majavat]
7-
[jj.majavat.renderer :refer [->InputStreamRenderer]]
7+
[jj.majavat.renderer :refer [->StringRenderer]]
88
[jj.majavat.renderer.sanitizer :refer [->Html]]
99
[ring.util.http-response :as http-response]
1010
[selmer.parser :as parser]))
@@ -17,7 +17,7 @@
1717
(def ^:const MAX_ID_ZERO_IDX 9999)
1818
(def ^:const CACHE_TTL (* 24 60 60))
1919
(def ^:private render-fortune (majavat/build-renderer "html/fortunes.html"
20-
{:renderer (->InputStreamRenderer
20+
{:renderer (->StringRenderer
2121
{:sanitizer (->Html)})}))
2222
(def selmer-opts {:custom-resource-path (clojure.java.io/resource "html")})
2323

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
(defproject hello "reitit"
22
:description "pohjavirta, reitit, jsonista & porsas"
3-
:dependencies [[org.clojure/clojure "1.10.1"]
3+
:dependencies [[org.clojure/clojure "1.12.3"]
44
[metosin/pohjavirta "0.0.1-alpha5"]
55
[metosin/porsas "0.0.1-alpha13"]
6-
[metosin/jsonista "0.2.5"]
7-
[metosin/reitit "0.3.10"]
8-
[hikari-cp "2.9.0"]]
9-
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]
6+
[metosin/jsonista "0.3.13"]
7+
[metosin/reitit "0.9.1"]
8+
[hikari-cp "3.3.0"]]
109
:main hello.handler
1110
:aot :all)
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
FROM clojure:openjdk-11-lein-2.9.1
1+
FROM clojure:lein as lein
22
WORKDIR /reitit
3-
COPY src src
43
COPY project.clj project.clj
4+
COPY src src
55
RUN lein uberjar
66

7+
FROM openjdk:25-jdk-slim
8+
WORKDIR /reitit
9+
COPY --from=lein /reitit/target/hello-reitit-standalone.jar app.jar
10+
711
EXPOSE 8080
812

9-
CMD ["java", "-server", "-Xms2G", "-Xmx2G", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-Dvertx.disableMetrics=true", "-Dvertx.threadChecks=false", "-Dvertx.disableContextTimings=true", "-Dvertx.disableTCCL=true", "-XX:+UseStringDeduplication", "-Djava.net.preferIPv4Stack=true", "-jar", "target/hello-reitit-standalone.jar", "async"]
13+
CMD ["java", "-server", "-XX:+UseParallelGC", "-jar", "app.jar", "async"]

0 commit comments

Comments
 (0)