Skip to content

Commit 8d5d3e2

Browse files
authored
Merge branch 'TechEmpower:master' into master
2 parents 65f8192 + 095c7de commit 8d5d3e2

File tree

426 files changed

+12118
-3542
lines changed

Some content is hidden

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

426 files changed

+12118
-3542
lines changed

frameworks/C/h2o/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.18.0)
2-
project(h2o_app)
2+
project(h2o-app)
33
find_library(CRYPTO_LIB crypto REQUIRED)
44
find_library(H2O_LIB h2o-evloop REQUIRED)
55
find_library(MUSTACHE_C_LIB mustache_c REQUIRED)
@@ -19,7 +19,7 @@ include_directories(${PQ_INCLUDE} ${YAJL_INCLUDE})
1919
set(CMAKE_C_STANDARD 11)
2020
set(CMAKE_C_STANDARD_REQUIRED ON)
2121
add_compile_definitions(H2O_USE_LIBUV=0)
22-
set(COMMON_OPTIONS -flto -pthread)
22+
set(COMMON_OPTIONS -flto=auto -pthread)
2323
add_compile_options(-pedantic -Wall -Wextra ${COMMON_OPTIONS})
2424
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_FORTIFY_SOURCE=2")
2525
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")

frameworks/C/h2o/h2o.dockerfile

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
1-
ARG UBUNTU_VERSION=24.04
1+
ARG UBUNTU_VERSION=25.10
22

3-
ARG H2O_APP_PREFIX=/opt/h2o_app
3+
ARG H2O_APP_PREFIX=/opt/h2o-app
44

55
FROM "ubuntu:${UBUNTU_VERSION}" AS compile
66

77
ARG DEBIAN_FRONTEND=noninteractive
88
RUN apt-get -yqq update && \
9-
apt-get -yqq install \
10-
ca-certificates \
11-
curl \
12-
lsb-release && \
13-
install -dm755 /usr/share/postgresql-common/pgdg && \
14-
curl --fail -LSso /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc \
15-
"https://www.postgresql.org/media/keys/ACCC4CF8.asc" && \
16-
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
17-
https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > \
18-
/etc/apt/sources.list.d/pgdg.list' && \
19-
apt-get -yqq update && \
209
apt-get -yqq install \
2110
autoconf \
2211
bison \
2312
cmake \
13+
curl \
2414
flex \
2515
g++ \
2616
libbpfcc-dev \
@@ -50,7 +40,7 @@ RUN curl -LSs "https://github.com/h2o/h2o/archive/${H2O_VERSION}.tar.gz" | \
5040
cmake \
5141
-B build \
5242
-DCMAKE_AR=/usr/bin/gcc-ar \
53-
-DCMAKE_C_FLAGS="-flto -march=native -mtune=native" \
43+
-DCMAKE_C_FLAGS="-flto=auto -march=native -mtune=native" \
5444
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
5545
-DWITH_MRUBY=on \
5646
-G Ninja \
@@ -63,7 +53,8 @@ ARG MUSTACHE_C_REVISION=7fe52392879d0188c172d94bb4fde7c513d6b929
6353
WORKDIR /tmp/mustache-c-build
6454
RUN curl -LSs "https://github.com/x86-64/mustache-c/archive/${MUSTACHE_C_REVISION}.tar.gz" | \
6555
tar --strip-components=1 -xz && \
66-
CFLAGS="-flto -march=native -mtune=native -O3" ./autogen.sh && \
56+
CFLAGS="-flto=auto -march=native -mtune=native -O3 -Wno-implicit-function-declaration" \
57+
./autogen.sh && \
6758
make -j "$(nproc)" install
6859

6960
ARG H2O_APP_PREFIX
@@ -82,25 +73,12 @@ RUN cmake \
8273

8374
FROM "ubuntu:${UBUNTU_VERSION}"
8475

