Ver código fonte

Cutelyst updates (#2835)

* cutelyst: Don't use deprecated qSort()

* cutelyst: Uptade to 1.7.0 version

* cutelyst: use shorter display names and add temporary tests

New tests are to see if we get a performance gain like
prefork did by avoiding HyperThreading binding each
worker to 2 logical CPUs and using half of the thread workers
Daniel Nicoletti 8 anos atrás
pai
commit
559b14cbb3

+ 51 - 11
frameworks/C++/cutelyst/benchmark_config.json

@@ -58,7 +58,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-pf-mysql",
+                "display_name": "cutelyst-pf-my",
                 "notes": "",
                 "versus": ""
             },
@@ -77,7 +77,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread",
+                "display_name": "cutelyst-thr",
                 "notes": "",
                 "versus": ""
             },
@@ -98,7 +98,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread-pg-raw",
+                "display_name": "cutelyst-thr-pg-raw",
                 "notes": "",
                 "versus": ""
             },
@@ -119,7 +119,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread-mysql-raw",
+                "display_name": "cutelyst-thr-my-raw",
                 "notes": "",
                 "versus": ""
             },
@@ -180,7 +180,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-pf-mysql-epoll",
+                "display_name": "cutelyst-pf-my-epoll",
                 "notes": "",
                 "versus": ""
             },
@@ -199,7 +199,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread-epoll",
+                "display_name": "cutelyst-thr-epoll",
                 "notes": "",
                 "versus": ""
             },
@@ -220,7 +220,7 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread-pg-epoll",
+                "display_name": "cutelyst-thr-pg-epoll",
                 "notes": "",
                 "versus": ""
             },
@@ -241,7 +241,47 @@
                 "webserver": "None",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-thread-mysql-epoll",
+                "display_name": "cutelyst-thr-my-epoll",
+                "notes": "",
+                "versus": ""
+            },
+            "thread-epoll-half": {
+                "setup_file": "setup_thread_epoll_half",
+                "json_url": "/json",
+                "plaintext_url": "/plaintext",
+                "port": 8080,
+                "approach": "Realistic",
+                "classification": "Fullstack",
+                "database": "None",
+                "framework": "cutelyst",
+                "language": "C++",
+                "orm": "Raw",
+                "platform": "Qt",
+                "webserver": "None",
+                "os": "Linux",
+                "database_os": "Linux",
+                "display_name": "cutelyst-thr-epoll-half",
+                "notes": "",
+                "versus": ""
+            },
+            "thread-postgres-epoll-half": {
+                "setup_file": "setup_thread_pg_epoll_half",
+                "db_url": "/db_postgres",
+                "query_url": "/query_postgres?queries=",
+                "update_url": "/updates_postgres?queries=",
+                "fortune_url": "/fortunes_raw_postgres",
+                "port": 8080,
+                "approach": "Realistic",
+                "classification": "Platform",
+                "database": "Postgres",
+                "framework": "cutelyst",
+                "language": "C++",
+                "orm": "Raw",
+                "platform": "Qt",
+                "webserver": "None",
+                "os": "Linux",
+                "database_os": "Linux",
+                "display_name": "cutelyst-thr-pg-epoll-half",
                 "notes": "",
                 "versus": ""
             },
@@ -260,7 +300,7 @@
                 "webserver": "nginx",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-uwsgi-nginx",
+                "display_name": "cutelyst-uwsgi-ngx",
                 "notes": "",
                 "versus": ""
             },
@@ -281,7 +321,7 @@
                 "webserver": "nginx",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-uwsgi-nginx-pg-raw",
+                "display_name": "cutelyst-uwsgi-ngx-pg-raw",
                 "notes": "",
                 "versus": ""
             },
@@ -302,7 +342,7 @@
                 "webserver": "nginx",
                 "os": "Linux",
                 "database_os": "Linux",
-                "display_name": "cutelyst-uwsgi-nginx-mysql-raw",
+                "display_name": "cutelyst-uwsgi-ngx-my-raw",
                 "notes": "",
                 "versus": ""
             }

+ 11 - 0
frameworks/C++/cutelyst/setup_thread_epoll_half.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+DRIVER=
+UWSGI=
+NGINX=
+C_PROCESSES=1
+C_THREADS=$(( (${CPU_COUNT}+1) / 2 ))
+CPU_AFFINITY=2
+export CUTELYST_EVENT_LOOP_EPOLL=1
+
+source ${TROOT}/config.sh

+ 11 - 0
frameworks/C++/cutelyst/setup_thread_pg_epoll_half.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+DRIVER=QPSQL
+UWSGI=
+NGINX=
+C_PROCESSES=1
+C_THREADS=$(( (${CPU_COUNT}+1) / 2 ))
+CPU_AFFINITY=2
+export CUTELYST_EVENT_LOOP_EPOLL=1
+
+source ${TROOT}/config.sh

+ 3 - 6
frameworks/C++/cutelyst/src/fortunetest.cpp

@@ -29,11 +29,6 @@ void FortuneTest::fortunes_raw_mysql(Context *c)
     renderRaw(c, fortunes);
 }
 
-static bool caseSensitiveLessThan(const Fortune &a1, const Fortune &a2)
-{
-    return a1.second < a2.second;
-}
-
 FortuneList FortuneTest::processQuery(Context *c, QSqlQuery &query)
 {
     FortuneList fortunes;
@@ -48,7 +43,9 @@ FortuneList FortuneTest::processQuery(Context *c, QSqlQuery &query)
     }
     fortunes.push_back({0, QStringLiteral("Additional fortune added at request time.")});
 
-    qSort(fortunes.begin(), fortunes.end(), caseSensitiveLessThan);
+    std::sort(fortunes.begin(), fortunes.end(), [] (const Fortune &a1, const Fortune &a2) {
+        return a1.second < a2.second;
+    });
 
     return fortunes;
 }

+ 1 - 1
toolset/setup/linux/frameworks/cutelyst.sh

@@ -2,7 +2,7 @@
 
 fw_installed cutelyst && return 0
 
-CUTELYST_VER=1.6.0-beta7
+CUTELYST_VER=1.7.0
 QT_VERSION_MM=56
 QT_VERSION_FULL=562-trusty
 CROOT=${IROOT}/cutelyst