Skip to content

Commit

Permalink
Merge branch 'TechEmpower:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq authored Apr 17, 2024
2 parents 5d3e882 + a0707d7 commit f021f17
Show file tree
Hide file tree
Showing 81 changed files with 2,708 additions and 1,814 deletions.
14 changes: 7 additions & 7 deletions frameworks/C++/drogon/drogon-core.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

COPY ./ ./

Expand All @@ -11,18 +11,18 @@ RUN apt-get update -yqq && \
zlib1g-dev && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -yqq && \
apt-get install -yqq gcc-10 g++-10
apt-get install -yqq gcc g++

RUN locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV CC=gcc-10
ENV CXX=g++-10
ENV AR=gcc-ar-10
ENV RANLIB=gcc-ranlib-10
ENV CC=gcc
ENV CXX=g++
ENV AR=gcc-ar
ENV RANLIB=gcc-ranlib

ENV IROOT=/install
ENV DROGON_ROOT=$IROOT/drogon
Expand All @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon

WORKDIR $DROGON_ROOT

RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
RUN git submodule update --init
RUN mkdir build

Expand Down
14 changes: 7 additions & 7 deletions frameworks/C++/drogon/drogon.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

COPY ./ ./

Expand All @@ -11,18 +11,18 @@ RUN apt-get update -yqq && \
zlib1g-dev && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update -yqq && \
apt-get install -yqq gcc-10 g++-10
apt-get install -yqq gcc g++

RUN locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV CC=gcc-10
ENV CXX=g++-10
ENV AR=gcc-ar-10
ENV RANLIB=gcc-ranlib-10
ENV CC=gcc
ENV CXX=g++
ENV AR=gcc-ar
ENV RANLIB=gcc-ranlib

ENV IROOT=/install
ENV DROGON_ROOT=$IROOT/drogon
Expand All @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon

WORKDIR $DROGON_ROOT

RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
RUN git submodule update --init
RUN mkdir build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ void FortuneCtrlRaw::asyncHandleHttpRequest(
rows.reserve(r.size() + 1);
for (auto const &row : r)
{
rows.emplace_back(row[0ul].as<string_view>(), // id
row[1ul].as<string_view>()); // message
rows.emplace_back(row[0ul].as<std::string_view>(), // id
row[1ul].as<std::string_view>()); // message
}
rows.emplace_back("0", "Additional fortune added at request time.");
std::sort(rows.begin(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#pragma once
#include <drogon/HttpSimpleController.h>
#include <drogon/IOThreadStorage.h>
#include <string_view>

using namespace drogon;
struct Fortune
{
Fortune(string_view &&id, string_view &&message)
Fortune(std::string_view &&id, std::string_view &&message)
: id_(std::move(id)), message_(std::move(message))
{
}
Fortune() = default;
string_view id_;
string_view message_;
std::string_view id_;
std::string_view message_;
};
class FortuneCtrlRaw : public drogon::HttpSimpleController<FortuneCtrlRaw>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void UpdatesCtrlRaw::update(
const DbClientPtr &client)
{
auto const &sql = getSQL(results->size());
auto sqlBinder = *client << string_view(sql.data(), sql.length());
auto sqlBinder = *client << std::string_view(sql.data(), sql.length());
Json::Value json;
json.resize(0);
for (auto const &w : *results)
Expand Down
6 changes: 3 additions & 3 deletions frameworks/C/h2o/h2o.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG UBUNTU_VERSION=22.04
ARG UBUNTU_VERSION=24.04

ARG H2O_APP_PREFIX=/opt/h2o_app

Expand All @@ -25,6 +25,7 @@ RUN apt-get -yqq update && \
libwslay-dev \
libyajl-dev \
libz-dev \
llvm-dev \
make \
ninja-build \
pkg-config \
Expand All @@ -46,8 +47,7 @@ RUN curl -LSs "https://github.com/h2o/h2o/archive/${H2O_VERSION}.tar.gz" | \
-G Ninja \
-S . && \
cmake --build build -j && \
cmake --install build && \
cp -a deps/picotls/include/picotls* deps/quicly/include/quicly* /usr/local/include
cmake --install build

ARG MUSTACHE_C_REVISION=7fe52392879d0188c172d94bb4fde7c513d6b929

Expand Down
3 changes: 1 addition & 2 deletions frameworks/FSharp/giraffe/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Giraffe Benchmarks on Linux

This application tests Giraffe in 3 modes:
This application tests Giraffe in 2 modes:

- Default: Using Giraffe's Endpoint Routing APIs with the `System.Text.Json` serializer
- Utf8Json: Testing the JSON endpoint with the `Utf8Json` serializer
- Newtonsoft: Testing the JSON endpoint with the `NewtonsoftJson` serializer

## Infrastructure Software Versions
Expand Down
2 changes: 1 addition & 1 deletion frameworks/FSharp/giraffe/giraffe-newtonsoft.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build
WORKDIR /app
COPY src/App .
RUN dotnet publish -c Release -o out
Expand Down
2 changes: 1 addition & 1 deletion frameworks/FSharp/giraffe/giraffe.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build
WORKDIR /app
COPY src/App .
RUN dotnet publish -c Release -o out
Expand Down
8 changes: 4 additions & 4 deletions frameworks/FSharp/giraffe/src/App/App.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="8.0.100" />
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="Giraffe" Version="6.2.0" />
<PackageReference Include="Npgsql" Version="8.0.0-rc.2" />
<PackageReference Update="FSharp.Core" Version="8.0.200" />
<PackageReference Include="Dapper" Version="2.1.44" />
<PackageReference Include="Giraffe" Version="6.4.0" />
<PackageReference Include="Npgsql" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions frameworks/FSharp/zebra/src/App/App.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.21" />
<PackageReference Include="Npgsql" Version="8.0.0-rc.2" />
<PackageReference Include="Dapper" Version="2.1.44" />
<PackageReference Include="Npgsql" Version="8.0.2" />
<PackageReference Include="Utf8Json" Version="1.3.7" />
<PackageReference Update="FSharp.Core" Version="8.0.100" />
<PackageReference Update="FSharp.Core" Version="8.0.200" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion frameworks/FSharp/zebra/zebra-simple.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build
WORKDIR /app
COPY src/App .
RUN dotnet publish -c Release -o out
Expand Down
2 changes: 1 addition & 1 deletion frameworks/FSharp/zebra/zebra.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build
WORKDIR /app
COPY src/App .
RUN dotnet publish -c Release -o out
Expand Down
36 changes: 14 additions & 22 deletions frameworks/Java/inverno/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.inverno.dist</groupId>
<artifactId>inverno-parent</artifactId>
<version>1.7.0</version>
<version>1.9.0</version>
</parent>
<groupId>com.techempower</groupId>
<artifactId>inverno-benchmark</artifactId>
Expand Down Expand Up @@ -71,31 +71,12 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
<version>${version.netty}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns</artifactId>
<version>${version.netty}</version>
</dependency>

<!--<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>-->

<dependency>
<groupId>io.netty.incubator</groupId>
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>

<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-io_uring-incubator</artifactId>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
Expand Down Expand Up @@ -138,6 +119,9 @@
</configuration>
</execution>
</executions>
<configuration>
<vmOptions>--add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64</vmOptions>
</configuration>
</plugin>
</plugins>
</build>
Expand All @@ -146,10 +130,15 @@
<id>io.inverno.io_uring</id>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<groupId>io.netty.incubator</groupId>
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
<classifier>linux-x86_64</classifier>
</dependency>

<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-io_uring-incubator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -177,6 +166,9 @@
</configuration>
</execution>
</executions>
<configuration>
<vmOptions>--add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64</vmOptions>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void destroy() {

@Override
protected Mono<SqlClient> create() {
return Mono.fromCompletionStage(PgConnection.connect(this.vertx, this.connectOptions).toCompletionStage()).map(pgConn -> (SqlClient)new ConnectionSqlClient(pgConn)).cache();
return Mono.fromCompletionStage(() -> PgConnection.connect(this.vertx, this.connectOptions).toCompletionStage())
.map(pgConn -> (SqlClient)new ConnectionSqlClient(pgConn))
.cacheInvalidateWhen(client -> ((ConnectionSqlClient)client).onClose());
}
}
2 changes: 1 addition & 1 deletion frameworks/Java/light-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<maven.compiler.target>11</maven.compiler.target>
<version.light-4j>2.0.1</version.light-4j>
<version.logback>1.3.12</version.logback>
<version.undertow>2.3.5.Final</version.undertow>
<version.undertow>2.3.12.Final</version.undertow>
<version.hikaricp>3.3.1</version.hikaricp>
<version.mysql>8.0.28</version.mysql>
<version.postgres>42.7.2</version.postgres>
Expand Down
9 changes: 9 additions & 0 deletions frameworks/Java/today/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

.idea
today.properties
gradle
26 changes: 26 additions & 0 deletions frameworks/Java/today/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# [TODAY Infrastructure](https://github.com/TAKETODAY/today-infrastructure) Benchmarking Test

## Test URLs
### JSON

http://localhost:8080/json

### PLAINTEXT

http://localhost:8080/plaintext

### DB

http://localhost:8080/db

### QUERY

http://localhost:8080/queries?queries=

### UPDATE

http://localhost:8080/update?queries=

### FORTUNES

http://localhost:8080/fortunes
30 changes: 30 additions & 0 deletions frameworks/Java/today/benchmark_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"framework": "today",
"tests": [
{
"default": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"fortune_url": "/fortunes",
"update_url": "/updates?queries=",
"port": 8080,
"approach": "Realistic",
"classification": "Fullstack",
"database": "mysql",
"framework": "Today",
"language": "Java",
"flavor": "None",
"orm": "micro",
"platform": "Netty",
"webserver": "None",
"os": "Linux",
"database_os": "Linux",
"display_name": "Today",
"notes": "",
"versus": "None"
}
}
]
}
Loading

0 comments on commit f021f17

Please sign in to comment.