Skip to content

Commit 080cb75

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f70e553 + bca3822 commit 080cb75

File tree

691 files changed

+11210
-5669
lines changed

Some content is hidden

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

691 files changed

+11210
-5669
lines changed

frameworks/C++/poco/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# POCO C++ Libraries Benchmarking Test
2+
3+
- [POCO Github Repository](https://github.com/pocoproject/poco)
4+
- [POCO Website](https://pocoproject.org/)
5+
6+
## Software Versions
7+
8+
- [buildpack-deps noble](https://hub.docker.com/_/buildpack-deps)
9+
- [g++ 14](https://gcc.gnu.org/gcc-14/)
10+
- [c++17](https://en.cppreference.com/w/cpp/17)
11+
- [POCO 1.13.1](https://pocoproject.org/releases/poco-1.13.1/poco-1.13.1-all.zip)
12+
13+
## Test URLs
14+
15+
- `PLAINTEXT` - [http://127.0.0.1:8080/plaintext](http://127.0.0.1:8080/plaintext)

frameworks/C++/poco/benchmark.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include <Poco/Net/HTTPServerRequest.h>
77
#include <Poco/Net/HTTPServerResponse.h>
88
#include <Poco/Util/ServerApplication.h>
9+
#include <Poco/Timespan.h>
10+
#include <Poco/Thread.h>
911

1012
#include <iostream>
1113
#include <string>
@@ -15,7 +17,9 @@
1517
#define PLAIN_CONTENT_TYPE "text/plain"
1618
#define RES_BODY "Hello, World!"
1719
#define SERVER_NAME "poco"
20+
#define MAX_CONNECTIONS 16384
1821

22+
using namespace Poco;
1923
using namespace Poco::Net;
2024
using namespace Poco::Util;
2125
using namespace std;
@@ -58,7 +62,12 @@ class MyServerApp : public ServerApplication {
5862
HTTPServerParams* hsp = new HTTPServerParams;
5963
hsp->setMaxThreads(stoi(args[1]));
6064
hsp->setKeepAlive(true);
61-
HTTPServer s(new MyRequestHandlerFactory, ServerSocket(stoi(args[0]), 4000), hsp);
65+
hsp->setMaxKeepAliveRequests(MAX_CONNECTIONS);
66+
hsp->setMaxQueued(MAX_CONNECTIONS);
67+
hsp->setThreadPriority(Thread::PRIO_HIGHEST);
68+
ServerSocket socket(stoi(args[0]), MAX_CONNECTIONS);
69+
socket.setBlocking(false);
70+
HTTPServer s(new MyRequestHandlerFactory, socket, hsp);
6271
s.start();
6372
waitForTerminationRequest();
6473
s.stop();

frameworks/C++/poco/poco.dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM buildpack-deps:xenial
1+
FROM buildpack-deps:noble
22

33
RUN apt-get update -yqq && apt-get install -yqq software-properties-common unzip cmake
44

5-
RUN apt-get install -yqq g++-4.8 libjson0-dev
6-
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
5+
RUN apt-get install -yqq g++-14
6+
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50
77

8-
ENV POCO_VERSION 1.6.1
8+
ENV POCO_VERSION 1.13.3
99
ENV POCO_HOME /poco
1010

1111
WORKDIR ${POCO_HOME}
@@ -20,10 +20,10 @@ ENV LD_LIBRARY_PATH ${POCO_HOME}/lib/Linux/x86_64
2020

2121
COPY benchmark.cpp benchmark.cpp
2222

23-
RUN g++-4.8 \
23+
RUN g++-14 \
2424
-O3 \
2525
-DNDEBUG \
26-
-std=c++0x \
26+
-std=c++17 \
2727
-o \
2828
poco \
2929
benchmark.cpp \

frameworks/C/h2o/h2o.dockerfile

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,28 @@ 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 && \
920
apt-get -yqq install \
1021
autoconf \
1122
bison \
1223
cmake \
13-
curl \
1424
flex \
1525
g++ \
1626
libbpfcc-dev \
1727
libbrotli-dev \
1828
libcap-dev \
19-
libicu-dev \
2029
libnuma-dev \
21-
libreadline-dev \
30+
libpq-dev \
2231
libssl-dev \
2332
libtool \
2433
libuv1-dev \
@@ -57,18 +66,6 @@ RUN curl -LSs "https://github.com/x86-64/mustache-c/archive/${MUSTACHE_C_REVISIO
5766
CFLAGS="-flto -march=native -mtune=native -O3" ./autogen.sh && \
5867
make -j "$(nproc)" install
5968

60-
ARG POSTGRESQL_VERSION=a37bb7c13995b834095d9d064cad1023a6f99b10
61-
62-
WORKDIR /tmp/postgresql-build
63-
RUN curl -LSs "https://github.com/postgres/postgres/archive/${POSTGRESQL_VERSION}.tar.gz" | \
64-
tar --strip-components=1 -xz && \
65-
CFLAGS="-flto -march=native -mtune=native -O3" ./configure \
66-
--includedir=/usr/local/include/postgresql \
67-
--prefix=/usr/local \
68-
--with-ssl=openssl && \
69-
make -j "$(nproc)" -C src/include install && \
70-
make -j "$(nproc)" -C src/interfaces/libpq install
71-
7269
ARG H2O_APP_PREFIX
7370
WORKDIR /tmp/build
7471
COPY CMakeLists.txt ../
@@ -85,15 +82,28 @@ RUN cmake \
8582

8683
FROM "ubuntu:${UBUNTU_VERSION}"
8784

85+
ARG POSTGRESQL_VERSION=17
86+
8887
ARG DEBIAN_FRONTEND=noninteractive
8988
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 && \
90100
apt-get -yqq install \
91101
libnuma1 \
92-
libyajl2
102+
libyajl2 \
103+
"postgresql-client-${POSTGRESQL_VERSION}"
93104
ARG H2O_APP_PREFIX
94105
COPY --from=compile "${H2O_APP_PREFIX}" "${H2O_APP_PREFIX}/"
95106
COPY --from=compile /usr/local/lib/libmustache_c.so "${H2O_APP_PREFIX}/lib/"
96-
COPY --from=compile /usr/local/lib/libpq.so.5.17 "${H2O_APP_PREFIX}/lib/libpq.so.5"
97107
ENV LD_LIBRARY_PATH="${H2O_APP_PREFIX}/lib"
98108
EXPOSE 8080
99109
ARG BENCHMARK_ENV

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0.100 AS build
22
RUN apt-get update
33
RUN apt-get -yqq install clang zlib1g-dev
44
RUN apt-get update
@@ -8,12 +8,12 @@ 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:8.0.0 AS runtime
11+
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0 AS runtime
1212

1313
RUN apt-get update
1414
# The following installs standard versions unixodbc and pgsqlodbc
1515
# unixodbc still needs to be installed even if compiled locally
16-
RUN apt-get install -y unixodbc wget curl
16+
RUN apt-get install -y unixodbc-dev unixodbc wget curl
1717
RUN apt-get update
1818

1919
WORKDIR /odbc
@@ -45,6 +45,8 @@ WORKDIR /app
4545
COPY --from=build /app/out ./
4646

4747
RUN cp /usr/lib/libm* /app
48+
#RUN cp /usr/lib/aarch64-linux-gnu/libodbc* /app
49+
RUN cp /usr/lib/x86_64-linux-gnu/libodbc* /app
4850

4951
EXPOSE 8080
5052

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

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

@@ -7,10 +7,10 @@ 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:8.0.0 AS runtime
10+
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0 AS runtime
1111

1212
RUN apt-get update
13-
RUN apt-get install -y unixodbc odbc-postgresql
13+
RUN apt-get install -y unixodbc-dev unixodbc odbc-postgresql
1414
# unixodbc still needs to be installed even if compiled locally
1515

1616
ENV PATH=/usr/local/unixODBC/bin:$PATH
@@ -27,6 +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
31+
RUN cp /usr/lib/x86_64-linux-gnu/libodbc* /app
32+
33+
3034
EXPOSE 8080
3135

3236
ENTRYPOINT ["./appMpower"]

frameworks/CSharp/appmpower/appmpower.dockerfile

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

@@ -8,7 +8,7 @@ COPY src .
88
RUN dotnet publish -c Release -o out
99

1010
# Construct the actual image that will run
11-
FROM mcr.microsoft.com/dotnet/aspnet:8.0.0 AS runtime
11+
FROM mcr.microsoft.com/dotnet/aspnet:9.0.0 AS runtime
1212
# Full PGO
1313
ENV DOTNET_TieredPGO 1
1414
ENV DOTNET_TC_QuickJitForLoops 1

frameworks/CSharp/appmpower/src/appMpower.Orm/Data/DbCommand.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ public DbCommand(string commandText, DbConnection dbConnection)
2020
_dbConnection = dbConnection;
2121
}
2222

23-
public DbCommand(string commandText, DbConnection dbConnection, bool keyed)
24-
{
25-
_odbcCommand = dbConnection.GetCommand(commandText, CommandType.Text, keyed);
26-
_dbConnection = dbConnection;
27-
}
28-
2923
public DbCommand(string commandText, CommandType commandType, DbConnection dbConnection)
3024
{
3125
_odbcCommand = dbConnection.GetCommand(commandText, commandType);
@@ -175,14 +169,19 @@ public IDataReader ExecuteReader()
175169

176170
public async Task<int> ExecuteNonQueryAsync()
177171
{
178-
return await (_odbcCommand as System.Data.Common.DbCommand).ExecuteNonQueryAsync();
172+
return await _odbcCommand.ExecuteNonQueryAsync();
179173
}
180174

181175
public IDataReader ExecuteReader(CommandBehavior behavior)
182176
{
183177
return _odbcCommand.ExecuteReader(behavior);
184178
}
185179

180+
public async Task<System.Data.Common.DbDataReader> ExecuteReaderAsync(CommandBehavior behavior)
181+
{
182+
return await _odbcCommand.ExecuteReaderAsync(behavior);
183+
}
184+
186185
#nullable enable
187186
public object? ExecuteScalar()
188187
{
@@ -197,8 +196,7 @@ public void Prepare()
197196

198197
public void Dispose()
199198
{
200-
if (_dbConnection._keyed) _dbConnection._keyedOdbcCommands.TryAdd(_odbcCommand.CommandText, _odbcCommand);
201-
else _dbConnection._odbcCommands.Push(_odbcCommand);
199+
_dbConnection.Release(_odbcCommand);
202200
}
203201
}
204202
}

0 commit comments

Comments
 (0)