Skip to content

Commit 5468f3d

Browse files
authored
Merge pull request #2 from TechEmpower/master
Merging base branch
2 parents 611ac11 + 9b93d5a commit 5468f3d

File tree

372 files changed

+3248
-15458
lines changed

Some content is hidden

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

372 files changed

+3248
-15458
lines changed

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ env:
4040
- "TESTDIR=Clojure/pedestal"
4141
- "TESTDIR=Clojure/aleph"
4242
- "TESTDIR=Crystal/crystal-raw"
43-
- "TESTDIR=Crystal/moonshine"
4443
- "TESTDIR=Crystal/kemal"
4544
- "TESTDIR=D/vibed"
4645
- "TESTDIR=Dart/dart-raw"
@@ -56,16 +55,11 @@ env:
5655
- "TESTDIR=Erlang/misultin"
5756
- "TESTDIR=Go/beego"
5857
- "TESTDIR=Go/falcore"
59-
- "TESTDIR=Go/fasthttp-mysql"
60-
- "TESTDIR=Go/fasthttp-postgresql"
58+
- "TESTDIR=Go/fasthttp"
6159
- "TESTDIR=Go/gin"
6260
- "TESTDIR=Go/goji"
63-
- "TESTDIR=Go/go-std-mongodb"
64-
- "TESTDIR=Go/go-std-mysql"
65-
- "TESTDIR=Go/go-std-postgresql"
61+
- "TESTDIR=Go/go-std"
6662
- "TESTDIR=Go/revel"
67-
- "TESTDIR=Go/revel-jet"
68-
- "TESTDIR=Go/revel-qbs"
6963
- "TESTDIR=Go/webgo"
7064
- "TESTDIR=Groovy/grails"
7165
- "TESTDIR=Haskell/snap"
@@ -85,6 +79,7 @@ env:
8579
- "TESTDIR=Java/jawn"
8680
- "TESTDIR=Java/jetty-servlet"
8781
- "TESTDIR=Java/jetty"
82+
- "TESTDIR=Java/jlhttp"
8883
- "TESTDIR=Java/jooby"
8984
- "TESTDIR=Java/netty"
9085
- "TESTDIR=Java/ninja-standalone"
@@ -185,6 +180,7 @@ env:
185180
- "TESTDIR=Scala/akka-http"
186181
- "TESTDIR=Scala/colossus"
187182
- "TESTDIR=Scala/finagle"
183+
- "TESTDIR=Scala/finatra"
188184
- "TESTDIR=Scala/fintrospect"
189185
- "TESTDIR=Scala/lift-stateless"
190186
- "TESTDIR=Scala/plain"

config/php.ini

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ zend.enable_gc = On
372372
; threat in any way, but it makes it possible to determine whether you use PHP
373373
; on your server or not.
374374
; http://php.net/expose-php
375-
expose_php = On
375+
expose_php = Off
376376

377377
;;;;;;;;;;;;;;;;;;;
378378
; Resource Limits ;
@@ -868,9 +868,10 @@ default_socket_timeout = 60
868868
;extension=apc.so
869869
zend_extension=opcache.so
870870
extension=redis.so
871-
extension=phalcon.so
871+
;extension=phalcon.so
872872
;extension=yaf.so
873873
extension=mongodb.so
874+
extension=mongo.so
874875
;extension=php_bz2.dll
875876
;extension=php_curl.dll
876877
;extension=php_fileinfo.dll
@@ -1865,10 +1866,17 @@ ldap.max_links = -1
18651866
; Local Variables:
18661867
; tab-width: 4
18671868
; End:
1868-
[apc]
1869-
apc.stat = 0
1870-
apc.enable_cli = 1
1871-
apc.shm_size = 64M
1869+
;[apc]
1870+
;apc.stat = 0
1871+
;apc.enable_cli = 1
1872+
;apc.shm_size = 64M
1873+
1874+
[opcache]
1875+
opcache.validate_timestamps = 0 ; The same that apc.stat = 0
1876+
;opcache.enable_file_override = 1 ; Faster for some frameworks
1877+
;opcache.save_comments = 0 ; Breaks any fw using annotations comments
1878+
;opcache.fast_shutdown = 1 ; Have problems with some big frameworks
1879+
18721880

18731881
[yaf]
18741882
yaf.library =