85-
ARG POSTGRESQL_VERSION=17
86-
8776
ARG DEBIAN_FRONTEND=noninteractive
8877
RUN apt-get -yqq update && \
89-
apt-get -yqq install \
90-
ca-certificates \
91-
curl \
92-
lsb-release && \
93-
install -dm755 /usr/share/postgresql-common/pgdg && \
94-
curl --fail -LSso /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc \
95-
"https://www.postgresql.org/media/keys/ACCC4CF8.asc" && \
96-
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] \
97-
https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > \
98-
/etc/apt/sources.list.d/pgdg.list' && \
99-
apt-get -yqq update && \
10078
apt-get -yqq install \
10179
libnuma1 \
102-
libyajl2 \
103-
"postgresql-client-${POSTGRESQL_VERSION}"
80+
libpq5 \
81+
libyajl2
10482
ARG H2O_APP_PREFIX
10583
COPY --from=compile "${H2O_APP_PREFIX}" "${H2O_APP_PREFIX}/"
10684
COPY --from=compile /usr/local/lib/libmustache_c.so "${H2O_APP_PREFIX}/lib/"
@@ -113,10 +91,10 @@ ARG TFB_TEST_NAME
11391
CMD ["taskset", \
11492
"-c", \
11593
"0", \
116-
"/opt/h2o_app/bin/h2o_app", \
94+
"/opt/h2o-app/bin/h2o-app", \
11795
"-a20", \
11896
"-d", \
11997
"dbname=hello_world host=tfb-database password=benchmarkdbpass sslmode=disable user=benchmarkdbuser", \
12098
"-f", \
121-
"/opt/h2o_app/share/h2o_app/template", \
99+
"/opt/h2o-app/share/h2o-app/template", \
122100
"-m1"]

frameworks/C/h2o/src/database.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int flush_connection(h2o_socket_cb cb, db_conn_t *conn)
186186

187187
if (send_status < 0)
188188
LIBRARY_ERROR("PQflush", PQerrorMessage(conn->conn));
189-
else if (send_status)
189+
else if (send_status && !h2o_socket_is_writing(conn->sock))
190190
h2o_socket_notify_write(conn->sock, cb);
191191

