Skip to content

Commit 30be805

Browse files
committed
2 parents 9f62ae3 + 6837c80 commit 30be805

File tree

736 files changed

+8853
-11738
lines changed

Some content is hidden

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

736 files changed

+8853
-11738
lines changed

Dockerfile

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
# WARNING: DON'T PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK
@@ -18,24 +18,25 @@ RUN apt-get -yqq update && \
1818
libpq-dev \
1919
pkg-config \
2020
python3 \
21+
python3-colorama \
2122
python3-dev \
23+
python3-dnspython \
24+
python3-packaging \
2225
python3-pip \
26+
python3-psutil \
27+
python3-psycopg2 \
28+
python3-requests \
2329
siege \
24-
software-properties-common
25-
26-
RUN pip3 install \
27-
colorama==0.3.1 \
28-
docker==4.0.2 \
29-
mysqlclient \
30-
psutil \
31-
psycopg2-binary \
32-
pymongo==3.13.0 \
33-
# urllib3 incompatibility:
34-
# https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104
35-
requests==2.28.1
30+
software-properties-common && \
31+
# Ubuntu's equivalent packages are too old and/or broken.
32+
pip3 install \
33+
--break-system-packages \
34+
docker==7.0.0 \
35+
mysqlclient==2.2.4 \
36+
pymongo==4.7.2
3637

3738
# Collect resource usage statistics
38-
ARG DOOL_VERSION=v1.2.0
39+
ARG DOOL_VERSION=v1.3.1
3940

4041
WORKDIR /tmp
4142
RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \

frameworks/C++/drogon/drogon-core.dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
COPY ./ ./
44

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

1616
RUN locale-gen en_US.UTF-8
1717

1818
ENV LANG en_US.UTF-8
1919
ENV LANGUAGE en_US:en
2020
ENV LC_ALL en_US.UTF-8
2121

22-
ENV CC=gcc-10
23-
ENV CXX=g++-10
24-
ENV AR=gcc-ar-10
25-
ENV RANLIB=gcc-ranlib-10
22+
ENV CC=gcc
23+
ENV CXX=g++
24+
ENV AR=gcc-ar
25+
ENV RANLIB=gcc-ranlib
2626

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

4242
WORKDIR $DROGON_ROOT
4343

44-
RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
44+
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
4545
RUN git submodule update --init
4646
RUN mkdir build
4747

frameworks/C++/drogon/drogon.dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
COPY ./ ./
44

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

1616
RUN locale-gen en_US.UTF-8
1717

1818
ENV LANG en_US.UTF-8
1919
ENV LANGUAGE en_US:en
2020
ENV LC_ALL en_US.UTF-8
2121

22-
ENV CC=gcc-10
23-
ENV CXX=g++-10
24-
ENV AR=gcc-ar-10
25-
ENV RANLIB=gcc-ranlib-10
22+
ENV CC=gcc
23+
ENV CXX=g++
24+
ENV AR=gcc-ar
25+
ENV RANLIB=gcc-ranlib
2626

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

4242
WORKDIR $DROGON_ROOT
4343

44-
RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092
44+
RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc
4545
RUN git submodule update --init
4646
RUN mkdir build
4747

frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ void FortuneCtrlRaw::asyncHandleHttpRequest(
2222
rows.reserve(r.size() + 1);
2323
for (auto const &row : r)
2424
{
25-
rows.emplace_back(row[0ul].as<string_view>(), // id
26-
row[1ul].as<string_view>()); // message
25+
rows.emplace_back(row[0ul].as<std::string_view>(), // id
26+
row[1ul].as<std::string_view>()); // message
2727
}
2828
rows.emplace_back("0", "Additional fortune added at request time.");
2929
std::sort(rows.begin(),

frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#pragma once
22
#include <drogon/HttpSimpleController.h>
33
#include <drogon/IOThreadStorage.h>
4+
#include <string_view>
45

56
using namespace drogon;
67
struct Fortune
78
{
8-
Fortune(string_view &&id, string_view &&message)
9+
Fortune(std::string_view &&id, std::string_view &&message)
910
: id_(std::move(id)), message_(std::move(message))
1011
{
1112
}
1213
Fortune() = default;
13-
string_view id_;
14-
string_view message_;
14+
std::string_view id_;
15+
std::string_view message_;
1516
};
1617
class FortuneCtrlRaw : public drogon::HttpSimpleController<FortuneCtrlRaw>
1718
{

frameworks/C++/drogon/drogon_benchmark/controllers/UpdatesCtrlRaw.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void UpdatesCtrlRaw::update(
4343
const DbClientPtr &client)
4444
{
4545
auto const &sql = getSQL(results->size());
46-
auto sqlBinder = *client << string_view(sql.data(), sql.length());
46+
auto sqlBinder = *client << std::string_view(sql.data(), sql.length());
4747
Json::Value json;
4848
json.resize(0);
4949
for (auto const &w : *results)

frameworks/C++/paozhu/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# paozhu Benchmarking Test
2+
3+
This is the [Paozhu](https://github.com/hggq/paozhu)
4+
5+
This Benchmarking Test code from https://github.com/hggq/paozhu/releases/tag/v1.5.8
6+
7+
### Test Type Implementation Source Code
8+
9+
* [Benchmark code](controller/src/techempower.cpp)
10+
* [ORM config](conf/orm.conf)
11+
* [Server config](conf/server.conf)
12+
13+
## Test URLs
14+
### JSON
15+
16+
http://localhost:8888/json
17+
18+
### PLAINTEXT
19+
20+
http://localhost:8888/plaintext
21+
22+
23+
### Single Database Query
24+
25+
http://localhost:8888/db
26+
27+
### Fortune
28+
29+
http://localhost:8888/fortunes
30+
31+
### Multiple Database Queries
32+
33+
http://localhost:8888/queries?queries=10
34+
35+
### Database Updates
36+
37+
http://localhost:8888/updates?queries=10
38+
39+
### Cache
40+
http://localhost:8888/cached-queries?count=20
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"framework": "paozhu",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"db_url": "/db",
9+
"fortune_url": "/fortunes",
10+
"query_url": "/queries?queries=",
11+
"update_url": "/updates?queries=",
12+
"cached_query_url": "/cached-queries?count=",
13+
"port": 8888,
14+
"approach": "Realistic",
15+
"classification": "Fullstack",
16+
"database": "MySQL",
17+
"framework": "paozhu",
18+
"language": "C++",
19+
"flavor": "None",
20+
"orm": "Micro",
21+
"platform": "None",
22+
"webserver": "None",
23+
"os": "Linux",
24+
"database_os": "Linux",
25+
"display_name": "paozhu",
26+
"notes": "",
27+
"versus": "None"
28+
}
29+
}
30+
]
31+
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[framework]
2-
name = "fintrospect"
2+
name = "paozhu"
3+
authors = ["Huang ziquan <[email protected]>"]
4+
github = "https://github.com/hggq/paozhu"
35

46
[main]
57
urls.plaintext = "/plaintext"
@@ -8,12 +10,13 @@ urls.db = "/db"
810
urls.query = "/queries?queries="
911
urls.update = "/updates?queries="
1012
urls.fortune = "/fortunes"
13+
urls.cached_query = "/cached-queries?count="
1114
approach = "Realistic"
12-
classification = "Micro"
15+
classification = "Fullstack"
1316
database = "MySQL"
1417
database_os = "Linux"
1518
os = "Linux"
16-
orm = "Raw"
17-
platform = "Netty"
19+
orm = "Micro"
20+
platform = "None"
1821
webserver = "None"
19-
versus = "finagle"
22+
versus = "None"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ubuntu:22.04
2+
RUN apt-get update -yqq && apt-get install -yqq apt-utils software-properties-common wget unzip cmake git
3+
RUN apt-get install -yqq gcc g++ openssl libssl-dev zlib1g-dev build-essential locales
4+
5+
RUN apt-get -y install brotli libbrotli-dev
6+
RUN apt-get -y install libreadline-dev
7+
RUN apt-get -y install mysql-client
8+
RUN apt-get -y install libmysqlclient-dev
9+
10+
RUN locale-gen en_US.UTF-8
11+
ENV LANG en_US.UTF-8
12+
ENV LANGUAGE en_US:en
13+
ENV LC_ALL en_US.UTF-8
14+
15+
COPY ./ ./
16+
WORKDIR /
17+
18+
# RUN wget https://github.com/hggq/paozhu/releases/download/v1.5.8/benchmark.zip
19+
RUN git clone https://github.com/hggq/paozhu
20+
# RUN unzip benchmark.zip
21+
RUN rm -Rf ./paozhu/controller
22+
RUN rm -Rf ./paozhu/libs
23+
RUN mkdir ./paozhu/libs
24+
RUN mkdir ./paozhu/libs/types
25+
26+
RUN mkdir ./paozhu/controller
27+
RUN mkdir ./paozhu/controller/include
28+
RUN mkdir ./paozhu/controller/src
29+
30+
COPY ./paozhu_benchmark/controller/include/techempower.h ./paozhu/controller/include/
31+
COPY ./paozhu_benchmark/controller/src/techempower.cpp ./paozhu/controller/src/
32+
33+
COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/
34+
COPY ./paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp ./paozhu/libs/types/
35+
36+
COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/
37+
COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/
38+
COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/
39+
COPY ./paozhu_benchmark/common/json_reflect_headers.h ./paozhu/common/
40+
41+
COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf
42+
COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf
43+
COPY ./paozhu_benchmark/CMakeLists.txt ./paozhu/CMakeLists.txt
44+
45+
WORKDIR /paozhu
46+
RUN unzip asio.zip
47+
48+
RUN cmake . -B build -DCMAKE_BUILD_TYPE=Release
49+
RUN cmake --build build
50+
51+
52+
EXPOSE 8888
53+
54+
CMD ./bin/paozhu

0 commit comments

Comments
 (0)