frameworks/C++/treefrog/benchmark_config.json

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
"framework": "treefrog",
33
"tests": [{
44
"default": {
5+
"setup_file": "setup-thread",
6+
"json_url": "/json/json",
7+
"db_url": "/world/random",
8+
"query_url": "/world/queries/",
9+
"fortune_url": "/fortune/index",
10+
"update_url": "/world/updates/",
11+
"plaintext_url": "/world/plain",
12+
"port": 8080,
13+
"approach": "Realistic",
14+
"classification": "Fullstack",
15+
"database": "MySQL",
16+
"framework": "treefrog",
17+
"language": "C++",
18+
"orm": "Micro",
19+
"platform": "Treefrog",
20+
"webserver": "None",
21+
"os": "Linux",
22+
"database_os": "Linux",
23+
"display_name": "treefrog-thread",
24+
"notes": "",
25+
"versus": ""
26+
},
27+
"hybrid": {
528
"setup_file": "setup",
629
"json_url": "/json/json",
730
"db_url": "/world/random",
@@ -24,8 +47,8 @@
2447
"notes": "",
2548
"versus": ""
2649
},
27-
"thread": {
28-
"setup_file": "setup-thread",
50+
"postgres": {
51+
"setup_file": "setup-postgres",
2952
"json_url": "/json/json",
3053
"db_url": "/world/random",
3154
"query_url": "/world/queries/",
@@ -35,15 +58,38 @@
3558
"port": 8080,
3659
"approach": "Realistic",
3760
"classification": "Fullstack",
38-
"database": "MySQL",
61+
"database": "Postgres",
3962
"framework": "treefrog",
4063
"language": "C++",
4164
"orm": "Micro",
4265
"platform": "Treefrog",
4366
"webserver": "None",
4467
"os": "Linux",
4568
"database_os": "Linux",
46-
"display_name": "treefrog-thread",
69+
"display_name": "treefrog-postgres",
70+
"notes": "",
71+
"versus": ""
72+
},
73+
"mongodb": {
74+
"setup_file": "setup-mongodb",
75+
"json_url": "/json/json",
76+
"db_url": "/world/mrandom",
77+
"query_url": "/world/mqueries/",
78+
"fortune_url": "/fortune/mindex",
79+
"update_url": "/world/mupdates/",
80+
"plaintext_url": "/world/plain",
81+
"port": 8080,
82+
"approach": "Realistic",
83+
"classification": "Fullstack",
84+
"database": "MongoDB",
85+
"framework": "treefrog",
86+
"language": "C++",
87+
"orm": "Micro",
88+
"platform": "Treefrog",
89+
"webserver": "None",
90+
"os": "Linux",
91+
"database_os": "Linux",
92+
"display_name": "treefrog-mongo",
4793
"notes": "",
4894
"versus": ""
4995
}

frameworks/C++/treefrog/config/application.ini

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ InternalEncoding=UTF-8
1414
# specified encoding. See QTextCodec class reference.
1515
HttpOutputEncoding=UTF-8
1616

17-
# Sets the charset parameter of 'text/html' in the HTTP Content-Type
18-
# header to the specified string.
19-
HtmlContentCharset=UTF-8
20-
2117
# Sets a language/country pair, such as en_US, ja_JP, etc.
2218
# If this value is empty, the system's locale is used.
2319
Locale=
@@ -33,7 +29,7 @@ UploadTemporaryDirectory=tmp
3329
SqlDatabaseSettingsFiles=database.ini
3430

3531
# Specify the setting file for MongoDB.
36-
MongoDbSettingsFile=
32+
MongoDbSettingsFile=mongodb.ini
3733

3834
# Specify the directory path to store SQL query files
3935
SqlQueriesStoredDirectory=sql/
@@ -64,6 +60,25 @@ LimitRequestBody=0
6460
# forgery never work; otherwise it's enabled.
6561
EnableCsrfProtectionModule=false
6662

63+
# Enables HTTP method override if true. The following are priorities of
64+
# override.
65+
# - Value of query parameter named '_method'
66+
# - Value of X-HTTP-Method-Override header
67+
# - Value of X-HTTP-Method header
68+
# - Value of X-METHOD-OVERRIDE header
69+
EnableHttpMethodOverride=false
70+
71+
# Sets the timeout in seconds during which a keep-alive HTTP connection
72+
# will stay open on the server side. The zero value disables keep-alive
73+
# client connections.
74+
HttpKeepAliveTimeout=10
75+
76+
# Forces some libraries to be loaded before all others. It means to set
77+
# the LD_PRELOAD environment variable for the application server, Linux
78+
# only. The paths to shared objects, jemalloc or TCMalloc, can be
79+
# specified.
80+
LDPreload=/usr/lib/x86_64-linux-gnu/libjemalloc.so
81+
6782
##
6883
## Session section
6984
##
@@ -112,19 +127,6 @@ MPM.thread.MaxAppServers=10
112127
# per server process.
113128
MPM.thread.MaxThreadsPerAppServer=100
114129

115-
##
116-
## MPM Prefork section
117-
##
118-
119-
# Maximum number of server processes allowed to start
120-
MPM.prefork.MaxServers=20
121-
122-
# Minimum number of server processes allowed to start
123-
MPM.prefork.MinServers=5
124-
125-
# Number of server processes which are kept spare
126-
MPM.prefork.SpareServers=5
127-
128130
##
129131
## MPM Hybrid section
130132
##

frameworks/C++/treefrog/config/mongodb.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
[dev]
6-
DatabaseName=mdb
6+
DatabaseName=hello_world
77
HostName=localhost
88
Port=
99
UserName=
@@ -19,8 +19,8 @@ Password=
1919
ConnectOptions=
2020

2121
[product]
22-
DatabaseName=
23-
HostName=
22+
DatabaseName=hello_world
23+
HostName=localhost
2424
Port=
2525
UserName=
2626
Password=

frameworks/C++/treefrog/controllers/controllers.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TARGET = controller
22
TEMPLATE = lib
33
CONFIG += shared x86_64 c++11
4-
QT += network sql xml
4+
QT += network sql xml qml
55
QT -= gui
66
DEFINES += TF_DLL
77
DESTDIR = ../lib

frameworks/C++/treefrog/controllers/fortunecontroller.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#include "fortunecontroller.h"
22
#include "fortune.h"
3+
#include "mngfortune.h"
34

45
static bool caseSensitiveLessThan(const Fortune &f1, const Fortune &f2)
56
{
67
return f1.message() < f2.message();
78
}
89

10+
static bool caseSensitiveMngFortuneLessThan(const MngFortune &f1, const MngFortune &f2)
11+
{
12+
return f1.message() < f2.message();
13+
}
14+
915
FortuneController::FortuneController(const FortuneController &)
1016
: ApplicationController()
1117
{ }
@@ -22,6 +28,18 @@ void FortuneController::index()
2228
render();
2329
}
2430

31+
void FortuneController::mindex()
32+
{
33+
QList<MngFortune> fortuneList = MngFortune::getAll();
34+
MngFortune fortune;
35+
fortune.setMessage(QLatin1String("Additional fortune added at request time."));
36+
fortuneList << fortune;
37+
// Sort
38+
qSort(fortuneList.begin(), fortuneList.end(), caseSensitiveMngFortuneLessThan);
39+
texport(fortuneList);
40+
render("mindex");
41+
}
42+
2543
void FortuneController::show(const QString &pk)
2644
{
2745
Fortune fortune = Fortune::get(pk.toUInt());

frameworks/C++/treefrog/controllers/fortunecontroller.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class T_CONTROLLER_EXPORT FortuneController : public ApplicationController
1414
bool transactionEnabled() const { return false; }
1515

1616
public slots:
17-
void index();
17+
void index(); // SQL
18+
void mindex(); // MongoDB
1819
void show(const QString &pk);
1920
void entry();
2021
void create();

frameworks/C++/treefrog/controllers/worldcontroller.cpp

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "worldcontroller.h"
22
#include "world.h"
3+
#include "mngworld.h"
34

45

56
WorldController::WorldController(const WorldController &)
@@ -139,7 +140,7 @@ void WorldController::updates(const QString &num)
139140
world = World::get(id);
140141
world.setRandomNumber( Tf::random(9999) + 1 );
141142
world.update();
142-
worlds << world.toVariantMap();
143+
worlds << world.toVariantMap();
143144
}
144145
renderJson(worlds);
145146
}
@@ -156,5 +157,54 @@ void WorldController::remove(const QString &pk)
156157
}
157158