192192
return send_status < 0;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AkazawaYun.PRO(https://akazawayun.cn/#akzLearning#%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 此阶段用于生成项目
2+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS publish
3+
WORKDIR /app
4+
COPY src .
5+
RUN dotnet publish -c Release -o /app/publish
6+
7+
# 此阶段用于运行
8+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS runtime
9+
WORKDIR /app
10+
COPY --from=publish /app/publish .
11+
12+
EXPOSE 2022
13+
ENTRYPOINT ["dotnet", "AkazawaYun.FrameworkBenchmarks.dll"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"framework": "akazawayun.pro",
3+
"tests": [
4+
{
5+
"default": {
6+
"display_name": "akazawayun.pro",
7+
"framework": "akazawayun.pro",
8+
"webserver": "akazawayun.pro",
9+
"plaintext_url": "/post/plaintext",
10+
"json_url": "/post/json",
11+
"port": 2022,
12+
"classification": "Micro",
13+
"approach": "Realistic",
14+
"platform": ".NET",
15+
"language": "C#",
16+
"flavor": "CoreCLR",
17+
"os": "Linux",
18+
"database_os": "Linux",
19+
"database": "MySQL",
20+
"orm": "Micro",
21+
"notes": ""
22+
}
23+
}
24+
]
25+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
12+
<ServerGarbageCollection>true</ServerGarbageCollection>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="AkazawaYun.PRO" Version="1.13.25.727" />
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using AkazawaYun.PRO7;
2+
using AkazawaYun.PRO7.AkazawaYunWebInterceptor;
3+
using System.Text.Json.Serialization;
4+
5+
namespace AkazawaYun.FrameworkBenchmarks;
6+
7+
public class Program : IPostFunction
8+
{
9+
static async Task Main()
10+
{
11+
akzJson.Config(null, Json.Default);
12+
var server = await akzWebBuilder.Shared.Load().SetDefault().Build()
13+
.Config<IWebReceptor, akzWebInterceptor>(itc =>
14+
{
15+
itc.AddInterceptor(new akzWebInterceptorNotOnlyPost());
16+
}).Launch();
17+
akzLog.Default = akzLog.Output.None;
18+
await Task.Delay(-1);
19+
}
20+
21+
22+
public static ValueTask<HttpRes> plaintext(HttpReq _)
23+
{
24+
return HttpRes.HttpOK("Hello, World!", ".txt");
25+
}
26+
public static ValueTask<HttpRes> json(HttpReq _)
27+
{
28+
return HttpRes.HttpJson(new JsonResponse
29+
{
30+
message = "Hello, World!"
31+
});
32+
}
33+
}
34+
35+
public class JsonResponse
36+
{
37+
public string? message { get; set; }
38+
}
39+
40+
[JsonSerializable(typeof(JsonResponse))]
41+
public partial class Json : JsonSerializerContext { }

frameworks/CSharp/appmpower/appmpower-odbc-my.dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:9.0.100 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
22
RUN apt-get update
33
RUN apt-get -yqq install clang zlib1g-dev
44
RUN apt-get update
@@ -8,7 +8,7 @@ COPY src .
88
RUN dotnet publish -c Release -o out /p:Database=mysql
99

1010
# Construct the actual image that will run
11-
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0 AS runtime
11+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
1212

1313
RUN apt-get update
1414
# The following installs standard versions unixodbc and pgsqlodbc
@@ -18,6 +18,7 @@ RUN apt-get update
1818

1919
WORKDIR /odbc
2020

21+
#TODOGITHUB
2122
RUN curl -L -o mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz https://downloads.mariadb.com/Connectors/odbc/connector-odbc-3.1.20/mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz
2223
RUN tar -xvzf mariadb-connector-odbc-3.1.20-debian-bookworm-amd64.tar.gz
2324
RUN cp mariadb-connector-odbc-3.1.20-debian-bookworm-amd64/lib/mariadb/libm* /usr/lib/
@@ -45,8 +46,10 @@ WORKDIR /app
4546
COPY --from=build /app/out ./
4647

4748
RUN cp /usr/lib/libm* /app
48-
#RUN cp /usr/lib/aarch64-linux-gnu/libodbc* /app
49+
#TODOGITHUB
4950
RUN cp /usr/lib/x86_64-linux-gnu/libodbc* /app
51+
#TODOLOCAL
52+
#RUN cp /usr/lib/aarch64-linux-gnu/libodbc* /app
5053

5154
EXPOSE 8080
5255

frameworks/CSharp/appmpower/appmpower-odbc-pg.dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:9.0.100 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
22
RUN apt-get update
3-
RUN apt-get -yqq install clang zlib1g-dev libkrb5-dev libtinfo5
3+
RUN apt-get -yqq install clang zlib1g-dev
44

55
WORKDIR /app
66
COPY src .
77
RUN dotnet publish -c Release -o out /p:Database=postgresql
88

99
# Construct the actual image that will run
10-
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0 AS runtime
10+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
1111

1212
RUN apt-get update
1313
RUN apt-get install -y unixodbc-dev unixodbc odbc-postgresql
@@ -27,9 +27,10 @@ ENV ASPNETCORE_URLS http://+:8080
2727
WORKDIR /app
2828
COPY --from=build /app/out ./
2929

30-
#RUN cp /usr/lib/aarch64-linux-gnu/libodbc* /app
30+
#TODOGITHUB
3131
RUN cp /usr/lib/x86_64-linux-gnu/libodbc* /app
32-
32+
#TODOLOCAL
33+
#RUN cp /usr/lib/aarch64-linux-gnu/libodbc* /app
3334

3435
EXPOSE 8080
3536

0 commit comments

Comments
 (0)