Skip to content

Commit 4d4e53a

Browse files
authored
Merge branch 'TechEmpower:master' into master
2 parents 80a936e + 39e29cb commit 4d4e53a

File tree

137 files changed

+4299
-2067
lines changed

Some content is hidden

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

137 files changed

+4299
-2067
lines changed

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+
}

frameworks/C++/paozhu/config.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[framework]
2+
name = "paozhu"
3+
authors = ["Huang ziquan <[email protected]>"]
4+
github = "https://github.com/hggq/paozhu"
5+
6+
[main]
7+
urls.plaintext = "/plaintext"
8+
urls.json = "/json"
9+
urls.db = "/db"
10+
urls.query = "/queries?queries="
11+
urls.update = "/updates?queries="
12+
urls.fortune = "/fortunes"
13+
urls.cached_query = "/cached-queries?count="
14+
approach = "Realistic"
15+
classification = "Fullstack"
16+
database = "MySQL"
17+
database_os = "Linux"
18+
os = "Linux"
19+
orm = "Micro"
20+
platform = "None"
21+
webserver = "None"
22+
versus = "None"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
23+
COPY ./paozhu_benchmark/controller ./paozhu/
24+
COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/
25+
COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/
26+
COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/
27+
28+
COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf
29+
COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf
30+
COPY ./paozhu_benchmark/CMakeLists.txt ./paozhu/CMakeLists.txt
31+
32+
WORKDIR /paozhu
33+
RUN unzip asio.zip
34+
35+
RUN cmake . -B build -DCMAKE_BUILD_TYPE=Release
36+
RUN cmake --build build
37+
38+
39+
EXPOSE 8888
40+
41+
CMD ./bin/paozhu

0 commit comments

Comments
 (0)