158159

160+
161+
/*
162+
MongoDB
163+
*/
164+
void WorldController::mqueries()
165+
{
166+
mqueries("1");
167+
}
168+
169+
void WorldController::mqueries(const QString &num)
170+
{
171+
QVariantList worlds;
172+
int d = qMin(qMax(num.toInt(), 1), 500);
173+
174+
for (int i = 0; i < d; ++i) {
175+
QString id = QString::number(Tf::random(9999) + 1);
176+
worlds << MngWorld::get(id).toVariantMap();
177+
}
178+
renderJson(worlds);
179+
}
180+
181+
void WorldController::mrandom()
182+
{
183+
int id = Tf::random(9999) + 1;
184+
World world = World::get(id);
185+
renderJson(world.toVariantMap());
186+
}
187+
188+
void WorldController::mupdates()
189+
{
190+
mupdates("1");
191+
}
192+
193+
void WorldController::mupdates(const QString &num)
194+
{
195+
QVariantList worlds;
196+
int d = qMin(qMax(num.toInt(), 1), 500);
197+
MngWorld world;
198+
199+
for (int i = 0; i < d; ++i) {
200+
QString id = QString::number(Tf::random(9999) + 1);
201+
world = MngWorld::get(id);
202+
world.setRandomNumber( Tf::random(9999) + 1 );
203+
world.update();
204+
worlds << world.toVariantMap();
205+
}
206+
renderJson(worlds);
207+
}
208+
159209
// Don't remove below this line
160210
T_REGISTER_CONTROLLER(worldcontroller)

frameworks/C++/treefrog/controllers/worldcontroller.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ public slots:
2828
void updates();
2929
void remove(const QString &pk);
3030

31+
// MongoDB
32+
void mqueries();
33+
void mqueries(const QString &num);
34+
void mrandom();
35+
void mupdates(const QString &num);
36+
void mupdates();
37+
3138
private:
3239
void renderEntry(const QVariantMap &world = QVariantMap());
3340
void renderEdit(const QVariantMap &world = QVariantMap());

0 commit comments

Comments
 (0)