Skip to content

Commit b82f43c

Browse files
Merge pull request #2222 from TechEmpower/round-13
Fold round-13 into master
2 parents 82e9939 + c56fab7 commit b82f43c

File tree

297 files changed

+10476
-1035
lines changed

Some content is hidden

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

297 files changed

+10476
-1035
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ env:
2020
- "TESTDIR=C/duda"
2121
- "TESTDIR=C/haywire"
2222
- "TESTDIR=C/onion"
23+
- "TESTDIR=C/h2o"
2324
- "TESTDIR=CSharp/aspnet"
25+
- "TESTDIR=CSharp/aspnetcore"
2426
## - "TESTDIR=CSharp/aspnet-stripped"
2527
- "TESTDIR=CSharp/evhttp-sharp"
2628
## - "TESTDIR=CSharp/HttpListener"
2729
- "TESTDIR=CSharp/nancy"
2830
- "TESTDIR=CSharp/revenj"
2931
- "TESTDIR=CSharp/servicestack"
3032
- "TESTDIR=C++/cpoll_cppsp"
33+
- "TESTDIR=C++/cutelyst"
3134
- "TESTDIR=C++/silicon"
3235
- "TESTDIR=C++/treefrog"
3336
- "TESTDIR=C++/ulib"
@@ -54,6 +57,7 @@ env:
5457
- "TESTDIR=Erlang/mochiweb"
5558
- "TESTDIR=Erlang/misultin"
5659
- "TESTDIR=Go/beego"
60+
- "TESTDIR=Go/echo"
5761
- "TESTDIR=Go/falcore"
5862
- "TESTDIR=Go/fasthttp"
5963
- "TESTDIR=Go/gin"
@@ -65,6 +69,7 @@ env:
6569
- "TESTDIR=Haskell/snap"
6670
- "TESTDIR=Haskell/wai"
6771
- "TESTDIR=Haskell/yesod"
72+
- "TESTDIR=Haskell/servant"
6873
- "TESTDIR=Haskell/spock"
6974
- "TESTDIR=Java/activeweb"
7075
- "TESTDIR=Java/baratine"
@@ -112,6 +117,7 @@ env:
112117
- "TESTDIR=JavaScript/ringojs"
113118
- "TESTDIR=JavaScript/ringojs-convenient"
114119
- "TESTDIR=JavaScript/sailsjs"
120+
- "TESTDIR=Kotlin/hexagon"
115121
- "TESTDIR=Lua/lapis"
116122
- "TESTDIR=Lua/openresty"
117123
- "TESTDIR=Nim/jester"
@@ -187,6 +193,7 @@ env:
187193
- "TESTDIR=Scala/scalatra"
188194
- "TESTDIR=Scala/scruffy"
189195
- "TESTDIR=Scala/spray"
196+
- "TESTDIR=Scala/s-server"
190197
- "TESTDIR=Scala/spray-es"
191198
- "TESTDIR=Scala/unfiltered"
192199
- "TESTDIR=Scala/http4s"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
project(cutelyst_benchmarks)
2+
3+
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
4+
if (POLICY CMP0043)
5+
cmake_policy(SET CMP0043 NEW)
6+
endif()
7+
8+
find_package(Qt5 COMPONENTS Core Network Sql REQUIRED)
9+
find_package(CutelystQt5 REQUIRED)
10+
11+
# Auto generate moc files
12+
set(CMAKE_AUTOMOC ON)
13+
14+
# As moc files are generated in the binary dir, tell CMake
15+
# to always look for includes there:
16+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
17+
18+
# Enable C++11 features
19+
add_definitions(-std=c++11)
20+
21+
include_directories(
22+
${CMAKE_SOURCE_DIR}
23+
${CMAKE_CURRENT_BINARY_DIR}
24+
${CutelystQt5_INCLUDE_DIR}
25+
)
26+
27+
file(GLOB_RECURSE TEMPLATES_SRC root/*)
28+
29+
add_subdirectory(src)
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"framework": "cutelyst",
3+
"tests": [{
4+
"default": {
5+
"setup_file": "setup",
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"port": 8080,
9+
"approach": "Realistic",
10+
"classification": "Fullstack",
11+
"database": "None",
12+
"framework": "cutelyst",
13+
"language": "C++",
14+
"orm": "Raw",
15+
"platform": "Qt",
16+
"webserver": "None",
17+
"os": "Linux",
18+
"database_os": "Linux",
19+
"display_name": "cutelyst-uwsgi",
20+
"notes": "",
21+
"versus": ""
22+
},
23+
"postgres-raw": {
24+
"setup_file": "setup",
25+
"db_url": "/db_postgres",
26+
"query_url": "/query_postgres?queries=",
27+
"update_url": "/updates_postgres?queries=",
28+
"fortune_url": "/fortunes_raw_postgres",
29+
"port": 8080,
30+
"approach": "Realistic",
31+
"classification": "Platform",
32+
"database": "Postgres",
33+
"framework": "cutelyst",
34+
"language": "C++",
35+
"orm": "Raw",
36+
"platform": "Qt",
37+
"webserver": "None",
38+
"os": "Linux",
39+
"database_os": "Linux",
40+
"display_name": "cutelyst-uwsgi-pg-raw",
41+
"notes": "",
42+
"versus": ""
43+
},
44+
"mysql-raw": {
45+
"setup_file": "setup",
46+
"db_url": "/db_mysql",
47+
"query_url": "/query_mysql?queries=",
48+
"update_url": "/updates_mysql?queries=",
49+
"fortune_url": "/fortunes_raw_mysql",
50+
"port": 8080,
51+
"approach": "Realistic",
52+
"classification": "Platform",
53+
"database": "MySQL",
54+
"framework": "cutelyst",
55+
"language": "C++",
56+
"orm": "Raw",
57+
"platform": "Qt",
58+
"webserver": "None",
59+
"os": "Linux",
60+
"database_os": "Linux",
61+
"display_name": "cutelyst-uwsgi-mysql-raw",
62+
"notes": "",
63+
"versus": ""
64+
},
65+
"nginx": {
66+
"setup_file": "setup_uwsgi_nginx",
67+
"json_url": "/json",
68+
"plaintext_url": "/plaintext",
69+
"port": 8080,
70+
"approach": "Realistic",
71+
"classification": "Fullstack",
72+
"database": "None",
73+
"framework": "cutelyst",
74+
"language": "C++",
75+
"orm": "Raw",
76+
"platform": "Qt",
77+
"webserver": "None",
78+
"os": "Linux",
79+
"database_os": "Linux",
80+
"display_name": "cutelyst-uwsgi-nginx",
81+
"notes": "",
82+
"versus": ""
83+
},
84+
"nginx-postgres-raw": {
85+
"setup_file": "setup_uwsgi_nginx",
86+
"db_url": "/db_postgres",
87+
"query_url": "/query_postgres?queries=",
88+
"update_url": "/updates_postgres?queries=",
89+
"fortune_url": "/fortunes_raw_postgres",
90+
"port": 8080,
91+
"approach": "Realistic",
92+
"classification": "Platform",
93+
"database": "Postgres",
94+
"framework": "cutelyst",
95+
"language": "C++",
96+
"orm": "Raw",
97+
"platform": "Qt",
98+
"webserver": "None",
99+
"os": "Linux",
100+
"database_os": "Linux",
101+
"display_name": "cutelyst-uwsgi-nginx-pg-raw",
102+
"notes": "",
103+
"versus": ""
104+
},
105+
"nginx-mysql-raw": {
106+
"setup_file": "setup_uwsgi_nginx",
107+
"db_url": "/db_mysql",
108+
"query_url": "/query_mysql?queries=",
109+
"update_url": "/updates_mysql?queries=",
110+
"fortune_url": "/fortunes_raw_mysql",
111+
"port": 8080,
112+
"approach": "Realistic",
113+
"classification": "Platform",
114+
"database": "MySQL",
115+
"framework": "cutelyst",
116+
"language": "C++",
117+
"orm": "Raw",
118+
"platform": "Qt",
119+
"webserver": "None",
120+
"os": "Linux",
121+
"database_os": "Linux",
122+
"display_name": "cutelyst-uwsgi-nginx-mysql-raw",
123+
"notes": "",
124+
"versus": ""
125+
}
126+
}]
127+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[uwsgi]
2+
master
3+
; Increase listen queue used for nginx connecting to uWSGI. This matches
4+
; net.ipv4.tcp_max_syn_backlog and net.core.somaxconn.
5+
; for performance
6+
disable-logging
7+
; use UNIX sockets instead of TCP loopback for performance
8+
http-socket = :8080
9+
; Avoid thundering herd problem http://uwsgi-docs.readthedocs.org/en/latest/articles/SerializingAccept.html .
10+
; This is currently disabled because when I tried it with flask, it caused a
11+
; 20% performance hit. The CPU cores could not be saturated with thunder-lock.
12+
; I'm not yet sure the full story, so this is presently disabled. Also,
13+
; disabling this caused bottle to get ~13% faster.
14+
;thunder-lock
15+
; used by uwsgi_stop.ini
16+
pidfile = /tmp/uwsgi.pid
17+
plugin = cutelyst
18+
19+
[Cutelyst]
20+
DatabaseHostName=
21+
SendDate=
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[uwsgi]
2+
master
3+
; Increase listen queue used for nginx connecting to uWSGI. This matches
4+
; net.ipv4.tcp_max_syn_backlog and net.core.somaxconn.
5+
; for performance
6+
disable-logging
7+
; use UNIX sockets instead of TCP loopback for performance
8+
socket = /tmp/uwsgi.sock
9+
; allow nginx to access the UNIX socket
10+
chmod-socket = 666
11+
; Avoid thundering herd problem http://uwsgi-docs.readthedocs.org/en/latest/articles/SerializingAccept.html .
12+
; This is currently disabled because when I tried it with flask, it caused a
13+
; 20% performance hit. The CPU cores could not be saturated with thunder-lock.
14+
; I'm not yet sure the full story, so this is presently disabled. Also,
15+
; disabling this caused bottle to get ~13% faster.
16+
;thunder-lock
17+
; used by uwsgi_stop.ini
18+
pidfile = /tmp/uwsgi.pid
19+
plugin = cutelyst
20+
21+
[Cutelyst]
22+
DatabaseHostName=
23+
SendDate=

frameworks/C++/cutelyst/nginx.conf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This file is based on /usr/local/nginx/conf/nginx.conf.default.
2+
3+
# One worker process per core
4+
error_log stderr error;
5+
6+
events {
7+
# This needed to be increased because the nginx error log said so.
8+
# http://nginx.org/en/docs/ngx_core_module.html#worker_connections
9+
worker_connections 65535;
10+
multi_accept on;
11+
}
12+
13+
http {
14+
default_type application/octet-stream;
15+
client_body_temp_path /tmp;
16+
17+
# turn off request logging for performance
18+
access_log off;
19+
20+
# I think these only options affect static file serving
21+
sendfile on;
22+
tcp_nopush on;
23+
24+
# Allow many HTTP Keep-Alive requests in a single TCP connection before
25+
# closing it (the default is 100). This will minimize the total number
26+
# of TCP connections opened/closed. The problem is that this may cause
27+
# some worker processes to be handling too connections relative to the
28+
# other workers based on an initial imbalance, so this is disabled for
29+
# now.
30+
# keepalive_requests 1000;
31+
32+
#keepalive_timeout 0;
33+
keepalive_timeout 65;
34+
35+
server {
36+
# For information on deferred, see:
37+
# http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
38+
# http://www.techrepublic.com/article/take-advantage-of-tcp-ip-options-to-optimize-data-transmission/
39+
# The backlog argument to listen() is set to match net.ipv4.tcp_max_syn_backlog and net.core.somaxconn
40+
listen 8080 default_server deferred backlog=65535;
41+
server_name localhost;
42+
43+
location / {
44+
uwsgi_pass unix:/tmp/uwsgi.sock;
45+
include /usr/local/nginx/conf/uwsgi_params;
46+
}
47+
}
48+
}

frameworks/C++/cutelyst/setup.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
fw_depends cutelyst
4+
5+
sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config.ini
6+
sed -i 's|SendDate=.*|SendDate=true|g' config/config.ini
7+
8+
cd $IROOT
9+
mkdir cutelyst-benchmarks || true
10+
cd cutelyst-benchmarks
11+
rm -rf *
12+
13+
QT_VERSION_MM=56
14+
export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
15+
16+
cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
17+
18+
make clean
19+
make -j $MAX_THREADS
20+
21+
export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
22+
uwsgi --ini ${TROOT}/config/config.ini --cutelyst-app ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so -p $(( $MAX_THREADS * 2 )) &
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
fw_depends cutelyst nginx
4+
5+
sed -i 's|DatabaseHostName=.*|DatabaseHostName='"$DBHOST"'|g' config/config_socket.ini
6+
sed -i 's|SendDate=.*|SendDate=false|g' config/config_socket.ini
7+
sed -i 's|include .*/conf/uwsgi_params;|include '"${NGINX_HOME}"'/conf/uwsgi_params;|g' nginx.conf
8+
9+
cd $IROOT
10+
mkdir cutelyst-benchmarks || true
11+
cd cutelyst-benchmarks
12+
rm -rf *
13+
14+
QT_VERSION_MM=56
15+
export CMAKE_PREFIX_PATH=/opt/qt${QT_VERSION_MM}:${IROOT}
16+
17+
cmake $TROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
18+
19+
make clean
20+
make -j $MAX_THREADS
21+
22+
nginx -c $TROOT/nginx.conf
23+
24+
export LD_LIBRARY_PATH=/opt/qt${QT_VERSION_MM}/lib:${IROOT}/lib/x86_64-linux-gnu/
25+
uwsgi --ini ${TROOT}/config/config_socket.ini --cutelyst-app ${IROOT}/cutelyst-benchmarks/src/libcutelyst_benchmarks.so -p $(( $MAX_THREADS * 2 )) &
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cutelyst/
2+
cutelyst/CMakeLists.txt
3+
cutelyst/src
4+
cutelyst/src/plaintexttest.cpp
5+
cutelyst/src/jsontest.cpp
6+
cutelyst/src/fortunetest.h
7+
cutelyst/src/CMakeLists.txt
8+
cutelyst/src/plaintexttest.h
9+
cutelyst/src/multipledatabasequeriestest.h
10+
cutelyst/src/multipledatabasequeriestest.cpp
11+
cutelyst/src/databaseupdatestest.h
12+
cutelyst/src/databaseupdatestest.cpp
13+
cutelyst/src/jsontest.h
14+
cutelyst/src/singledatabasequerytest.cpp
15+
cutelyst/src/singledatabasequerytest.h
16+
cutelyst/src/cutelyst-benchmarks.cpp
17+
cutelyst/src/cutelyst-benchmarks.h
18+
cutelyst/src/root.h
19+
cutelyst/src/root.cpp
20+
cutelyst/src/fortunetest.cpp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
file(GLOB_RECURSE cutelyst_benchmarks_SRCS *.cpp *.h)
2+
3+
set(cutelyst_benchmarks_SRCS
4+
${cutelyst_benchmarks_SRCS}
5+
${TEMPLATES_SRC}
6+
)
7+
8+
# Create the application
9+
add_library(cutelyst_benchmarks SHARED ${cutelyst_benchmarks_SRCS})
10+
11+
# Link to Cutelyst
12+
target_link_libraries(cutelyst_benchmarks
13+
Cutelyst::Core
14+
Cutelyst::Utils::Sql
15+
Qt5::Core
16+
Qt5::Network
17+
Qt5::Sql
18+
)
19+

0 commit comments

Comments
 (0)