소스 검색

Merge pull request #16 from TechEmpower/master

aa
三刀 4 년 전
부모
커밋
7efa480695
100개의 변경된 파일3240개의 추가작업 그리고 1622개의 파일을 삭제
  1. 1 0
      frameworks/C++/cutelyst/build.sh
  2. 11 2
      frameworks/C++/cutelyst/src/CMakeLists.txt
  3. 15 15
      frameworks/C++/cutelyst/src/fortunetest.cpp
  4. 1 0
      frameworks/C++/cutelyst/src/main.cpp
  5. 44 540
      frameworks/C++/ffead-cpp/benchmark_config.json
  6. 236 0
      frameworks/C++/ffead-cpp/benchmark_config_c1.json
  7. 157 0
      frameworks/C++/ffead-cpp/benchmark_config_c2.json
  8. 173 0
      frameworks/C++/ffead-cpp/benchmark_config_c3.json
  9. 752 0
      frameworks/C++/ffead-cpp/benchmark_config_orig.json
  10. 1 10
      frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile
  11. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile
  12. 2 4
      frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile
  13. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile
  14. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile
  15. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile
  16. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile
  17. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile
  18. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile
  19. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile
  20. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile
  21. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile
  22. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile
  23. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile
  24. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile
  25. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile
  26. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile
  27. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile
  28. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile
  29. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile
  30. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile
  31. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile
  32. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile
  33. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile
  34. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile
  35. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile
  36. 93 0
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile
  37. 88 0
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile
  38. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile
  39. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile
  40. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile
  41. 25 17
      frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile
  42. 25 17
      frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile
  43. 8 8
      frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh
  44. 1 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh
  45. 13 11
      frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh
  46. 1 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh
  47. 11 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh
  48. 5 0
      frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh
  49. 2 1
      frameworks/C++/ffead-cpp/run_ffead.sh
  50. 8 6
      frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh
  51. 8 6
      frameworks/C++/ffead-cpp/sql-profiled-install.sh
  52. 26 3
      frameworks/C++/ffead-cpp/sql-profiled-util.sh
  53. 2 1
      frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh
  54. 2 0
      frameworks/C++/ffead-cpp/te-benchmark-um-mgr/include/TeBkUmMgr.h
  55. 21 16
      frameworks/C++/ffead-cpp/te-benchmark-um-mgr/src/TeBkUmMgr.cpp
  56. 68 41
      frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/include/TeBkUmLpqAsync.h
  57. 459 411
      frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/src/TeBkUmLpqAsync.cpp
  58. 21 19
      frameworks/C++/ffead-cpp/te-benchmark-um-pq/include/TeBkUmLpq.h
  59. 334 250
      frameworks/C++/ffead-cpp/te-benchmark-um-pq/src/TeBkUmLpq.cpp
  60. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUm.cpp
  61. 19 19
      frameworks/C++/treefrog/benchmark_config.json
  62. 19 19
      frameworks/C++/treefrog/config.toml
  63. 2 2
      frameworks/C++/treefrog/config/application.ini
  64. 1 2
      frameworks/C++/treefrog/controllers/jsoncontroller.cpp
  65. 3 4
      frameworks/C++/treefrog/treefrog-epoll.dockerfile
  66. 3 4
      frameworks/C++/treefrog/treefrog-mongodb.dockerfile
  67. 3 4
      frameworks/C++/treefrog/treefrog-mysql.dockerfile
  68. 3 4
      frameworks/C++/treefrog/treefrog.dockerfile
  69. 2 2
      frameworks/CSharp/appmpower/benchmark_config.json
  70. 2 2
      frameworks/CSharp/appmpower/src/Db/PooledConnections.cs
  71. 2 2
      frameworks/Java/isocket-nio/pom.xml
  72. 8 0
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/Consts.java
  73. 33 0
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/DateUtil.java
  74. 7 4
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/HttpBootstrap.java
  75. 9 2
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpEntity.java
  76. 30 6
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpRequestEntity.java
  77. 64 25
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpResponseEntity.java
  78. 9 44
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/processor/PlanTextProcessor.java
  79. 2 4
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/processor/State.java
  80. 31 36
      frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/protocol/SimpleHttpProtocol.java
  81. 4 4
      frameworks/Java/officefloor/src/woof_benchmark_sqlclient/src/main/java/net/officefloor/benchmark/SqlClientOfficeFloorMain.java
  82. 9 2
      frameworks/Java/redkale/benchmark_config.json
  83. 9 5
      frameworks/Java/redkale/conf/application.xml
  84. 0 2
      frameworks/Java/redkale/conf/persistence.xml
  85. 7 0
      frameworks/Java/redkale/config.toml
  86. 152 0
      frameworks/Java/redkale/pom-native.xml
  87. 27 1
      frameworks/Java/redkale/pom.xml
  88. 1 1
      frameworks/Java/redkale/redkale-native.dockerfile
  89. 11 11
      frameworks/Java/redkale/src/main/java/org/redkalex/benchmark/Service.java
  90. 11 1
      frameworks/Java/simple-server/pom.xml
  91. 6 3
      frameworks/Java/wildfly-ee/pom.xml
  92. 1 1
      frameworks/Java/wildfly-ee/wildfly-ee.dockerfile
  93. 1 1
      frameworks/JavaScript/express/README.md
  94. 1 1
      frameworks/JavaScript/express/express-mongodb.dockerfile
  95. 1 1
      frameworks/JavaScript/express/express-mysql.dockerfile
  96. 1 1
      frameworks/JavaScript/express/express-postgres.dockerfile
  97. 1 1
      frameworks/JavaScript/express/express.dockerfile
  98. 1 1
      frameworks/JavaScript/nodejs/README.md
  99. 1 1
      frameworks/JavaScript/nodejs/nodejs.dockerfile
  100. 1 4
      frameworks/Kotlin/hexagon/README.md

+ 1 - 0
frameworks/C++/cutelyst/build.sh

@@ -7,6 +7,7 @@ export CUTELYST_VER=3.1.0
 apt update -qq && \
     apt install -yqq --no-install-recommends \
     cmake \
+    git \
     pkg-config \
     qtbase5-dev \
     libqt5sql5-mysql \

+ 11 - 2
frameworks/C++/cutelyst/src/CMakeLists.txt

@@ -1,15 +1,23 @@
-cmake_minimum_required(VERSION 3.6.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.11.0 FATAL_ERROR)
 
 project(cutelyst_benchmarks LANGUAGES CXX)
 
 cmake_policy(SET CMP0069 NEW)
 
+include(FetchContent)
+
+FetchContent_Declare(
+  mimalloc
+  GIT_REPOSITORY https://github.com/microsoft/mimalloc.git
+  GIT_TAG        b3b0fb58326a96beea1f4872bc1489d1d9fda7e0 # v2.0.2
+)
+FetchContent_MakeAvailable(mimalloc)
+
 find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core Network Sql)
 find_package(ASqlQt5 0.43.0 REQUIRED)
 find_package(Cutelyst3Qt5 3.1 REQUIRED)
 find_package(Cutelee6Qt5 6.0.0 REQUIRED)
 find_package(PostgreSQL REQUIRED)
-find_package(mimalloc 1.0)
 
 # Auto generate moc files
 set(CMAKE_AUTOMOC ON)
@@ -69,6 +77,7 @@ target_link_libraries(cutelyst-benchmarks
     Qt5::Network
     Qt5::Sql
     ASqlQt5::Core
+    mimalloc
 )
 if (mimalloc_FOUND)
     target_link_libraries(cutelyst-benchmarks PUBLIC mimalloc)

+ 15 - 15
frameworks/C++/cutelyst/src/fortunetest.cpp

@@ -28,10 +28,10 @@ void FortuneTest::fortunes_raw_p(Context *c)
         fortunes.reserve(result.size());
         auto it = result.begin();
         while (it != result.end()) {
-            fortunes.push_back({it[0].toInt(), it[1].toString()});
+            fortunes.emplace_back(Fortune{it[0].toInt(), it[1].toString()});
             ++it;
         }
-        fortunes.push_back({0, QStringLiteral("Additional fortune added at request time.")});
+        fortunes.emplace_back(Fortune{0, QStringLiteral("Additional fortune added at request time.")});
 
         std::sort(fortunes.begin(), fortunes.end(), [] (const Fortune &a1, const Fortune &a2) {
             return a1.message < a2.message;
@@ -160,24 +160,24 @@ FortuneList FortuneTest::processQuery(Context *c, QSqlQuery &query)
 
 void FortuneTest::renderRaw(Context *c, const FortuneList &fortunes) const
 {
-    QString out;
-    out.append(QStringLiteral("<!DOCTYPE html>"
-                              "<html>"
-                              "<head><title>Fortunes</title></head>"
-                              "<body>"
-                              "<table>"
-                              "<tr><th>id</th><th>message</th></tr>"));
+    QByteArray out;
+    out.append("<!DOCTYPE html>"
+                "<html>"
+                "<head><title>Fortunes</title></head>"
+                "<body>"
+                "<table>"
+                "<tr><th>id</th><th>message</th></tr>");
     out.reserve(4096);
 
     for (const Fortune &fortune : fortunes) {
-        out.append(QStringLiteral("<tr><td>"))
-                .append(QString::number(fortune.id))
-                .append(QStringLiteral("</td><td>"))
-                .append(fortune.message.toHtmlEscaped())
-                .append(QStringLiteral("</td></tr>"));
+        out.append("<tr><td>")
+            .append(QByteArray::number(fortune.id))
+            .append("</td><td>")
+            .append(fortune.message.toHtmlEscaped().toUtf8())
+            .append("</td></tr>");
     }
 
-    out.append(QStringLiteral("</table></body></html>"));
+    out.append("</table></body></html>");
 
     auto response = c->response();
     response->setBody(out);

+ 1 - 0
frameworks/C++/cutelyst/src/main.cpp

@@ -1,5 +1,6 @@
 
 #include "cutelyst-benchmarks.h"
+#include "mimalloc-new-delete.h"
 
 #include <QCoreApplication>
 

+ 44 - 540
frameworks/C++/ffead-cpp/benchmark_config.json

@@ -1,121 +1,24 @@
 {
 	"framework": "ffead-cpp",
 	"tests": [{
-		"default": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"db_url": "/te-benchmark-um/db",
-			"query_url": "/te-benchmark-um/queries?queries=",
-			"fortune_url": "/te-benchmark-um/fortunes",
-			"update_url": "/te-benchmark-um/updates?queries=",
+		"p3-b": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
-			"database": "mongodb",
+			"database": "postgres",
 			"framework": "ffead-cpp",
 			"language": "C++",
-			"orm": "Full",
+			"orm": "Raw",
 			"platform": "None",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-mongo",
-			"notes": "mongodb redis",
-			"versus": "",
-			"tags": []
-		},
-		"libreactor": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "libreactor",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-libreactor",
-			"notes": "",
-			"versus": "",
-			"tags": []
-		},
-		"crystal-http": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "crystal-http",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-crystal-http",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"d-hunt": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "hunt",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-d-hunt",
-			"notes": "",
-			"versus": "",
-			"tags": []
-		},
-		"go-gnet": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "gnet",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-go-gnet",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"rust-actix": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "actix",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-rust-actix",
-			"notes": "",
+			"display_name": "p3-b",
+			"notes": "async memory libpq batch patch profiled",
 			"versus": "",
 			"tags": []
 		},
@@ -138,7 +41,7 @@
 			"webserver": "picov",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov",
+			"display_name": "v",
 			"notes": "",
 			"versus": "",
 			"tags": []
@@ -162,7 +65,7 @@
 			"webserver": "picov",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov-raw-profiled",
+			"display_name": "v-prof",
 			"notes": "",
 			"versus": "",
 			"tags": []
@@ -186,61 +89,16 @@
 			"webserver": "picov",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov-raw-clibpqb-profiled",
+			"display_name": "v-prof-b",
 			"notes": "",
 			"versus": "",
 			"tags": []
 		},
-		"java-firenio": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "firenio",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-java-firenio",
-			"notes": "",
-			"versus": "",
-			"tags": []
-		},
-		"postgresql": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"db_url": "/te-benchmark-um/db",
-			"query_url": "/te-benchmark-um/queries?queries=",
-			"fortune_url": "/te-benchmark-um/fortunes",
-			"update_url": "/te-benchmark-um/updates?queries=",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "postgres",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "Full",
-			"platform": "None",
-			"webserver": "ffead-cpp",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"postgresql-raw": {
-			"json_url": "/te-benchmark-um-pq/json",
-			"plaintext_url": "/plaintext",
+		"postgresql-raw-profiled": {
 			"db_url": "/te-benchmark-um-pq/db",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
 			"update_url": "/te-benchmark-um-pq/updates?queries=",
-			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -252,12 +110,12 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw",
-			"notes": "memory",
+			"display_name": "pg-raw-prof",
+			"notes": "memory profiled",
 			"versus": "",
 			"tags": []
 		},
-		"postgresql-raw-profiled": {
+		"postgresql-raw-clibpqb-profiled": {
 			"db_url": "/te-benchmark-um-pq/db",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
@@ -273,16 +131,16 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw-profiled",
-			"notes": "memory profiled",
+			"display_name": "pg-raw-prof-b",
+			"notes": "memory libpq batch patch profiled",
 			"versus": "",
 			"tags": []
 		},
-		"postgresql-raw-clibpqb-profiled": {
-			"db_url": "/te-benchmark-um-pq/db",
-			"query_url": "/te-benchmark-um-pq/queries?queries=",
-			"fortune_url": "/te-benchmark-um-pq/fortunes",
-			"update_url": "/te-benchmark-um-pq/updates?queries=",
+		"postgresql-raw-async-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -294,19 +152,16 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw-clibpqb-profiled",
-			"notes": "memory libpq batch patch profiled",
+			"display_name": "pg-raw-async-prof",
+			"notes": "async memory profiled",
 			"versus": "",
 			"tags": []
 		},
-		"postgresql-raw-async": {
-			"json_url": "/te-benchmark-um-pq-async/json",
-			"plaintext_url": "/plaintext",
+		"postgresql-raw-async-pool-profiled": {
 			"db_url": "/te-benchmark-um-pq-async/db",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
-			"update_url": "/te-benchmark-um-pq-async/bupdates?queries=",
-			"cached_query_url": "/te-benchmark-um-pq-async/cached-worlds?count=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -318,16 +173,14 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw-async",
-			"notes": "async memory",
+			"display_name": "pg-raw-async-prof-pool",
+			"notes": "async memory profiled",
 			"versus": "",
 			"tags": []
 		},
-		"postgresql-raw-async-profiled": {
-			"db_url": "/te-benchmark-um-pq-async/db",
-			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
-			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
-			"update_url": "/te-benchmark-um-pq-async/bupdates?queries=",
+		"postgresql-raw-async-pool-profiled-m": {
+			"query_url": "/te-benchmark-um-pq-async/queriem?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updatem?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -339,7 +192,7 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw-async-profiled",
+			"display_name": "pg-raw-async-prof-pool-m",
 			"notes": "async memory profiled",
 			"versus": "",
 			"tags": []
@@ -348,7 +201,7 @@
 			"db_url": "/te-benchmark-um-pq-async/db",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
-			"update_url": "/te-benchmark-um-pq-async/bupdates?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
@@ -360,80 +213,20 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw-async-clibpqb-profiled",
+			"display_name": "pg-raw-async-prof-b",
 			"notes": "async memory libpq batch patch profiled",
 			"versus": "",
 			"tags": []
 		},
-		"nginx": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "Full",
-			"platform": "None",
-			"webserver": "nginx",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-nginx",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"seastar": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "seastar-http",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-seastar",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"apache": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "Full",
-			"platform": "None",
-			"webserver": "apache",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-apache",
-			"notes": "apache mongo",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"mongo-raw": {
-			"json_url": "/te-benchmark-um-mgr/json",
-			"plaintext_url": "/plaintext",
-			"db_url": "/te-benchmark-um-mgr/db",
-			"query_url": "/te-benchmark-um-mgr/queries?queries=",
-			"fortune_url": "/te-benchmark-um-mgr/fortunes",
-			"update_url": "/te-benchmark-um-mgr/updates?queries=",
-			"cached_query_url": "/te-benchmark-um-mgr/cached-worlds?count=",
+		"postgresql-raw-async-clibpqb-pool-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
 			"port": 8080,
 			"approach": "Realistic",
 			"classification": "Fullstack",
-			"database": "mongodb",
+			"database": "postgres",
 			"framework": "ffead-cpp",
 			"language": "C++",
 			"orm": "Raw",
@@ -441,299 +234,10 @@
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-mongo-raw",
-			"notes": "mongodb raw memory",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"lithium": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "lithium",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-lithium",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"cinatra": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "cinatra",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-cinatra",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"drogon": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "drogon",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-drogon",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"h2o": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "h2o",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-h2o",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"crystal-h2o": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "h2o.cr",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-crystal-h2o",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"mysql": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"db_url": "/te-benchmark-um/db",
-			"query_url": "/te-benchmark-um/queries?queries=",
-			"fortune_url": "/te-benchmark-um/fortunes",
-			"update_url": "/te-benchmark-um/updates?queries=",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "mysql",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "Full",
-			"platform": "None",
-			"webserver": "ffead-cpp",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-mysql",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"go-fasthttp": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "fasthttp",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-go-fasthttp",
-			"notes": "",
+			"display_name": "pg-raw-async-prof-b-pool",
+			"notes": "async memory libpq batch patch profiled",
 			"versus": "",
 			"tags": []
-		},
-		"julia-http": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "julia-http",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-julia-http",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"swift-nio": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "swift-nio",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-swift-nio",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"rust-hyper": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "hyper",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-rust-hyper",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"rust-thruster": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "thruster",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-rust-thruster",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"rust-rocket": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "rocket",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-rust-rocket",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"v-vweb": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "vweb",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-vweb",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"java-rapidoid": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "rapidoid",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-java-rapidoid",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
-		},
-		"java-wizzardo-http": {
-			"json_url": "/te-benchmark-um/json",
-			"plaintext_url": "/plaintext",
-			"port": 8080,
-			"approach": "Realistic",
-			"classification": "Fullstack",
-			"database": "None",
-			"framework": "ffead-cpp",
-			"language": "C++",
-			"orm": "None",
-			"platform": "None",
-			"webserver": "wizzardo-http",
-			"os": "Linux",
-			"database_os": "Linux",
-			"display_name": "ffead-cpp-java-wizzardo-http",
-			"notes": "",
-			"versus": "",
-			"tags": ["broken"]
 		}
 	}]
-}
+}

+ 236 - 0
frameworks/C++/ffead-cpp/benchmark_config_c1.json

@@ -0,0 +1,236 @@
+{
+	"framework": "ffead-cpp",
+	"tests": [{
+		"v-picov": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "v",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"v-picov-raw-profiled": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "v-prof",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"v-picov-raw-clibpqb-profiled": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "v-prof-b",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw",
+			"notes": "memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-profiled": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-prof",
+			"notes": "memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-clibpqb-profiled": {
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-prof-b",
+			"notes": "memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async",
+			"notes": "async memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-pool-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-pool",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-clibpqb-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-clibpqb-pool-profiled": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-b-pool",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		}
+	}]
+}

+ 157 - 0
frameworks/C++/ffead-cpp/benchmark_config_c2.json

@@ -0,0 +1,157 @@
+{
+	"framework": "ffead-cpp",
+	"tests": [{
+		"postgresql-raw-async": {
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async",
+			"notes": "async memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-profiled": {
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-pool-profiled": {
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-pool-prof",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-m": {
+			"query_url": "/te-benchmark-um-pq-async/queriem?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updatem?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-m",
+			"notes": "async memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-profiled-m": {
+			"query_url": "/te-benchmark-um-pq-async/queriem?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updatem?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-m",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-pool-profiled-m": {
+			"query_url": "/te-benchmark-um-pq-async/queriem?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updatem?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-pool-prof-m",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-clibpqb-profiled": {
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-clibpqb-pool-profiled": {
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "pg-raw-async-prof-b-pool",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		}
+	}]
+}

+ 173 - 0
frameworks/C++/ffead-cpp/benchmark_config_c3.json

@@ -0,0 +1,173 @@
+{
+	"framework": "ffead-cpp",
+	"tests": [{
+		"p2": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p2",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p3": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p3",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p4": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p4",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p10": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p10",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p2-b": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p2-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p3-b": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p3-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p4-b": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p4-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"p10-b": {
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "p10-b",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		}
+	}]
+}

+ 752 - 0
frameworks/C++/ffead-cpp/benchmark_config_orig.json

@@ -0,0 +1,752 @@
+{
+	"framework": "ffead-cpp",
+	"tests": [{
+		"default": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
+			"cached_query_url": "/te-benchmark-um/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "mongodb",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Full",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-mongo",
+			"notes": "mongodb redis",
+			"versus": "",
+			"tags": []
+		},
+		"libreactor": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "libreactor",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-libreactor",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"crystal-http": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "crystal-http",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-crystal-http",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"d-hunt": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "hunt",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-d-hunt",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"go-gnet": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "gnet",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-go-gnet",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"rust-actix": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "actix",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-rust-actix",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"v-picov": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-v-picov",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"v-picov-raw-profiled": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-v-picov-raw-profiled",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"v-picov-raw-clibpqb-profiled": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "picov",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-v-picov-raw-clibpqb-profiled",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"java-firenio": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "firenio",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-java-firenio",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"postgresql": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Full",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql",
+			"notes": "",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw",
+			"notes": "memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-profiled": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw-profiled",
+			"notes": "memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-clibpqb-profiled": {
+			"json_url": "/te-benchmark-um-pq/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq/db",
+			"query_url": "/te-benchmark-um-pq/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq/fortunes",
+			"update_url": "/te-benchmark-um-pq/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw-clibpqb-profiled",
+			"notes": "memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async": {
+			"json_url": "/te-benchmark-um-pq-async/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq-async/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw-async",
+			"notes": "async memory",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-profiled": {
+			"json_url": "/te-benchmark-um-pq-async/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq-async/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw-async-profiled",
+			"notes": "async memory profiled",
+			"versus": "",
+			"tags": []
+		},
+		"postgresql-raw-async-clibpqb-profiled": {
+			"json_url": "/te-benchmark-um-pq-async/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-pq-async/db",
+			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
+			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
+			"update_url": "/te-benchmark-um-pq-async/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-pq-async/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "postgres",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-postgresql-raw-async-clibpqb-profiled",
+			"notes": "async memory libpq batch patch profiled",
+			"versus": "",
+			"tags": []
+		},
+		"nginx": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Full",
+			"platform": "None",
+			"webserver": "nginx",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-nginx",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"seastar": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "seastar-http",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-seastar",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"apache": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Full",
+			"platform": "None",
+			"webserver": "apache",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-apache",
+			"notes": "apache mongo",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"mongo-raw": {
+			"json_url": "/te-benchmark-um-mgr/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um-mgr/db",
+			"query_url": "/te-benchmark-um-mgr/queries?queries=",
+			"fortune_url": "/te-benchmark-um-mgr/fortunes",
+			"update_url": "/te-benchmark-um-mgr/updates?queries=",
+			"cached_query_url": "/te-benchmark-um-mgr/cached-worlds?count=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "mongodb",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Raw",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-mongo-raw",
+			"notes": "mongodb raw memory",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"lithium": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "lithium",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-lithium",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"cinatra": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "cinatra",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-cinatra",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"drogon": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "drogon",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-drogon",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"h2o": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "h2o",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-h2o",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"crystal-h2o": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "h2o.cr",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-crystal-h2o",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"mysql": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"db_url": "/te-benchmark-um/db",
+			"query_url": "/te-benchmark-um/queries?queries=",
+			"fortune_url": "/te-benchmark-um/fortunes",
+			"update_url": "/te-benchmark-um/updates?queries=",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "mysql",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "Full",
+			"platform": "None",
+			"webserver": "ffead-cpp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-mysql",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"go-fasthttp": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "fasthttp",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-go-fasthttp",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"julia-http": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "julia-http",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-julia-http",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"swift-nio": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "swift-nio",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-swift-nio",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"rust-hyper": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "hyper",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-rust-hyper",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"rust-thruster": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "thruster",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-rust-thruster",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"rust-rocket": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "rocket",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-rust-rocket",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"v-vweb": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "vweb",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-v-vweb",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"java-rapidoid": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "rapidoid",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-java-rapidoid",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		},
+		"java-wizzardo-http": {
+			"json_url": "/te-benchmark-um/json",
+			"plaintext_url": "/plaintext",
+			"port": 8080,
+			"approach": "Realistic",
+			"classification": "Fullstack",
+			"database": "None",
+			"framework": "ffead-cpp",
+			"language": "C++",
+			"orm": "None",
+			"platform": "None",
+			"webserver": "wizzardo-http",
+			"os": "Linux",
+			"database_os": "Linux",
+			"display_name": "ffead-cpp-java-wizzardo-http",
+			"notes": "",
+			"versus": "",
+			"tags": ["broken"]
+		}
+	}]
+}

+ 1 - 10
frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile

@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM sumeetchhetri/ffead-cpp-deps:6.0
 LABEL maintainer="Sumeet Chhetri"
 LABEL version="6.0-debug"
 LABEL description="Base ffead-cpp docker image with commit id - master"
@@ -9,7 +9,6 @@ ENV DEBUG=on
 ENV DEBIAN_FRONTEND noninteractive
 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
 
-RUN mkdir /installs
 COPY te-benchmark-um/ /installs/te-benchmark-um/
 COPY te-benchmark-um-pq/ /installs/te-benchmark-um-pq/
 COPY te-benchmark-um-mgr/ /installs/te-benchmark-um-mgr/
@@ -17,14 +16,6 @@ COPY te-benchmark-um-mgr/ /installs/te-benchmark-um-pq-async/
 
 WORKDIR ${IROOT}
 
-COPY install_ffead-cpp-dependencies.sh ${IROOT}/
-RUN chmod 755 ${IROOT}/install_ffead-cpp-dependencies.sh
-RUN ./install_ffead-cpp-dependencies.sh
-
-COPY install_ffead-cpp-backends.sh ${IROOT}/
-RUN chmod 755 ${IROOT}/install_ffead-cpp-backends.sh
-RUN ./install_ffead-cpp-backends.sh
-
 COPY install_ffead-cpp-framework.sh install_ffead-cpp-httpd.sh install_ffead-cpp-nginx.sh server.sh ${IROOT}/
 RUN chmod 755 ${IROOT}/*.sh
 RUN ./install_ffead-cpp-framework.sh && ./install_ffead-cpp-httpd.sh && ./install_ffead-cpp-nginx.sh && cd ${IROOT}/ffead-cpp-src && make clean && rm -rf CMakeFiles

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile

@@ -3,7 +3,6 @@ FROM sumeetchhetri/ffead-cpp-base:6.0
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 2 - 4
frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile

@@ -3,17 +3,15 @@ FROM sumeetchhetri/ffead-cpp-base:6.0
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \
 	ldconfig
 
-RUN apt-get update -y && apt install -y --no-install-recommends gnupg && curl -sL "https://keybase.io/crystal/pgp_keys.asc" | apt-key add - \
-	&& echo "deb https://dist.crystal-lang.org/apt crystal main" | tee /etc/apt/sources.list.d/crystal.list \
-	&& apt-get update -y && apt install -y --no-install-recommends crystal && rm -rf /var/lib/apt/lists/*
+RUN curl -fsSL https://crystal-lang.org/install.sh | bash && rm -rf /var/lib/apt/lists/*
 WORKDIR ${IROOT}/lang-server-backends/crystal/crystal
+#COPY crystal-ffead-cpp.cr ${IROOT}/lang-server-backends/crystal/crystal/
 RUN crystal build --release --no-debug crystal-ffead-cpp.cr -o crystal-ffead-cpp.out && cp crystal-ffead-cpp.out $IROOT/ && rm -rf ${IROOT}/lang-server-backends
 
 WORKDIR /

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile

@@ -4,7 +4,6 @@ ENV IROOT=/installs
 
 ENV DEBIAN_FRONTEND noninteractive
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile

@@ -3,7 +3,6 @@ FROM sumeetchhetri/ffead-cpp-base:6.0
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile

@@ -3,7 +3,6 @@ FROM sumeetchhetri/ffead-cpp-base:6.0
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile

@@ -4,7 +4,6 @@ ENV IROOT=/installs
 
 ENV DEBIAN_FRONTEND noninteractive
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile

@@ -6,7 +6,6 @@ LABEL description="Base java docker image with master code"
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile

@@ -4,7 +4,6 @@ ENV IROOT=/installs
 
 ENV DEBIAN_FRONTEND noninteractive
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile

@@ -3,7 +3,6 @@ FROM sumeetchhetri/ffead-cpp-base:6.0
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=10" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=3" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUN echo "dbpoolsize=4" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 7 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile

@@ -0,0 +1,7 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 10 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile

@@ -0,0 +1,10 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-clibpqb-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+RUN sed -i 's|router="TeBkUmLpqAsyncRouter"|router="TeBkUmLpqAsyncRouter" properties="app.prop"|g' ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/application.xml
+RUNN echo "dbpoolsize=2" > ${IROOT}/ffead-cpp-6.0-sql/web/te-benchmark-um-pq-async/config/app.prop
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 7 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile

@@ -0,0 +1,7 @@
+FROM sumeetchhetri/ffead-cpp-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 7 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile

@@ -0,0 +1,7 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 7 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile

@@ -0,0 +1,7 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-pool-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 7 - 0
frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile

@@ -0,0 +1,7 @@
+FROM sumeetchhetri/ffead-cpp-sql-raw-async-profiled-base:6.0
+
+ENV IROOT=/installs
+
+WORKDIR /
+
+CMD ./run_ffead.sh ffead-cpp-6.0-sql emb postgresql-raw-async memory

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile

@@ -6,7 +6,6 @@ LABEL description="Base rust docker image with ffead-cpp v4.0 - commit id - mast
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile

@@ -6,7 +6,6 @@ LABEL description="Base rust rocket docker image with ffead-cpp v6.0 - commit id
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 93 - 0
frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile

@@ -0,0 +1,93 @@
+FROM sumeetchhetri/ffead-cpp-base:6.0
+LABEL maintainer="Sumeet Chhetri"
+LABEL version="6.0"
+LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master"
+
+WORKDIR /tmp
+RUN mkdir postgresql
+
+COPY postgresql/* /tmp/postgresql/
+
+#POSTGRESQL
+WORKDIR /tmp/postgresql/
+
+# prepare PostgreSQL APT repository
+RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release
+
+RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
+RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee  /etc/apt/sources.list.d/pgdg.list
+
+ENV PG_VERSION 13
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
+ENV DEBIAN_FRONTEND noninteractive
+
+# install postgresql on database machine
+RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 &&  rm -rf /var/lib/apt/lists/*
+
+# Make sure all the configuration files in main belong to postgres
+RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf
+RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
+
+RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main
+
+RUN mkdir /ssd
+RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
+RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql
+RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
+
+RUN chown -Rf postgres:postgres /var/run/postgresql
+RUN chmod 2777 /var/run/postgresql
+RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf
+RUN chown postgres:postgres create-postgres*
+RUN chown -Rf postgres:postgres /ssd
+
+ENV PGDATA=/ssd/postgresql
+
+USER postgres
+
+# We have to wait for postgres to start before we can use the cli
+RUN service postgresql start && \
+    until psql -c "\q"; do sleep 1; done && \
+    psql < create-postgres-database.sql && \
+    psql -a hello_world < create-postgres.sql && \
+    service postgresql stop
+#POSTGRESQL
+
+USER root
+
+#WRK
+WORKDIR /tmp/wrk
+RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \
+	curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1
+ENV LDFLAGS="-O3 -march=native -flto"
+ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS"
+RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)"
+RUN cp wrk /usr/local/bin
+
+ENV name name
+ENV server_host server_host
+ENV levels levels
+ENV duration duration
+ENV max_concurrency max_concurrency
+ENV max_threads max_threads
+ENV pipeline pipeline
+ENV accept accept
+#WRK
+
+WORKDIR ${IROOT}
+
+COPY sql-profiled-util.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-util.sh
+RUN ./sql-profiled-util.sh batch clang async pool
+
+#COPY TeBkUmLpqAsync.cpp ${IROOT}/ffead-cpp-src/web/te-benchmark-um-pq-async/src/
+#COPY TeBkUmLpqAsync.h ${IROOT}/ffead-cpp-src/web/te-benchmark-um-pq-async/include/
+#COPY LibpqDataSourceImpl.cpp ${IROOT}/ffead-cpp-src/src/modules/sdorm/sql/libpq/
+#COPY LibpqDataSourceImpl.h ${IROOT}/ffead-cpp-src/src/modules/sdorm/sql/libpq/
+
+COPY sql-async-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-async-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
+RUN ./sql-async-profiled-install-clang.sh batch

+ 88 - 0
frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile

@@ -0,0 +1,88 @@
+FROM sumeetchhetri/ffead-cpp-base:6.0
+LABEL maintainer="Sumeet Chhetri"
+LABEL version="6.0"
+LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master"
+
+WORKDIR /tmp
+RUN mkdir postgresql
+
+COPY postgresql/* /tmp/postgresql/
+
+#POSTGRESQL
+WORKDIR /tmp/postgresql/
+
+# prepare PostgreSQL APT repository
+RUN apt-get -yqq update && apt-get -yqq install locales gnupg lsb-release
+
+RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
+RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee  /etc/apt/sources.list.d/pgdg.list
+
+ENV PG_VERSION 13
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_ALL en_US.UTF-8
+ENV DEBIAN_FRONTEND noninteractive
+
+# install postgresql on database machine
+RUN apt-get -yqq update && apt-get -yqq install postgresql-13 postgresql-contrib-13 &&  rm -rf /var/lib/apt/lists/*
+
+# Make sure all the configuration files in main belong to postgres
+RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf
+RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
+
+RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main
+
+RUN mkdir /ssd
+RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
+RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql
+RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
+
+RUN chown -Rf postgres:postgres /var/run/postgresql
+RUN chmod 2777 /var/run/postgresql
+RUN chown postgres:postgres /etc/sysctl.d/60-postgresql-shm.conf
+RUN chown postgres:postgres create-postgres*
+RUN chown -Rf postgres:postgres /ssd
+
+ENV PGDATA=/ssd/postgresql
+
+USER postgres
+
+# We have to wait for postgres to start before we can use the cli
+RUN service postgresql start && \
+    until psql -c "\q"; do sleep 1; done && \
+    psql < create-postgres-database.sql && \
+    psql -a hello_world < create-postgres.sql && \
+    service postgresql stop
+#POSTGRESQL
+
+USER root
+
+#WRK
+WORKDIR /tmp/wrk
+RUN apt-get -yqq update && apt-get -yqq install libluajit-5.1-dev libssl-dev luajit && rm -rf /var/lib/apt/lists/* && \
+	curl -sL https://github.com/wg/wrk/archive/4.1.0.tar.gz | tar xz --strip-components=1
+ENV LDFLAGS="-O3 -march=native -flto"
+ENV CFLAGS="-I /usr/include/luajit-2.1 $LDFLAGS"
+RUN make WITH_LUAJIT=/usr WITH_OPENSSL=/usr -j "$(nproc)"
+RUN cp wrk /usr/local/bin
+
+ENV name name
+ENV server_host server_host
+ENV levels levels
+ENV duration duration
+ENV max_concurrency max_concurrency
+ENV max_threads max_threads
+ENV pipeline pipeline
+ENV accept accept
+#WRK
+
+WORKDIR ${IROOT}
+
+COPY sql-profiled-util.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-util.sh
+RUN ./sql-profiled-util.sh nobatch noclang async pool
+
+COPY sql-async-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-async-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
+RUN ./sql-async-profiled-install.sh

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile

@@ -85,4 +85,4 @@ RUN ./sql-profiled-util.sh batch clang noasync
 
 COPY sql-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
 RUN chmod 755 ${IROOT}/sql-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
-RUN ./sql-profiled-install-clang.sh batch
+RUN ./sql-profiled-install-clang.sh

+ 0 - 1
frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile

@@ -4,7 +4,6 @@ ENV IROOT=/installs
 
 ENV DEBIAN_FRONTEND noninteractive
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 1 - 1
frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile

@@ -6,7 +6,7 @@ LABEL description="Base v docker image with ffead-cpp v4.0 commit id - master"
 ENV IROOT=/installs
 
 RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
+	ln -s ${IROOT}/ffead-cpp-6.0/lib/libte-benchmark-um-pq.so /usr/local/lib/libte-benchmark-um-pq.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libinter.so /usr/local/lib/libinter.so && \

+ 25 - 17
frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile

@@ -1,22 +1,7 @@
-FROM sumeetchhetri/ffead-cpp-sql-raw-clibpqb-profiled-base:6.0
+FROM sumeetchhetri/ffead-cpp-base:6.0
 LABEL maintainer="Sumeet Chhetri"
 LABEL version="6.0"
-LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp-v-picov-profiled docker image with commit id - master"
-
-RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libinter.so /usr/local/lib/libinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libdinter.so /usr/local/lib/libdinter.so && \
-	ldconfig
-
-RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/*
-#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlnag has slowed down tremendously
-#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink
-
-#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic
-RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip
+LABEL description="SQL Raw Custom libpq batch patched Base ffead-cpp docker image with commit id - master"
 
 WORKDIR /tmp
 RUN mkdir postgresql
@@ -48,6 +33,7 @@ RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
 
 RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main
 
+RUN mkdir /ssd
 RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
 RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql
 RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
@@ -93,6 +79,28 @@ ENV accept accept
 
 WORKDIR ${IROOT}
 
+RUN sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq/config/application.xml
+
+COPY sql-profiled-util.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-util.sh
+RUN ./sql-profiled-util.sh batch clang noasync
+
+COPY sql-profiled-install-clang.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-install-clang.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
+RUN ./sql-profiled-install-clang.sh nocleanup
+
+RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/*
+#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously
+#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink
+
+#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic
+RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip
+
+RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
+	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
+	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
+	ldconfig
+
 COPY sql-v-picov-profiled-install.sh install_ffead-cpp-sql-raw-v-picov-profiled.sh ${IROOT}/
 RUN chmod 755 ${IROOT}/sql-v-picov-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-v-picov-profiled.sh
 RUN ./sql-v-picov-profiled-install.sh

+ 25 - 17
frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile

@@ -1,22 +1,7 @@
-FROM sumeetchhetri/ffead-cpp-sql-raw-profiled-base:6.0
+FROM sumeetchhetri/ffead-cpp-base:6.0
 LABEL maintainer="Sumeet Chhetri"
 LABEL version="6.0"
-LABEL description="SQL Raw Base ffead-cpp-v-picov-profiled docker image with commit id - master"
-
-RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libte-benchmark-um.so /usr/local/lib/libte-benchmark-um.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libinter.so /usr/local/lib/libinter.so && \
-	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libdinter.so /usr/local/lib/libdinter.so && \
-	ldconfig
-
-RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/*
-#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlnag has slowed down tremendously
-#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink
-
-#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic
-RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip
+LABEL description="SQL Raw Base ffead-cpp docker image with commit id - master"
 
 WORKDIR /tmp
 RUN mkdir postgresql
@@ -48,6 +33,7 @@ RUN mv pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
 
 RUN chown -Rf postgres:postgres /etc/postgresql/${PG_VERSION}/main
 
+RUN mkdir /ssd
 RUN cp -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
 RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /ssd/postgresql
 RUN mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
@@ -93,6 +79,28 @@ ENV accept accept
 
 WORKDIR ${IROOT}
 
+RUN sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq/config/application.xml
+
+COPY sql-profiled-util.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-util.sh
+RUN ./sql-profiled-util.sh nobatch noclang noasync
+
+COPY sql-profiled-install.sh install_ffead-cpp-sql-raw-profiled.sh ${IROOT}/
+RUN chmod 755 ${IROOT}/sql-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-profiled.sh
+RUN ./sql-profiled-install.sh nocleanup
+
+RUN apt update -yqq && apt install -y git make && rm -rf /var/lib/apt/lists/*
+#For Latest vlang, uncomment the below mentioned line, due to lot of new enhancements and unsafe block handling, vlang has slowed down tremendously
+#RUN git clone https://github.com/vlang/v && cd v && make && ./v symlink
+
+#For the fastest vlang performance, use 0.1.29, where the unsafe changes were only restricted to pointer arithmetic
+RUN wget -q https://github.com/vlang/v/releases/download/0.1.29/v_linux.zip && unzip -q v_linux.zip && cd v && chmod +x v && ./v symlink && cd .. && rm -f v_linux.zip
+
+RUN rm -f /usr/local/lib/libffead-* /usr/local/lib/libte_benc* /usr/local/lib/libinter.so /usr/local/lib/libdinter.so && \
+	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-modules.so /usr/local/lib/libffead-modules.so && \
+	ln -s ${IROOT}/ffead-cpp-6.0-sql/lib/libffead-framework.so /usr/local/lib/libffead-framework.so && \
+	ldconfig
+
 COPY sql-v-picov-profiled-install.sh install_ffead-cpp-sql-raw-v-picov-profiled.sh ${IROOT}/
 RUN chmod 755 ${IROOT}/sql-v-picov-profiled-install.sh ${IROOT}/install_ffead-cpp-sql-raw-v-picov-profiled.sh
 RUN ./sql-v-picov-profiled-install.sh

+ 8 - 8
frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh

@@ -1,19 +1,19 @@
 apt install -y clang-format-9 ninja-build
 
-wget -q https://github.com/microsoft/mimalloc/archive/v1.6.3.tar.gz
-tar xf mimalloc-1.6.7.tar.gz
-cd mimalloc-1.6.7
+wget -q https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz
+tar xf mimalloc-2.0.2.tar.gz
+cd mimalloc-2.0.2
 mkdir -p out/release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 make && make install
 cd $IROOT
-rm -rf mimalloc-1.6.7
+rm -rf mimalloc-2.0.2
 
-wget -q https://github.com/microsoft/snmalloc/archive/0.5.1.tar.gz
-tar xf snmalloc-0.5.1.tar.gz
-cd snmalloc-0.5.1
+wget -q https://github.com/microsoft/snmalloc/archive/0.5.3.tar.gz
+tar xf snmalloc-0.5.3.tar.gz
+cd snmalloc-0.5.3
 mkdir build
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
 ninja
 cd $IROOT
-rm -rf snmalloc-0.5.1
+rm -rf snmalloc-0.5.3

+ 1 - 1
frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh

@@ -87,7 +87,7 @@ then
 	git clone https://github.com/chronoxor/CppServer
 	cd CppServer
 	gil update
-	cd $IROOT/CppServer/modules/CppCommon/modules/fmt && git checkout b9ab5c8836bbffbe0a877f64d6faef8fbf4fd394 -b works
+	#cd $IROOT/CppServer/modules/CppCommon/modules/fmt && git checkout b9ab5c8836bbffbe0a877f64d6faef8fbf4fd394 -b works
 	cd $IROOT/CppServer/build
 	./unix.sh
 	cp $IROOT/CppServer/bin/libcppserver.a /usr/local/lib/

+ 13 - 11
frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh

@@ -2,10 +2,12 @@
 
 apt update -yqq && apt install --no-install-recommends -yqq autoconf-archive unzip uuid-dev odbc-postgresql unixodbc unixodbc-dev \
 	apache2 apache2-dev libapr1-dev libaprutil1-dev memcached libmemcached-dev redis-server libssl-dev \
-	zlib1g-dev cmake make clang-format-9 ninja-build libcurl4-openssl-dev libpq-dev git \
-	wget build-essential pkg-config libpcre3-dev curl libgtk2.0-dev libgdk-pixbuf2.0-dev
+	zlib1g-dev cmake make clang-format-9 ninja-build libcurl4-openssl-dev git libpq-dev \
+	wget build-essential pkg-config libpcre3-dev curl libgtk2.0-dev libgdk-pixbuf2.0-dev bison flex libreadline-dev
 apt-get install --reinstall ca-certificates
 
+cd $IROOT
+
 mkdir /usr/local/share/ca-certificates/cacert.org
 wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
 update-ca-certificates
@@ -55,21 +57,21 @@ cd $IROOT
 rm -rf hiredis-1.0.0
 
 cd $IROOT
-wget -q https://github.com/microsoft/mimalloc/archive/v1.6.3.tar.gz
-tar xf v1.6.3.tar.gz
-rm -f v1.6.3.tar.gz
-cd mimalloc-1.6.3
+wget -q https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz
+tar xf v2.0.2.tar.gz
+rm -f v2.0.2.tar.gz
+cd mimalloc-2.0.2
 mkdir -p out/release
 cd out/release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 make && make install
 cd $IROOT
-rm -rf mimalloc-1.6.3
+rm -rf mimalloc-2.0.2
 
-wget -q https://github.com/microsoft/snmalloc/archive/0.4.2.tar.gz
-tar xf 0.4.2.tar.gz
-rm -f 0.4.2.tar.gz
-cd snmalloc-0.4.2
+wget -q https://github.com/microsoft/snmalloc/archive/0.5.3.tar.gz
+tar xf 0.5.3.tar.gz
+rm -f 0.5.3.tar.gz
+cd snmalloc-0.5.3
 mkdir build
 cd build
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release

+ 1 - 1
frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh

@@ -6,9 +6,9 @@ MAX_THREADS=$(( 3 * `nproc` / 2 ))
 WRIT_THREADS=$(( $MAX_THREADS / 3 ))
 SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
 
-#git checkout e243bc096cd570cfee1edfecbcd91f4c4056fa1a -b 6.0
 git clone https://github.com/sumeetchhetri/ffead-cpp
 cd ffead-cpp
+git checkout 1d892ae2c6155aa2d36c5f125ebd36433d9eb5aa -b 6.0
 rm -rf .git
 cd ..
 mv ffead-cpp ffead-cpp-src

+ 11 - 1
frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh

@@ -56,16 +56,26 @@ sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' resources/server.prop
 nohup bash -c "./server.sh > ffead.log &"
 sleep 10
 echo "ffead-cpp with sql-raw support launched"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/plaintext"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/json"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 256 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/fortunes"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/db"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/queries?queries=20"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/queriem?queries=20"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/querie_?queries=20"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/updates?queries=20"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
-	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/bupdates?queries=20"
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/updatem?queries=20"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq${SUFFIX}/update_?queries=20"
 echo "normal shutdown"
 rm -f serv.ctrl
 pkill ffead-cpp

+ 5 - 0
frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh

@@ -6,6 +6,7 @@ export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/l
 cd $IROOT/lang-server-backends/v/pico.v
 
 cp -f ${FFEAD_CPP_PATH}/web/te-benchmark-um-pq/config/cachememory.xml ${FFEAD_CPP_PATH}/web/te-benchmark-um-pq/config/cache.xml
+sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/te-benchmark-um-pq/config/application.xml
 sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' ${FFEAD_CPP_PATH}/resources/server.prop
 #sed -i 's|LOGGING_ENABLED=false|LOGGING_ENABLED=true|g' ${FFEAD_CPP_PATH}/resources/server.prop
 nohup bash -c "./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 > ffead.log &"
@@ -21,8 +22,12 @@ wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,applicatio
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/db"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/queries?queries=20"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/querie_?queries=20"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/updates?queries=20"
+wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
+	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/update_?queries=20"
 wrk -H 'Host: localhost' -H 'Accept: application/json,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' \
 	-H 'Connection: keep-alive' --latency -d 5 -c 512 --timeout 8 -t 2 "http://localhost:8080/te-benchmark-um-pq/cached-worlds?count=20"
 echo "normal shutdown"

+ 2 - 1
frameworks/C++/ffead-cpp/run_ffead.sh

@@ -31,7 +31,7 @@ export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/l
 export ODBCINI=${IROOT}/odbc.ini
 export ODBCSYSINI=${IROOT}
 export LD_PRELOAD=/usr/local/lib/libmimalloc.so
-#export LD_PRELOAD=$IROOT/snmalloc-0.4.2/build/libsnmallocshim.so
+#export LD_PRELOAD=$IROOT/snmalloc-0.5.3/build/libsnmallocshim.so
 
 cd $FFEAD_CPP_PATH
 
@@ -203,6 +203,7 @@ then
 elif [ "$2" = "v-picov" ]
 then
 	cd ${IROOT}
+	sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${WEB_DIR}/config/application.xml
 	sed -i 's|EVH_SINGLE=false|EVH_SINGLE=true|g' $FFEAD_CPP_PATH/resources/server.prop
 	for i in $(seq 0 $(($(nproc --all)-1))); do
 		taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 &

+ 8 - 6
frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh

@@ -38,9 +38,11 @@ mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql
 
 sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/te-benchmark-um-pq/config/sdorm.xml
 
-apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release
-apt autoremove -yqq
-rm -rf /ssd/postgresql
-rm -rf /tmp/postgresql
-rm -rf /tmp/wrk /usr/local/bin/wrk
-
+if [ "$#" = 0 ]
+then
+	apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release
+	apt autoremove -yqq
+	rm -rf /ssd/postgresql
+	rm -rf /tmp/postgresql
+	rm -rf /tmp/wrk /usr/local/bin/wrk
+fi

+ 8 - 6
frameworks/C++/ffead-cpp/sql-profiled-install.sh

@@ -33,9 +33,11 @@ mv $IROOT/ffead-cpp-sql-raw $IROOT/ffead-cpp-6.0-sql
 
 sed -i 's|localhost|tfb-database|g' $IROOT/ffead-cpp-6.0-sql/web/te-benchmark-um-pq/config/sdorm.xml
 
-apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release
-apt autoremove -yqq
-rm -rf /ssd/postgresql
-rm -rf /tmp/postgresql
-rm -rf /tmp/wrk /usr/local/bin/wrk
-
+if [ "$#" = 0 ]
+then
+	apt remove -yqq postgresql-13 postgresql-contrib-13 gnupg lsb-release
+	apt autoremove -yqq
+	rm -rf /ssd/postgresql
+	rm -rf /tmp/postgresql
+	rm -rf /tmp/wrk /usr/local/bin/wrk
+fi

+ 26 - 3
frameworks/C++/ffead-cpp/sql-profiled-util.sh

@@ -2,12 +2,13 @@ mkdir /tmp/profile-data
 
 rm -rf $IROOT/ffead-cpp-6.0-sql
 
-if [ "$1" = "batch" ]
+if [ "$1" = "batch-old" ]
 then
 	apt remove -yqq libpq-dev
 	apt autoremove -yqq
+	rm -f /usr/local/lib/libpq.*
+	rm -f /usr/include/postgres_ext.h /usr/include/pg_config_ext.h /usr/include/libpq-fe.h
 	rm -f /usr/lib/x86_64-linux-gnu/libpq.*
-	apt update && apt install -y bison flex libreadline-dev
 	cd /tmp
 	#wget -q https://github.com/an-tao/postgres/archive/batch_mode_ubuntu.tar.gz
 	#tar -xzf batch_mode_ubuntu.tar.gz
@@ -25,6 +26,23 @@ then
 	cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h libpq-fe.h /usr/include
 fi
 
+if [ "$1" = "batch" ]
+then
+	apt remove -yqq libpq-dev
+	apt autoremove -yqq
+	rm -f /usr/local/lib/libpq.*
+	rm -f /usr/include/postgres_ext.h /usr/include/pg_config_ext.h /usr/include/libpq-fe.h
+	rm -f /usr/lib/x86_64-linux-gnu/libpq.*
+	PG_CMT=514b4c11d24701d2cc90ad75ed787bf1380af673
+	wget -nv https://github.com/postgres/postgres/archive/$PG_CMT.zip
+	unzip -q $PG_CMT.zip
+	cd postgres-$PG_CMT
+	./configure --prefix=/usr CFLAGS='-O3 -march=native -flto'
+	cd src/interfaces/libpq
+	make all install -j4
+	cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h /usr/include
+fi
+
 if [ "$2" = "clang" ]
 then
 	apt update -yqq && apt install -yqq clang
@@ -46,9 +64,14 @@ then
 	sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um-pq/libte-benchmark-um-pq${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 	sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/sdorm.xml
 	rm -rf web/te-benchmark-um-pq
+	if [ "$4" = "pool" ]
+	then
+		sed -i 's|"TeBkUmLpqAsyncRouter"|"TeBkUmLpqAsyncRouterPooled"|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/application.xml
+		sed -i 's|TeBkUmLpqAsyncRouter|TeBkUmLpqAsyncRouterPooled|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq-async/config/cachememory.xml
+	fi
 else
 	sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um-pq-async)||g' CMakeLists.txt
 	sed -i 's|install(FILES ${PROJECT_BINARY_DIR}/web/te-benchmark-um-pq-async/libte-benchmark-um-pq-async${LIB_EXT} DESTINATION ${PROJECT_NAME}-bin/lib)||g' CMakeLists.txt
 	sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-src/web/te-benchmark-um-pq/config/sdorm.xml
 	rm -rf web/te-benchmark-um-pq-async
-fi
+fi

+ 2 - 1
frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh

@@ -1,7 +1,8 @@
 export FFEAD_CPP_PATH=${IROOT}/ffead-cpp-6.0-sql
 export LD_LIBRARY_PATH=${IROOT}/:${IROOT}/lib:${FFEAD_CPP_PATH}/lib:/usr/local/lib:$LD_LIBRARY_PATH
 
-sed -i 's|tfb-database|localhost|g' $IROOT/ffead-cpp-6.0-sql/web/te-benchmark-um-pq/config/sdorm.xml
+sed -i 's|tfb-database|localhost|g' ${FFEAD_CPP_PATH}/web/te-benchmark-um-pq/config/sdorm.xml
+sed -i 's|"TeBkUmLpqRouter"|"TeBkUmLpqRouterPicoV"|g' ${FFEAD_CPP_PATH}/web/te-benchmark-um-pq/config/application.xml
 
 cd $IROOT/lang-server-backends/v/pico.v
 v -prod -cflags '-std=gnu11 -Wall -O3 -march=native -mtune=native -no-pie -flto -fprofile-dir=/tmp/profile-data -fprofile-generate -lgcov --coverage' main.v

+ 2 - 0
frameworks/C++/ffead-cpp/te-benchmark-um-mgr/include/TeBkUmMgr.h

@@ -47,6 +47,8 @@ class TeBkUmMgrWorld {
 	int id;
 	int randomNumber;
 public:
+	TeBkUmMgrWorld(int id);
+	TeBkUmMgrWorld(int id, int randomNumber);
 	TeBkUmMgrWorld();
 	virtual ~TeBkUmMgrWorld();
 	int getId() const;

+ 21 - 16
frameworks/C++/ffead-cpp/te-benchmark-um-mgr/src/TeBkUmMgr.cpp

@@ -37,6 +37,16 @@ void TeBkUmMgrWorld::setRandomNumber(int randomNumber) {
 	this->randomNumber = randomNumber;
 }
 
+TeBkUmMgrWorld::TeBkUmMgrWorld(int id) {
+	this->id = id;
+	randomNumber = 0;
+}
+
+TeBkUmMgrWorld::TeBkUmMgrWorld(int id, int randomNumber) {
+	this->id = id;
+	this->randomNumber = randomNumber;
+}
+
 TeBkUmMgrWorld::TeBkUmMgrWorld() {
 	id = 0;
 	randomNumber = 0;
@@ -211,7 +221,7 @@ void TeBkUmMgrRouter::updateCache() {
 			TeBkUmMgrWorld& w = wlist.at(c);
 			char str[12];
 			sprintf(str, "%d;%d", w.getId(), w.getRandomNumber());
-			cchi->setRaw(CastUtil::fromNumber(w.getId()), str);
+			cchi->setRaw(w.getId(), str);
 		}
 		CacheManager::cleanImpl(cchi);
 		CacheManager::triggerAppInitCompletion();
@@ -251,26 +261,21 @@ void TeBkUmMgrRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmMgrW
 
 	CacheInterface* cchi = CacheManager::getImpl();
 	try {
-		std::vector<std::string> keys;
+		std::vector<unsigned long long> keys;
 		for (int c = 0; c < queryCount; ++c) {
 			int rid = rand() % 10000 + 1;
-			keys.push_back(CastUtil::fromNumber(rid));
+			keys.emplace_back(rid);
 		}
-
 		std::vector<std::string> values;
-		cchi->mgetRaw(keys, values);
-
-		for (int c = 0; c < (int)values.size(); ++c) {
-			TeBkUmMgrWorld w;
+		cchi->getValues(keys, values);
+		for (int c = 0; c < queryCount; ++c) {
 			std::string& v = values.at(c);
 			size_t fn = v.find(";");
 			int tmp = 0;
-			strToNum(v.substr(0, fn).c_str(), fn, tmp);
-			w.setId(tmp);
-			tmp = 0;
-			strToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp);
-			w.setRandomNumber(tmp);
-			wlst.push_back(w);
+			CommonUtils::fastStrToNum(v.substr(0, fn).c_str(), fn, tmp);
+			int tmp1 = 0;
+			CommonUtils::fastStrToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1);
+			wlst.emplace_back(tmp, tmp1);
 		}
 		CacheManager::cleanImpl(cchi);
 	} catch(const std::exception& e) {
@@ -295,7 +300,7 @@ void TeBkUmMgrRouter::getContext(HttpRequest* request, Context* context) {
 		flst->push_back(nf);
 		std::sort (flst->begin(), flst->end());
 
-		context->insert(std::pair<std::string, void*>("fortunes", flst));
+		context->emplace("fortunes", flst);
 	} catch(...) {
 		throw;
 	}
@@ -368,7 +373,7 @@ bool TeBkUmMgrRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface
 			fcpstream str;
 			tmplFunc(&ctx, str);
 			res->setContent(str.str());
-			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		}
 	} else if(StringUtil::endsWith(path, "/updates")) {

+ 68 - 41
frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/include/TeBkUmLpqAsync.h

@@ -42,6 +42,8 @@
 #include "string"
 #include "yuarel.h"
 #include "Router.h"
+#include <unordered_map>
+#include "ConfigurationData.h"
 
 class TeBkUmLpqAsyncWorld {
 	int id;
@@ -82,29 +84,47 @@ public:
 	void setMessage(const std::string& message);
 };
 
-struct AsyncReq {
+struct AsyncDbReq {
 	float httpVers;
 	bool conn_clos;
 	SocketInterface* sif;
-	LibpqDataSourceImpl* sqli;
-
 	TeBkUmLpqAsyncWorld w;
+};
+
+struct AsyncQueriesReq {
+	float httpVers;
+	bool conn_clos;
+	SocketInterface* sif;
+	std::vector<TeBkUmLpqAsyncWorld> vec;
+};
+
+struct AsyncUpdatesReq {
+	float httpVers;
+	bool conn_clos;
+	SocketInterface* sif;
+	LibpqDataSourceImpl* sqli;
 	std::vector<TeBkUmLpqAsyncWorld> vec;
+};
+
+struct AsyncFortuneReq {
+	float httpVers;
+	bool conn_clos;
+	SocketInterface* sif;
 	std::list<TeBkUmLpqAsyncFortune> flst;
 };
 
-struct CacheReq {
+struct AsyncCacheReq {
 	CacheInterface* cchi;
-
 	std::vector<TeBkUmLpqAsyncWorld> vec;
 };
 
 class TeBkUmLpqAsyncRouter : public Router {
 	static const std::string HELLO_WORLD;
-	static std::string WORLD;
-	static std::string WORLD_ONE_QUERY;
-	static std::string WORLD_ALL_QUERY;
-	static std::string FORTUNE_ALL_QUERY;
+	static const std::string WORLD;
+	static const std::string WORLD_ONE_QUERY;
+	static const std::string WORLD_ALL_QUERY;
+	static const std::string FORTUNE_ALL_QUERY;
+	static int g_seed;
 
 	static TemplatePtr tmplFunc;
 
@@ -112,43 +132,22 @@ class TeBkUmLpqAsyncRouter : public Router {
 	static Ser w_ser;
 	static SerCont wcont_ser;
 
-	static bool strToNum(const char* str, int len, int& ret);
-
-	void dbAsync(AsyncReq* req);
-	static void dbAsyncUtil(void* ctx, int rn, int cn, char * d);
-	static void dbAsyncCh(void* ctx, bool status, const std::string& q, int counter);
-
-	void queriesAsync(const char* q, int ql, AsyncReq* req);
-	static void queriesAsyncUtil(void* ctx, int rn, int cn, char * d);
-	static void queriesAsyncCh(void* ctx, bool status, const std::string& q, int counter);
-
-#ifndef HAVE_LIBPQ_BATCH
-	void queriesMultiAsync(const char*, int, AsyncReq*);
-	static void queriesMultiAsyncUtil(void* ctx, int, int, char *, int);
-	static void queriesMultiAsyncCh(void* ctx, bool status, const std::string& q, int counter);
-#endif
-
-	void updatesAsync(const char* q, int ql, AsyncReq* req);
-	static void updatesAsyncChQ(void* ctx, bool status, const std::string& q, int counter);
-	static void updatesAsyncChU(void* ctx, bool status, const std::string& q, int counter);
-
 	static std::string& getUpdQuery(int count);
-	void updatesAsyncb(const char* q, int ql, AsyncReq* req);
-	static void updatesAsyncbChQ(void* ctx, bool status, const std::string& q, int counter);
-	static void updatesAsyncbChU(void* ctx, bool status, const std::string& q, int counter);
-	
+
+	void dbAsync(SocketInterface* sif);
+	void queriesAsync(const char* q, int ql, SocketInterface* sif);
+	void updatesAsync(const char* q, int ql, AsyncUpdatesReq* req);
+	void updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* req);
 	void cachedWorlds(const char*, int, std::vector<TeBkUmLpqAsyncWorld>&);
-	static void updateCacheAsyncUtil(void* ctx, int rn, std::vector<LibpqRes>& data);
-	static void updateCacheAsyncCh(void* ctx, bool status, const std::string& q, int counter);
+	void fortunes(SocketInterface* sif);
 
-	void getContextAsync(AsyncReq* req);
-	static void getContextAsyncUtil(void* ctx, int rn, int cn, char * d, int l);
-	static void getContextAsyncCh(void* ctx, bool status, const std::string& q, int counter);
+	void queriesMultiAsync(const char*, int, SocketInterface* sif);
+	void updatesMulti(const char*, int, AsyncUpdatesReq*);
 
-	static std::map<int, std::string> _qC;
+	static std::unordered_map<int, std::string> _qC;
 	LibpqDataSourceImpl* sqli;
-	LibpqDataSourceImpl* getDb();
-	//static Logger logger;
+protected:
+	virtual LibpqDataSourceImpl* getDb(int max = 0);
 public:
 	TeBkUmLpqAsyncRouter& operator=(const TeBkUmLpqAsyncRouter& a) {
 		return *this;
@@ -159,7 +158,35 @@ public:
 	TeBkUmLpqAsyncRouter();
 	virtual ~TeBkUmLpqAsyncRouter();
 	void updateCache();
+	/* These functions are here just for test purposes and serve no purpose START */
+	static void temp() {
+	}
+	virtual void temp1() const {
+	}
+	std::map<std::string, std::string> l(std::map<std::string, std::string> a1, std::map<std::string, std::string> a2) {
+		return std::map<std::string, std::string>();
+	}
+	/* END */
 	bool route(HttpRequest* req, HttpResponse* res, SocketInterface* sif);
 };
 
+class TeBkUmLpqAsyncRouterPooled : public TeBkUmLpqAsyncRouter {
+	LibpqDataSourceImpl* getDb(int max = 0);
+	std::atomic<int> opt;
+	bool inited;
+	int maxconns;
+	std::vector<LibpqDataSourceImpl*> pool;
+public:
+	TeBkUmLpqAsyncRouterPooled& operator=(const TeBkUmLpqAsyncRouterPooled& a) {
+		return *this;
+	}
+	TeBkUmLpqAsyncRouterPooled(const TeBkUmLpqAsyncRouterPooled& a) {
+		this->opt = 0;
+		this->inited = false;
+		this->maxconns = 7;
+	}
+	TeBkUmLpqAsyncRouterPooled();
+	virtual ~TeBkUmLpqAsyncRouterPooled();
+};
+
 #endif /* WEB_TE_BENCHMARK_UM_INCLUDE_TeBkUmLpqAsync_H_ */

+ 459 - 411
frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/src/TeBkUmLpqAsync.cpp

@@ -19,6 +19,7 @@
  *  Created on: 03-Feb-2020
  *      Author: sumeetc
  */
+
 #include "TeBkUmLpqAsync.h"
 
 int TeBkUmLpqAsyncWorld::getId() const {
@@ -109,525 +110,528 @@ void TeBkUmLpqAsyncMessage::setMessage(const std::string& message) {
 }
 
 const std::string TeBkUmLpqAsyncRouter::HELLO_WORLD = "Hello, World!";
-std::string TeBkUmLpqAsyncRouter::WORLD = "world";
-std::string TeBkUmLpqAsyncRouter::WORLD_ONE_QUERY = "select id, randomnumber from world where id = $1";
-std::string TeBkUmLpqAsyncRouter::WORLD_ALL_QUERY = "select id, randomnumber from world";
-std::string TeBkUmLpqAsyncRouter::FORTUNE_ALL_QUERY = "select id, message from fortune";
-std::map<int, std::string> TeBkUmLpqAsyncRouter::_qC;
-
-void TeBkUmLpqAsyncRouter::dbAsync(AsyncReq* req) {
-	LibpqDataSourceImpl* sqli = getDb();
-	int rid = rand() % 10000 + 1;
-	try {
-		std::vector<LibpqParam> pars;
-		LibpqDataSourceImpl::ADD_INT4(pars, rid);
-		void* areq = sqli->executeQueryAsync(WORLD_ONE_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::dbAsyncUtil, &TeBkUmLpqAsyncRouter::dbAsyncCh, NULL);
-		sqli->completeAsync(areq);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::dbAsyncUtil(void* ctx, int rn, int cn, char * d) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	if(cn==0)req->w.setId(ntohl(*((uint32_t *) d)));
-	if(cn==1)req->w.setRandomNumber(ntohl(*((uint32_t *) d)));
-}
-void TeBkUmLpqAsyncRouter::dbAsyncCh(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	HttpResponse r;
-	r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	JSONSerialize::serializeObject(&req->w, w_ser, r.getContentP());
-	std::string d;
-	r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
-	req->sif->writeDirect(d);
-	req->sif->writeDirect(r.getContent());
-	req->sif->unUse();
-	delete req;
+const std::string TeBkUmLpqAsyncRouter::WORLD = "world";
+const std::string TeBkUmLpqAsyncRouter::WORLD_ONE_QUERY = "select id,randomnumber from world where id=$1";
+const std::string TeBkUmLpqAsyncRouter::WORLD_ALL_QUERY = "select id,randomnumber from world";
+const std::string TeBkUmLpqAsyncRouter::FORTUNE_ALL_QUERY = "select id,message from fortune";
+std::unordered_map<int, std::string> TeBkUmLpqAsyncRouter::_qC;
+int TeBkUmLpqAsyncRouter::g_seed = 0;
+
+void TeBkUmLpqAsyncRouter::dbAsync(SocketInterface* sif) {
+	LibpqDataSourceImpl* sqli = getDb(5);
+	int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+	LibpqAsyncReq* areq = sqli->getAsyncRequest();
+	LibpqQuery* q = areq->getQuery();
+	q->withParamInt4(rid);
+	q->withSelectQuery(WORLD_ONE_QUERY).withContext(sif).withCb0([](void* ctx, PGresult* res) {
+		SocketInterface* sif = (SocketInterface*)ctx;
+
+		TeBkUmLpqAsyncWorld w;
+		int cols = PQnfields(res);
+		for (int j = 0; j < cols; ++j) {
+			if(j==0)w.setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+			else w.setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+		}
+
+		HttpResponse r;
+		JSONSerialize::serializeObject(&w, w_ser, r.getContentP());
+		std::string h;
+		r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false);
+		sif->writeDirect(h, r.getContent());
+		sif->unUse();
+	});
+	sqli->postAsync(areq);
 }
 
+void TeBkUmLpqAsyncRouter::queriesAsync(const char* q, int ql, SocketInterface* sif) {
+	int queryCount = 0;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
+
+	LibpqDataSourceImpl* sqli = getDb(3);
+	LibpqAsyncReq* areq = sqli->getAsyncRequest();
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		LibpqQuery* q = areq->getQuery();
+		q->withParamInt4(rid);
+		q->withSelectQuery(WORLD_ONE_QUERY);
+	}
+	areq->withFinalCb(sif, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& q, int counter) {
+		SocketInterface* sif = (SocketInterface*)ctx;
+		std::vector<TeBkUmLpqAsyncWorld> vec;
+		vec.reserve((int)results->size());
+		for (int i = 0; i < (int)results->size(); ++i) {
+			PGresult* res = results->at(i);
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+				else vec.back().setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+			}
+		}
+
+		HttpResponse r;
+		JSONSerialize::serializeObjectCont(&vec, wcont_ser, "vector", r.getContentP());
+		std::string h;
+		r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false);
+		sif->writeDirect(h, r.getContent());
+		sif->unUse();
+	});
+	sqli->postAsync(areq);
+}
 
-void TeBkUmLpqAsyncRouter::queriesAsync(const char* q, int ql, AsyncReq* req) {
+void TeBkUmLpqAsyncRouter::queriesMultiAsync(const char* q, int ql, SocketInterface* sif) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
-	req->vec.reserve(queryCount);
+	LibpqDataSourceImpl* sqli = getDb(3);
 
-	LibpqDataSourceImpl* sqli = getDb();
+	std::stringstream ss;
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		ss << "select id, randomnumber from world where id = " << rid << ";";
+	}
 
-	try {
-		void* areq = NULL;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			std::vector<LibpqParam> pars;
-			LibpqDataSourceImpl::ADD_INT4(pars, rid);
-			areq = sqli->executeQueryAsync(WORLD_ONE_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::queriesAsyncUtil, &TeBkUmLpqAsyncRouter::queriesAsyncCh, areq);
+	LibpqAsyncReq* areq = sqli->getAsyncRequest();
+	LibpqQuery* qu = areq->getQuery();
+	qu->withSelectQuery(ss.str()).withMulti();
+
+	areq->withFinalCb(sif, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& q, int counter) {
+		SocketInterface* sif = (SocketInterface*)ctx;
+		std::vector<TeBkUmLpqAsyncWorld> vec;
+		vec.reserve((int)results->size());
+		for (int i = 0; i < (int)results->size(); ++i) {
+			PGresult* res = results->at(i);
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				int tmp = 0;
+				CommonUtils::fastStrToNum(PQgetvalue(res, 0, j), PQgetlength(res, 0, j), tmp);
+				if(j==0) vec.emplace_back(tmp);
+				else vec.back().setRandomNumber(tmp);
+			}
 		}
-		sqli->completeAsync(areq);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::queriesAsyncUtil(void* ctx, int rn, int cn, char * d) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	if(cn==0) {
-		req->vec.emplace_back(ntohl(*((uint32_t *) d)));
-	} else {
-		req->vec.back().setRandomNumber(ntohl(*((uint32_t *) d)));
-	}
-}
-void TeBkUmLpqAsyncRouter::queriesAsyncCh(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	HttpResponse r;
-	r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
-	std::string d;
-	r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
-	req->sif->writeDirect(d);
-	req->sif->writeDirect(r.getContent());
-	req->sif->unUse();
-	delete req;
-}
 
+		HttpResponse r;
+		JSONSerialize::serializeObjectCont(&vec, wcont_ser, "vector", r.getContentP());
+		std::string h;
+		r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, 1.1, false);
+		sif->writeDirect(h, r.getContent());
+		sif->unUse();
+	});
+	sqli->postAsync(areq, queryCount);
+}
 
-#ifndef HAVE_LIBPQ_BATCH
-void TeBkUmLpqAsyncRouter::queriesMultiAsync(const char* q, int ql, AsyncReq* req) {
+void TeBkUmLpqAsyncRouter::updatesMulti(const char* q, int ql, AsyncUpdatesReq* req) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	req->vec.reserve(queryCount);
+	req->sqli = getDb(3);
 
-	LibpqDataSourceImpl* sqli = getDb();
-
-	try {
-		std::stringstream ss;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			ss << "select id, randomnumber from world where id = " << rid << ";";
-		}
-		void* areq = sqli->executeMultiQueryAsync(ss.str(), req, &TeBkUmLpqAsyncRouter::queriesMultiAsyncUtil, &TeBkUmLpqAsyncRouter::queriesMultiAsyncCh);
-		sqli->completeAsync(areq, queryCount);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::queriesMultiAsyncUtil(void* ctx, int rn, int cn, char * d, int l) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	int tmp = 0;
-	strToNum(d, l, tmp);
-	if(cn==0) {
-		req->vec.emplace_back(tmp);
-	} else {
-		req->vec.back().setRandomNumber(tmp);
+	std::stringstream ss;
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		ss << "select id, randomnumber from world where id = " << rid << ";";
 	}
-}
-void TeBkUmLpqAsyncRouter::queriesMultiAsyncCh(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	HttpResponse r;
-	r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
-	std::string d;
-	r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
-	req->sif->writeDirect(d);
-	req->sif->writeDirect(r.getContent());
-	req->sif->unUse();
-	delete req;
-}
-#endif
 
+	//req->ss << "begin;";//NEVER USE - this creates a deadlock issue (like, DETAIL:  Process 16 waits for ShareLock on transaction 995; blocked by process 19.)
+	LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+	LibpqQuery* qu = areq->getQuery();
+	qu->withSelectQuery(ss.str()).withMulti();
+
+	areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& q, int counter) {
+		AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+		if(status) {
+			int queryCount = (int)results->size();
+
+			std::stringstream ss;
+			for (int i = 0; i < queryCount; ++i) {
+				PGresult* res = results->at(i);
+				int cols = PQnfields(res);
+				for (int j = 0; j < cols; ++j) {
+					int tmp = 0;
+					CommonUtils::fastStrToNum(PQgetvalue(res, 0, j), PQgetlength(res, 0, j), tmp);
+					if(j==0) req->vec.emplace_back(tmp);
+					else {
+						TeBkUmLpqAsyncWorld& w = req->vec.back();
+						int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1;
+						if(tmp == newRandomNumber) {
+							newRandomNumber += 1;
+							if(newRandomNumber>=10000) {
+								newRandomNumber = 1;
+							}
+						}
+						w.setRandomNumber(newRandomNumber);
+						ss << "begin;update world set randomnumber = " << newRandomNumber << " where id = " << w.getId() << ";commit;";
+					}
+				}
+			}
 
+			LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+			LibpqQuery* qu = areq->getQuery();
+			qu->withUpdateQuery(ss.str()).withMulti();
+
+			areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& q, int counter) {
+				AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+				if(status) {
+					HttpResponse r;
+					JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
+					std::string h;
+					r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
+					req->sif->writeDirect(h, r.getContent());
+				} else {
+					HttpResponse r;
+					std::string h;
+					r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true);
+					req->sif->writeDirect(h);
+				}
+				req->sif->unUse();
+				delete req;
+			});
+			req->sqli->postAsync(areq, queryCount*3);
+		}
+	});
+	req->sqli->postAsync(areq, queryCount);
+}
 
 std::string& TeBkUmLpqAsyncRouter::getUpdQuery(int count) {
-	std::map<int, std::string>::iterator it = _qC.find(count);
+	std::unordered_map<int, std::string>::iterator it = _qC.find(count);
 	if(it!=_qC.end()) {
 		return it->second;
 	}
 
 	std::stringstream ss;
-	ss << "update world as t set randomnumber = case id ";
+	ss << "update world as t set randomnumber = case id";
 
 	int pc = 1;
 	for (int c = 0; c < count; ++c) {
-		ss << "when $";
+		ss << " when $";
 		ss << pc++;
 		ss << " then $";
 		ss << pc++;
 	}
-	ss << "else randomnumber end where id in (";
+	ss << " else randomnumber end where id in (";
 	for (int c = 0; c < count; ++c) {
 		ss << "$" << pc++ << ",";
 	}
 	std::string q = ss.str();
 	q = q.substr(0, q.length()-1);
 	q += ")";
+
 	_qC[count] = std::move(q);
 	return _qC[count];
 }
-
-void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncReq* req) {
+void TeBkUmLpqAsyncRouter::updatesAsyncb(const char* q, int ql, AsyncUpdatesReq* req) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	req->vec.reserve(queryCount);
-
-	LibpqDataSourceImpl* sqli = getDb();
-	req->sqli = sqli;
-
-	try {
-		void* areq = NULL;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			std::vector<LibpqParam> pars;
-			LibpqDataSourceImpl::ADD_INT4(pars, rid);
-			areq = sqli->executeQueryAsync(WORLD_ONE_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::queriesAsyncUtil, &TeBkUmLpqAsyncRouter::updatesAsyncbChQ, areq);
-		}
-		sqli->completeAsync(areq);
-	} catch(const std::exception& e) {
-		throw e;
+	req->sqli = getDb(3);
+
+	LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		LibpqQuery* q = areq->getQuery();
+		q->withParamInt4(rid);
+		q->withSelectQuery(WORLD_ONE_QUERY);
 	}
-}
-void TeBkUmLpqAsyncRouter::updatesAsyncbChQ(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-
-	LibpqDataSourceImpl* sqli = req->sqli;
-
-	int queryCount = (int)req->vec.size();
-	std::vector<LibpqParam> pars;
-
-	for(std::vector<TeBkUmLpqAsyncWorld>::iterator it=req->vec.begin(); it != req->vec.end(); ++it) {
-		LibpqDataSourceImpl::ADD_INT4(pars, (*it).getId());
-
-		int newRandomNumber = rand() % 10000 + 1;
-		if((*it).getRandomNumber() == newRandomNumber) {
-			newRandomNumber += 1;
-			if(newRandomNumber>=10000) {
-				newRandomNumber = 1;
+	areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& query, int counter) {
+		AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+
+		int queryCount = (int)results->size();
+
+		LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+		req->sqli->beginAsync(areq);
+		LibpqQuery* q = areq->getQuery();
+		q->withUpdateQuery(getUpdQuery(queryCount)).withContext(req);
+
+		for (int i = 0; i < queryCount; ++i) {
+			PGresult* res = results->at(i);
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) req->vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+				else {
+					int tmp = ntohl(*((uint32_t *) PQgetvalue(res, 0, j)));
+					TeBkUmLpqAsyncWorld& w = req->vec.back();
+					int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1;
+					if(tmp == newRandomNumber) {
+						newRandomNumber += 1;
+						if(newRandomNumber>=10000) {
+							newRandomNumber = 1;
+						}
+					}
+					w.setRandomNumber(newRandomNumber);
+					q->withParamInt4(w.getId());
+					q->withParamInt4(w.getRandomNumber());
+				}
 			}
 		}
-		LibpqDataSourceImpl::ADD_INT4(pars, newRandomNumber);
-		(*it).setRandomNumber(newRandomNumber);
-	}
-	for(std::vector<TeBkUmLpqAsyncWorld>::iterator it=req->vec.begin(); it != req->vec.end(); ++it) {
-		LibpqDataSourceImpl::ADD_INT4(pars, (*it).getId());
-	}
-
-	void* areq = sqli->beginAsync(NULL);
-	sqli->executeUpdateQueryAsync(getUpdQuery(queryCount), std::move(pars), NULL, NULL, areq, true);
-	sqli->commitAsync(areq);
-
-	AsyncReq* ar = new AsyncReq;
-	ar->sif = req->sif;
-	ar->httpVers = req->httpVers;
-	ar->conn_clos = req->conn_clos;
-	ar->vec = std::move(req->vec);
-	req->sif = NULL;
-
-	try {
-		sqli->completeAsync(areq, ar, &TeBkUmLpqAsyncRouter::updatesAsyncbChU);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::updatesAsyncbChU(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	HttpResponse r;
-	r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
-	std::string d;
-	r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
-	req->sif->writeDirect(d);
-	req->sif->writeDirect(r.getContent());
-	req->sif->unUse();
-	delete req;
+		for(auto w: req->vec) {
+			q->withParamInt4(w.getId());
+		}
+		req->sqli->commitAsync(areq);
+
+		areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& query, int counter) {
+			AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+			if(status) {
+				HttpResponse r;
+				JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
+				std::string h;
+				r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
+				req->sif->writeDirect(h, r.getContent());
+			} else {
+				HttpResponse r;
+				std::string h;
+				r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true);
+				req->sif->writeDirect(h);
+			}
+			req->sif->unUse();
+			delete req;
+		});
+		req->sqli->postAsync(areq);
+	});
+	req->sqli->postAsync(areq);
 }
 
-void TeBkUmLpqAsyncRouter::updatesAsync(const char* q, int ql, AsyncReq* req) {
+void TeBkUmLpqAsyncRouter::updatesAsync(const char* q, int ql, AsyncUpdatesReq* req) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	req->vec.reserve(queryCount);
 
-	LibpqDataSourceImpl* sqli = getDb();
-	req->sqli = sqli;
+	req->sqli = getDb(3);
 
-	try {
-		void* areq = NULL;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			std::vector<LibpqParam> pars;
-			LibpqDataSourceImpl::ADD_INT4(pars, rid);
-			areq = sqli->executeQueryAsync(WORLD_ONE_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::queriesAsyncUtil, &TeBkUmLpqAsyncRouter::updatesAsyncChQ, areq);
-		}
-		sqli->completeAsync(areq);
-	} catch(const std::exception& e) {
-		throw e;
+	LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		LibpqQuery* qu = areq->getQuery();
+		qu->withParamInt4(rid);
+		qu->withSelectQuery(WORLD_ONE_QUERY);
 	}
-}
-void TeBkUmLpqAsyncRouter::updatesAsyncChQ(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-
-	std::stringstream ss;
-	//ss << "update world as t set randomnumber = c.randomnumber from (values";
-
-	LibpqDataSourceImpl* sqli = req->sqli;
-
-	void* areq = NULL;
-	for(std::vector<TeBkUmLpqAsyncWorld>::iterator it=req->vec.begin(); it != req->vec.end(); ++it) {
-		int newRandomNumber = rand() % 10000 + 1;
-		if((*it).getRandomNumber() == newRandomNumber) {
-			newRandomNumber += 1;
-			if(newRandomNumber>=10000) {
-				newRandomNumber = 1;
+	areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& query, int counter) {
+		AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+		LibpqAsyncReq* areq = req->sqli->getAsyncRequest();
+
+		for (int i = 0; i < (int)results->size(); ++i) {
+			PGresult* res = results->at(i);
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) req->vec.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+				else {
+					int tmp = ntohl(*((uint32_t *) PQgetvalue(res, 0, j)));
+					TeBkUmLpqAsyncWorld& w = req->vec.back();
+					int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1;
+					if(tmp == newRandomNumber) {
+						newRandomNumber += 1;
+						if(newRandomNumber>=10000) {
+							newRandomNumber = 1;
+						}
+					}
+					w.setRandomNumber(newRandomNumber);
+
+					std::stringstream ss;
+					ss << "update world set randomnumber = " << newRandomNumber << " where id = " << w.getId();
+
+					req->sqli->beginAsync(areq);
+					LibpqQuery* q = areq->getQuery();
+					q->withUpdateQuery(ss.str(), false);
+					req->sqli->commitAsync(areq);
+				}
 			}
 		}
-		(*it).setRandomNumber(newRandomNumber);
-		if(areq==NULL) {
-			areq = sqli->beginAsync(areq);
-		} else {
-			sqli->beginAsync(areq);
-		}
-		ss.str(std::string());
-		std::vector<LibpqParam> pars;
-		ss << "update world set randomnumber = " << newRandomNumber << " where id = " << (*it).getId();
-		sqli->executeUpdateQueryAsync(ss.str(), std::move(pars), NULL, NULL, areq, false);
-		sqli->commitAsync(areq);
-		/*if(c!=queryCount-1) {
-			ss << ",";
-		}*/
-	}
-	//ss << ") as c(id, randomnumber) where c.id = t.id";
-
-	AsyncReq* ar = new AsyncReq;
-	ar->sif = req->sif;
-	ar->httpVers = req->httpVers;
-	ar->conn_clos = req->conn_clos;
-	ar->vec = std::move(req->vec);
-	req->sif = NULL;
-
-	try {
-		sqli->completeAsync(areq, ar, &TeBkUmLpqAsyncRouter::updatesAsyncChU);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::updatesAsyncChU(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	HttpResponse r;
-	r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
-	std::string d;
-	r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
-	req->sif->writeDirect(d);
-	req->sif->writeDirect(r.getContent());
-	req->sif->unUse();
-	delete req;
+
+		areq->withFinalCb(req, [](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& query, int counter) {
+			AsyncUpdatesReq* req = (AsyncUpdatesReq*)ctx;
+			if(status) {
+				HttpResponse r;
+				JSONSerialize::serializeObjectCont(&req->vec, wcont_ser, "vector", r.getContentP());
+				std::string h;
+				r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, req->conn_clos);
+				req->sif->writeDirect(h, r.getContent());
+			} else {
+				HttpResponse r;
+				std::string h;
+				r.httpStatus(HTTPResponseStatus::InternalServerError).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->httpVers, true);
+				req->sif->writeDirect(h);
+			}
+			req->sif->unUse();
+			delete req;
+		});
+		req->sqli->postAsync(areq);
+	});
+	req->sqli->postAsync(areq);
 }
 
 void TeBkUmLpqAsyncRouter::updateCache() {
-	LibpqDataSourceImpl* sqli = getDb();
+	LibpqDataSourceImpl* sqli = getDb(1);
 
-	CacheReq* req = new CacheReq;
+	AsyncCacheReq* req = new AsyncCacheReq;
 	req->cchi = CacheManager::getImpl();
 
-	try {
-		std::vector<LibpqParam> pars;
-		void* areq = sqli->executeQueryAsync(WORLD_ALL_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::updateCacheAsyncUtil, &TeBkUmLpqAsyncRouter::updateCacheAsyncCh, NULL);
-		sqli->completeAsync(areq);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqAsyncRouter::updateCacheAsyncUtil(void* ctx, int rn, std::vector<LibpqRes>& data) {
-	CacheReq* req = (CacheReq*)ctx;
-	req->vec.emplace_back(ntohl(*((uint32_t *) data.at(0).d)), ntohl(*((uint32_t *) data.at(1).d)));
-}
-void TeBkUmLpqAsyncRouter::updateCacheAsyncCh(void* ctx, bool status, const std::string& q, int counter) {
-	CacheReq* req = (CacheReq*)ctx;
-	CacheInterface* cchi = req->cchi;
+	LibpqAsyncReq* areq = sqli->getAsyncRequest();
+	LibpqQuery* q = areq->getQuery();
+	q->withSelectQuery(WORLD_ALL_QUERY).withContext(req).withCb3([](void* ctx, bool endofdata, int row, int col, char* value) {
+		AsyncCacheReq* req = (AsyncCacheReq*)ctx;
+		if(col==0) {
+			req->vec.emplace_back(ntohl(*((uint32_t *) value)));
+		} else {
+			req->vec.back().setRandomNumber(ntohl(*((uint32_t *) value)));
+		}
 
-	try {
-		for(std::vector<TeBkUmLpqAsyncWorld>::iterator it=req->vec.begin(); it != req->vec.end(); ++it) {
-			char str[12];
-			sprintf(str, "%d;%d", (*it).getId(), (*it).getRandomNumber());
-			cchi->setRaw(CastUtil::fromNumber((*it).getId()), str);
+		if(endofdata) {
+			CacheInterface* cchi = req->cchi;
+			try {
+				for(std::vector<TeBkUmLpqAsyncWorld>::iterator it=req->vec.begin(); it != req->vec.end(); ++it) {
+					char str[12];
+					sprintf(str, "%d;%d", (*it).getId(), (*it).getRandomNumber());
+					cchi->setRaw((*it).getId(), str);
+				}
+				CacheManager::cleanImpl(cchi);
+				delete req;
+				CacheManager::triggerAppInitCompletion("te-benchmark-um-pq-async");
+			} catch(const std::exception& e) {
+				CacheManager::cleanImpl(cchi);
+				delete req;
+			}
 		}
-		CacheManager::cleanImpl(cchi);
-		delete req;
-		CacheManager::triggerAppInitCompletion("te-benchmark-um-pq-async");
-	} catch(const std::exception& e) {
-		CacheManager::cleanImpl(cchi);
-		delete req;
-		throw e;
-	}
+	});
+	sqli->postAsync(areq);
 }
-
 void TeBkUmLpqAsyncRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmLpqAsyncWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
 	CacheInterface* cchi = CacheManager::getImpl();
 
-	try {
-		std::vector<std::string> keys;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			std::string v = cchi->getValue(CastUtil::fromNumber(rid));
-			size_t fn = v.find(";");
-			int tmp = 0;
-			strToNum(v.substr(0, fn).c_str(), fn, tmp);
-			int tmp1 = 0;
-			strToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1);
-			wlst.emplace_back(tmp, tmp1);
-		}
-		CacheManager::cleanImpl(cchi);
-	} catch(const std::exception& e) {
-		CacheManager::cleanImpl(cchi);
-		throw e;
-	}
-}
-
-
-void TeBkUmLpqAsyncRouter::getContextAsync(AsyncReq* req) {
-	LibpqDataSourceImpl* sqli = getDb();
-
-	try {
-		std::vector<LibpqParam> pars;
-		void* areq = sqli->executeQueryAsync(FORTUNE_ALL_QUERY, std::move(pars), req, &TeBkUmLpqAsyncRouter::getContextAsyncUtil, &TeBkUmLpqAsyncRouter::getContextAsyncCh, NULL);
-		sqli->completeAsync(areq);
-	} catch(...) {
-		throw;
+	std::vector<unsigned long long> keys;
+	for (int c = 0; c < queryCount; ++c) {
+		keys.emplace_back(CommonUtils::fastrand(g_seed) % 10000 + 1);
 	}
-}
-void TeBkUmLpqAsyncRouter::getContextAsyncUtil(void* ctx, int rn, int cn, char * d, int l) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	if(cn==0) {
-		req->flst.emplace_back(ntohl(*((uint32_t *) d)));
-	} else {
-		TeBkUmLpqAsyncFortune& w = req->flst.back();
-		w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)d, (size_t)l, w.message_i, w.allocd);
+	std::vector<std::string> values;
+	cchi->getValues(keys, values);
+	for (int c = 0; c < queryCount; ++c) {
+		std::string& v = values.at(c);
+		size_t fn = v.find(";");
+		int tmp = 0;
+		CommonUtils::fastStrToNum(v.substr(0, fn).c_str(), fn, tmp);
+		int tmp1 = 0;
+		CommonUtils::fastStrToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1);
+		wlst.emplace_back(tmp, tmp1);
 	}
-}
+	CacheManager::cleanImpl(cchi);
+}
+
+
+void TeBkUmLpqAsyncRouter::fortunes(SocketInterface* sif) {
+	LibpqDataSourceImpl* sqli = getDb(7);
+	LibpqAsyncReq* areq = sqli->getAsyncRequest();
+	LibpqQuery* q = areq->getQuery();
+	q->withSelectQuery(FORTUNE_ALL_QUERY).withContext(sif).withCb0([](void* ctx, PGresult* res) {
+		SocketInterface* sif = (SocketInterface*)ctx;
+
+		std::list<TeBkUmLpqAsyncFortune> flst;
+		int cols = PQnfields(res);
+		int rows = PQntuples(res);
+		for(int i=0; i<rows; i++) {
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) {
+					flst.emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, i, j))));
+				} else {
+					TeBkUmLpqAsyncFortune& w = flst.back();
+					w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)PQgetvalue(res, i, j), (size_t)PQgetlength(res, i, j), w.message_i, w.allocd);
+				}
+			}
+		}
 
-void TeBkUmLpqAsyncRouter::getContextAsyncCh(void* ctx, bool status, const std::string& q, int counter) {
-	AsyncReq* req = (AsyncReq*)ctx;
-	Context context;
+		Context context;
 
-	req->flst.emplace_back(0, "Additional fortune added at request time.");
-	req->flst.sort();
+		flst.emplace_back(0, "Additional fortune added at request time.");
+		flst.sort();
 
-	context.insert(std::pair<std::string, void*>("fortunes", &req->flst));
+		context.emplace("fortunes", &flst);
 
-	if(tmplFunc!=NULL)
-	{
 		fcpstream str;
 		tmplFunc(&context, str);
+		std::string out = str.str();
 		HttpResponse r;
-		r.setHTTPResponseStatus(HTTPResponseStatus::Ok);
-		std::string d;
-		r.generateHeadResponse(d, ContentTypes::CONTENT_TYPE_TEXT_SHTML, req->httpVers, req->conn_clos, (int)str.str().length());
-		req->sif->writeDirect(d);
-		req->sif->writeDirect(str.str());
-		req->sif->unUse();
-	}
-	else
-	{
-		ResponseData d;
-		HttpResponse r;
-		r.generateHeadResponse(d._b, req->httpVers, req->conn_clos);
-		req->sif->writeTo(&d);
-		req->sif->unUse();
-	}
-}
-
-//https://stackoverflow.com/questions/9631225/convert-strings-specified-by-length-not-nul-terminated-to-int-float
-bool TeBkUmLpqAsyncRouter::strToNum(const char* str, int len, int& ret) {
-    ret = 0;
-    for(int i = 0; i < len; ++i)
-    {
-    	if(!isdigit(str[i])) return false;
-        ret = ret * 10 + (str[i] - '0');
-    }
-    return true;
+		std::string h;
+		r.httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_HTML, 1.1, false, (int)out.length());
+		sif->writeDirect(h, out);
+		sif->unUse();
+	});
+	sqli->postAsync(areq);
 }
 
 bool TeBkUmLpqAsyncRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface* sif) {
 	sif->use();
 	if(StringUtil::endsWith(req->getPath(), "/plaintext")) {
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
-		std::string d;
-		res->generateHeadResponse(d, ContentTypes::CONTENT_TYPE_TEXT_PLAIN, (int)HELLO_WORLD.length());
-		sif->writeDirect(d);
-		sif->writeDirect(HELLO_WORLD);
+		std::string h;
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_PLAIN, (int)HELLO_WORLD.length());
+		sif->writeDirect(h, HELLO_WORLD);
 		sif->unUse();
 	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
 		TeBkUmLpqAsyncMessage msg;
 		msg.setMessage(HELLO_WORLD);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		JSONSerialize::serializeObject(&msg, m_ser, res->getContentP());
-		std::string d;
-		res->generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		sif->writeDirect(d);
-		sif->writeDirect(res->getContent());
+		std::string h;
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+		sif->writeDirect(h, res->getContent());
 		sif->unUse();
 	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
-		AsyncReq* ar = new AsyncReq;
+		/*AsyncDbReq* ar = new AsyncDbReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
-		ar->conn_clos = req->isClose();
-		dbAsync(ar);
+		ar->conn_clos = req->isClose();*/
+		dbAsync(sif);
 	} else if(StringUtil::endsWith(req->getPath(), "/queries")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
-		AsyncReq* ar = new AsyncReq;
+		/*AsyncQueriesReq* ar = new AsyncQueriesReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
-		ar->conn_clos = req->isClose();
-		queriesAsync(params[0].val, params[0].val_len, ar);
-	}
-#ifndef HAVE_LIBPQ_BATCH
-	else if(StringUtil::endsWith(req->getPath(), "/queriem")) {
+		ar->conn_clos = req->isClose();*/
+		queriesAsync(params[0].val, params[0].val_len, sif);
+	} else if(StringUtil::endsWith(req->getPath(), "/queriem")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
-		AsyncReq* ar = new AsyncReq;
+		/*AsyncQueriesReq* ar = new AsyncQueriesReq;
 		ar->sif = sif;
+		ar->httpVers = req->getHttpVers();
+		ar->conn_clos = req->isClose();*/
+		queriesMultiAsync(params[0].val, params[0].val_len, sif);
+	} else if(StringUtil::endsWith(req->getPath(), "/updatem")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		AsyncUpdatesReq* ar = new AsyncUpdatesReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
-		queriesMultiAsync(params[0].val, params[0].val_len, ar);
+		updatesMulti(params[0].val, params[0].val_len, ar);
 	}
-#endif
 	else if(StringUtil::endsWith(req->getPath(), "/fortunes")) {
-		AsyncReq* ar = new AsyncReq;
-		ar->sif = sif;
+		/*AsyncFortuneReq* ar = new AsyncFortuneReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
-		ar->conn_clos = req->isClose();
-		getContextAsync(ar);
-	} else if(StringUtil::endsWith(req->getPath(), "/bupdates")) {
+		ar->conn_clos = req->isClose();*/
+		fortunes(sif);
+	} else if(StringUtil::endsWith(req->getPath(), "/bupdates") || StringUtil::endsWith(req->getPath(), "/updates")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
-		AsyncReq* ar = new AsyncReq;
-		ar->sif = sif;
+		AsyncUpdatesReq* ar = new AsyncUpdatesReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
 		updatesAsyncb(params[0].val, params[0].val_len, ar);
-	} else if(StringUtil::endsWith(req->getPath(), "/updates")) {
+	} else if(StringUtil::endsWith(req->getPath(), "/update_")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
-		AsyncReq* ar = new AsyncReq;
-		ar->sif = sif;
+		AsyncUpdatesReq* ar = new AsyncUpdatesReq;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
@@ -637,18 +641,15 @@ bool TeBkUmLpqAsyncRouter::route(HttpRequest* req, HttpResponse* res, SocketInte
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqAsyncWorld> msg;
 		cachedWorlds(params[0].val, params[0].val_len, msg);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		std::string d;
-		res->generateHeadResponse(d, ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		sif->writeDirect(d);
-		sif->writeDirect(res->getContent());
+		std::string h;
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+		sif->writeDirect(h, res->getContent());
 		sif->unUse();
 	} else {
-		res->setHTTPResponseStatus(HTTPResponseStatus::NotFound);
-		std::string d;
-		res->generateHeadResponse(d, ContentTypes::CONTENT_TYPE_TEXT_PLAIN);
-		sif->writeDirect(d);
+		std::string h;
+		res->httpStatus(HTTPResponseStatus::NotFound).generateHeadResponse(h, req->getHttpVers(), true);
+		sif->writeDirect(h);
 		sif->unUse();
 	}
 	return false;
@@ -668,11 +669,58 @@ TeBkUmLpqAsyncRouter::TeBkUmLpqAsyncRouter() {
 }
 
 TeBkUmLpqAsyncRouter::~TeBkUmLpqAsyncRouter() {
+	if(sqli!=NULL) {
+		DataSourceManager::cleanRawImpl(sqli);
+	}
 }
 
-LibpqDataSourceImpl* TeBkUmLpqAsyncRouter::getDb() {
+LibpqDataSourceImpl* TeBkUmLpqAsyncRouter::getDb(int max) {
 	if(sqli==NULL) {
 		sqli = static_cast<LibpqDataSourceImpl*>(DataSourceManager::getRawImpl("PostgreSQL-DSN", "te-benchmark-um-pq-async"));
 	}
 	return sqli;
 }
+
+LibpqDataSourceImpl* TeBkUmLpqAsyncRouterPooled::getDb(int max) {
+	if(max==0) {
+		max = maxconns;
+	} else {
+		max = std::min(max, maxconns);
+	}
+	int pc = 0;
+	if(inited) {
+		pc = ++opt;
+		if(pc>=INT_MAX-1) {
+			opt = 0;
+		}
+	} else {
+		for (int var = 0; var < maxconns; ++var) {
+			pool.push_back(static_cast<LibpqDataSourceImpl*>(DataSourceManager::getRawImpl("PostgreSQL-DSN", "te-benchmark-um-pq-async", true)));
+		}
+		inited = true;
+	}
+	return pool.at(pc%max);
+}
+
+TeBkUmLpqAsyncRouterPooled::TeBkUmLpqAsyncRouterPooled() {
+	maxconns = 7;
+	propMap props = ConfigurationData::getAppProperties();
+	if(props.size()>0) {
+		if(props.find("dbpoolsize")!=props.end()) {
+			try {
+				maxconns = CastUtil::toInt(props["dbpoolsize"]);
+			} catch(...) {
+			}
+		}
+	}
+	inited = false;
+	opt = 0;
+}
+
+TeBkUmLpqAsyncRouterPooled::~TeBkUmLpqAsyncRouterPooled() {
+	for(auto sqli: pool) {
+		if(sqli!=NULL) {
+			DataSourceManager::cleanRawImpl(sqli);
+		}
+	}
+}

+ 21 - 19
frameworks/C++/ffead-cpp/te-benchmark-um-pq/include/TeBkUmLpq.h

@@ -43,6 +43,7 @@
 #include "yuarel.h"
 #include "Router.h"
 #include "Reflector.h"
+#include <unordered_map>
 
 class TeBkUmLpqWorld {
 	int id;
@@ -56,11 +57,12 @@ public:
 	void setId(int id);
 	int getRandomNumber() const;
 	void setRandomNumber(int randomNumber);
+	bool operator < (const TeBkUmLpqWorld& other) const;
 };
 
 struct UpdQrData {
 	std::vector<TeBkUmLpqWorld>* wlist;
-	std::stringstream* ss;
+	std::stringstream ss;
 	bool status;
 	int queryCount;
 };
@@ -80,6 +82,8 @@ public:
 	bool operator < (const TeBkUmLpqFortune& other) const;
 };
 
+class TeBkUmLpqRouterPicoV;
+
 class TeBkUmLpqMessage {
 	std::string message;
 public:
@@ -92,10 +96,11 @@ public:
 
 class TeBkUmLpqRouter : public Router {
 	static const std::string HELLO_WORLD;
-	static std::string WORLD;
-	static std::string WORLD_ONE_QUERY;
-	static std::string WORLD_ALL_QUERY;
-	static std::string FORTUNE_ALL_QUERY;
+	static const std::string WORLD;
+	static const std::string WORLD_ONE_QUERY;
+	static const std::string WORLD_ALL_QUERY;
+	static const std::string FORTUNE_ALL_QUERY;
+	static int g_seed;
 
 	static TemplatePtr tmplFunc;
 
@@ -103,31 +108,20 @@ class TeBkUmLpqRouter : public Router {
 	static Ser w_ser;
 	static SerCont wcont_ser;
 
-	static bool strToNum(const char* str, int len, int& ret);
-
 	void db(TeBkUmLpqWorld&);
 	void queries(const char*, int, std::vector<TeBkUmLpqWorld>&);
 	void queriesMulti(const char*, int, std::vector<TeBkUmLpqWorld>&);
-	static void dbUtil(void* ctx, int, int, char *);
-	static void queriesMultiUtil(void* ctx, int, int, char *, int);
-
 	void updates(const char*, int, std::vector<TeBkUmLpqWorld>&);
-	static void updatesUtil(void* ctx, int, int, char *);
 	void updatesMulti(const char*, int, std::vector<TeBkUmLpqWorld>&);
-	static void updatesMultiUtil(void* ctx, int, int, char *, int);
-	static void updatesMultiUtilCh(void* ctx, bool status, const std::string& query, int counter);
-	
 	void cachedWorlds(const char*, int, std::vector<TeBkUmLpqWorld>&);
-	static void updateCacheUtil(void* ctx, int rn, std::vector<LibpqRes>& data);
-
-	void handleTemplate(HttpResponse* res);
-	static void getContextUtil(void* ctx, int, int, char *, int);
+	void handleTemplate(HttpRequest* req, HttpResponse* res, SocketInterface* sif);
 
-	std::map<int, std::string> _qC;
+	std::unordered_map<int, std::string> _qC;
 	LibpqDataSourceImpl* sqli;
 	LibpqDataSourceImpl* getDb();
 
 	std::string& getUpdQuery(int count);
+	friend class TeBkUmLpqRouterPicoV;
 public:
 	TeBkUmLpqRouter();
 	virtual ~TeBkUmLpqRouter();
@@ -135,4 +129,12 @@ public:
 	bool route(HttpRequest* req, HttpResponse* res, SocketInterface* sif);
 };
 
+class TeBkUmLpqRouterPicoV : public TeBkUmLpqRouter {
+	void handleTemplate(HttpResponse* res);
+public:
+	TeBkUmLpqRouterPicoV();
+	virtual ~TeBkUmLpqRouterPicoV();
+	bool route(HttpRequest* req, HttpResponse* res, SocketInterface* sif);
+};
+
 #endif /* WEB_TE_BENCHMARK_UM_INCLUDE_TeBkUmLpq_H_ */

+ 334 - 250
frameworks/C++/ffead-cpp/te-benchmark-um-pq/src/TeBkUmLpq.cpp

@@ -19,6 +19,7 @@
  *  Created on: 03-Feb-2020
  *      Author: sumeetc
  */
+
 #include "TeBkUmLpq.h"
 
 int TeBkUmLpqWorld::getId() const {
@@ -47,6 +48,10 @@ TeBkUmLpqWorld::TeBkUmLpqWorld(int id, int randomNumber) {
 	this->randomNumber = randomNumber;
 }
 
+bool TeBkUmLpqWorld::operator < (const TeBkUmLpqWorld& other) const {
+	return id < other.id;
+}
+
 TeBkUmLpqWorld::TeBkUmLpqWorld() {
 	id = 0;
 	randomNumber = 0;
@@ -109,60 +114,57 @@ void TeBkUmLpqMessage::setMessage(const std::string& message) {
 }
 
 const std::string TeBkUmLpqRouter::HELLO_WORLD = "Hello, World!";
-std::string TeBkUmLpqRouter::WORLD = "world";
-std::string TeBkUmLpqRouter::WORLD_ONE_QUERY = "select id, randomnumber from world where id = $1";
-std::string TeBkUmLpqRouter::WORLD_ALL_QUERY = "select id, randomnumber from world";
-std::string TeBkUmLpqRouter::FORTUNE_ALL_QUERY = "select id, message from fortune";
+const std::string TeBkUmLpqRouter::WORLD = "world";
+const std::string TeBkUmLpqRouter::WORLD_ONE_QUERY = "select id,randomnumber from world where id=$1";
+const std::string TeBkUmLpqRouter::WORLD_ALL_QUERY = "select id,randomnumber from world";
+const std::string TeBkUmLpqRouter::FORTUNE_ALL_QUERY = "select id,message from fortune";
+int TeBkUmLpqRouter::g_seed = 0;
 
 void TeBkUmLpqRouter::db(TeBkUmLpqWorld& w) {
 	LibpqDataSourceImpl* sqli = getDb();
-	int rid = rand() % 10000 + 1;
-	try {
-		LibpqParams<1> pars;
-		pars.int4(rid);
-		sqli->executeQuery(WORLD_ONE_QUERY, &pars, &w, &TeBkUmLpqRouter::dbUtil);
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqRouter::dbUtil(void* ctx, int rn, int cn, char * d) {
-	TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx;
-	if(cn==0)w->setId(ntohl(*((uint32_t *) d)));
-	if(cn==1)w->setRandomNumber(ntohl(*((uint32_t *) d)));
+	int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+	LibpqQuery q;
+	q.withParamInt4(rid);
+	q.withSelectQuery(WORLD_ONE_QUERY).withContext(&w).withCb0([](void* ctx, PGresult* res) {
+		TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx;
+		int cols = PQnfields(res);
+		for (int j = 0; j < cols; ++j) {
+			if(j==0)w->setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+			else w->setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+		}
+	});
+	sqli->executeQuery(&q);
 }
 
 void TeBkUmLpqRouter::queries(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
 	LibpqDataSourceImpl* sqli = getDb();
 
-	LibpqParamsBase* pars = sqli->getParams(queryCount);
-	try {
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			pars->int4(rid);
-			wlst.emplace_back();
-			TeBkUmLpqWorld& w = wlst.back();
-			sqli->executeQuery(WORLD_ONE_QUERY, pars, &w, &TeBkUmLpqRouter::dbUtil);
-		}
-		delete pars;
-	} catch(const std::exception& e) {
-		delete pars;
-		throw e;
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		LibpqQuery q;
+		q.withParamInt4(rid);
+		q.withSelectQuery(WORLD_ONE_QUERY).withContext(&wlst).withCb0([](void* ctx, PGresult* res) {
+			std::vector<TeBkUmLpqWorld>* wlst = (std::vector<TeBkUmLpqWorld>*)ctx;
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) wlst->emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+				else wlst->back().setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+			}
+		});
+		sqli->executeQuery(&q);
 	}
 }
 
-
 void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
@@ -172,343 +174,333 @@ void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector<TeBkUmLpqW
 	updt.wlist = &wlst;
 	updt.status = true;
 
-	try {
-		std::stringstream ss;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			ss << "select id, randomnumber from world where id = " << rid << ";";
-		}
-		sqli->executeMultiQuery(ss.str(), &wlst, &TeBkUmLpqRouter::queriesMultiUtil, &TeBkUmLpqRouter::updatesMultiUtilCh);
+	std::stringstream ss;
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		ss << "select id, randomnumber from world where id = " << rid << ";";
+	}
 
-		if(!updt.status) {
-			wlst.clear();
+	LibpqQuery qu;
+	qu.withSelectQuery(ss.str()).withContext(&wlst).withCb5([](void* ctx, int rn, int cn, char * d, int l) {
+		std::vector<TeBkUmLpqWorld>* wlst = (std::vector<TeBkUmLpqWorld>*)ctx;
+		int tmp = 0;
+		CommonUtils::fastStrToNum(d, l, tmp);
+		if(cn==0) {
+			wlst->emplace_back(tmp);
+		} else {
+			wlst->back().setRandomNumber(tmp);
 		}
-
-	} catch(const std::exception& e) {
-		throw e;
-	}
-}
-void TeBkUmLpqRouter::queriesMultiUtil(void* ctx, int rn, int cn, char * d, int l) {
-	std::vector<TeBkUmLpqWorld>* wlst = (std::vector<TeBkUmLpqWorld>*)ctx;
-	int tmp = 0;
-	strToNum(d, l, tmp);
-	if(cn==0) {
-		wlst->emplace_back(tmp);
-	} else {
-		wlst->back().setRandomNumber(tmp);
-	}
+	});
+	sqli->executeMultiQuery(&qu);
 }
 
 std::string& TeBkUmLpqRouter::getUpdQuery(int count) {
-	std::map<int, std::string>::iterator it = _qC.find(count);
+	std::unordered_map<int, std::string>::iterator it = _qC.find(count);
 	if(it!=_qC.end()) {
 		return it->second;
 	}
 
 	std::stringstream ss;
-	ss << "update world as t set randomnumber = case id ";
+	ss << "update world as t set randomnumber = case id";
 
 	int pc = 1;
 	for (int c = 0; c < count; ++c) {
-		ss << "when $";
+		ss << " when $";
 		ss << pc++;
 		ss << " then $";
 		ss << pc++;
 	}
-	ss << "else randomnumber end where id in (";
+	ss << " else randomnumber end where id in (";
 	for (int c = 0; c < count; ++c) {
 		ss << "$" << pc++ << ",";
 	}
 	std::string q = ss.str();
 	q = q.substr(0, q.length()-1);
 	q += ")";
+
 	_qC[count] = std::move(q);
 	return _qC[count];
 }
 
 void TeBkUmLpqRouter::updates(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
 	LibpqDataSourceImpl* sqli = getDb();
 
-	LibpqParamsBase* pars = sqli->getParams(queryCount*3);
-	try {
-		std::string& query = getUpdQuery(queryCount);
-
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			LibpqParams<1> qp;
-			qp.int4(rid);
-			wlst.emplace_back();
-			TeBkUmLpqWorld& w = wlst.back();
-			sqli->executeQuery(WORLD_ONE_QUERY, &qp, &w, &TeBkUmLpqRouter::dbUtil);
-
-			pars->int4(w.getId());
+	std::string& query = getUpdQuery(queryCount);
+
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		wlst.emplace_back();
+		TeBkUmLpqWorld& w = wlst.back();
+
+		LibpqQuery q;
+		q.withParamInt4(rid);
+		q.withSelectQuery(WORLD_ONE_QUERY).withContext(&w).withCb0([](void* ctx, PGresult* res) {
+			TeBkUmLpqWorld* w = (TeBkUmLpqWorld*)ctx;
+			int cols = PQnfields(res);
+			for (int j = 0; j < cols; ++j) {
+				if(j==0)w->setId(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+				else w->setRandomNumber(ntohl(*((uint32_t *) PQgetvalue(res, 0, j))));
+			}
+		});
+		sqli->executeQuery(&q);
 
-			int newRandomNumber = rand() % 10000 + 1;
-			if(w.getRandomNumber() == newRandomNumber) {
-				newRandomNumber += 1;
-				if(newRandomNumber>=10000) {
-					newRandomNumber = 1;
-				}
+		int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		if(w.getRandomNumber() == newRandomNumber) {
+			newRandomNumber += 1;
+			if(newRandomNumber>=10000) {
+				newRandomNumber = 1;
 			}
-			pars->int4(newRandomNumber);
-			w.setRandomNumber(newRandomNumber);
 		}
-		for(std::vector<TeBkUmLpqWorld>::iterator it=wlst.begin(); it != wlst.end(); ++it) {
-			pars->int4((*it).getId());
-		}
-		
-		sqli->begin();
-		sqli->executeUpdateQuery(query, pars);
-		sqli->commit();
-		delete pars;
-	} catch(const std::exception& e) {
-		delete pars;
-		sqli->rollback();
-		throw e;
+		w.setRandomNumber(newRandomNumber);
 	}
+
+	LibpqQuery qu;
+	qu.withUpdateQuery(query);
+	std::sort(wlst.begin(), wlst.end());
+	for(std::vector<TeBkUmLpqWorld>::iterator it=wlst.begin(); it != wlst.end(); ++it) {
+		qu.withParamInt4((*it).getId());
+		qu.withParamInt4((*it).getRandomNumber());
+	}
+	for(std::vector<TeBkUmLpqWorld>::iterator it=wlst.begin(); it != wlst.end(); ++it) {
+		qu.withParamInt4((*it).getId());
+	}
+
+	sqli->begin();
+	sqli->executeUpdateQuery(&qu);
+	sqli->commit();
 }
 
 void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
 	LibpqDataSourceImpl* sqli = getDb();
 
-	try {
-		std::stringstream ss, ssq;
-		//ss << "begin;update world as t set randomnumber = c.randomnumber from (values";
-
-		UpdQrData updt;
-		updt.wlist = &wlst;
-		updt.ss = &ss;
-		updt.status = true;
-		updt.queryCount = queryCount;
+	std::stringstream ssq;
+	UpdQrData updt;
+	updt.wlist = &wlst;
+	updt.status = true;
+	updt.queryCount = queryCount;
 
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			ssq << "select id, randomnumber from world where id = " << rid << ";";
-		}
+	updt.ss << "begin;update world as t set randomnumber = case id ";
+	//ss << "begin;";//this creates a deadlock issue (like, DETAIL:  Process 16 waits for ShareLock on transaction 995; blocked by process 19.)
 
-		sqli->executeMultiQuery(ssq.str(), &updt, &TeBkUmLpqRouter::updatesMultiUtil, &TeBkUmLpqRouter::updatesMultiUtilCh);
-		//ss << ") as c(id, randomnumber) where c.id = t.id;commit";
+	for (int c = 0; c < queryCount; ++c) {
+		int rid = CommonUtils::fastrand(g_seed) % 10000 + 1;
+		ssq << "select id, randomnumber from world where id = " << rid << ";";
+	}
 
-		if(!updt.status) {
-			return;
+	LibpqQuery qu;
+	qu.withSelectQuery(ssq.str()).withContext(&updt).withCb5([](void* ctx, int rn, int cn, char * d, int l) {
+		UpdQrData* updt = (UpdQrData*)ctx;
+		int tmp = 0;
+		CommonUtils::fastStrToNum(d, l, tmp);
+		if(cn==0) {
+			updt->wlist->emplace_back(tmp);
+		} else {
+			TeBkUmLpqWorld& w = updt->wlist->back();
+			int newRandomNumber = CommonUtils::fastrand(g_seed) % 10000 + 1;
+			if(tmp == newRandomNumber) {
+				newRandomNumber += 1;
+				if(newRandomNumber>=10000) {
+					newRandomNumber = 1;
+				}
+			}
+			w.setRandomNumber(newRandomNumber);
+			updt->ss << "when ";
+			updt->ss << w.getId();
+			updt->ss << " then ";
+			updt->ss << newRandomNumber;
 		}
+	}).withFinalCb([](void* ctx, bool status, std::vector<PGresult*>* results, const std::string& q, int counter) {
+		UpdQrData* updt = (UpdQrData*)ctx;
+		updt->status = status;
+	});
+	sqli->executeMultiQuery(&qu);
 
-		sqli->executeUpdateMultiQuery(ss.str(), &updt, &TeBkUmLpqRouter::updatesMultiUtilCh);
-
-		if(!updt.status) {
-			wlst.clear();
-		}
-	} catch(const std::exception& e) {
-		sqli->rollback();
-		throw e;
+	if(!updt.status) {
+		return;
 	}
-}
-void TeBkUmLpqRouter::updatesMultiUtil(void* ctx, int rn, int cn, char * d, int l) {
-	UpdQrData* updt = (UpdQrData*)ctx;
-	std::stringstream* ss = updt->ss;
-	int tmp = 0;
-	strToNum(d, l, tmp);
-	if(cn==0) {
-		updt->wlist->emplace_back(tmp);
-	} else {
-		TeBkUmLpqWorld& w = updt->wlist->back();
-		int newRandomNumber = rand() % 10000 + 1;
-		if(tmp == newRandomNumber) {
-			newRandomNumber += 1;
-			if(newRandomNumber>=10000) {
-				newRandomNumber = 1;
-			}
+
+	updt.ss << "else randomnumber end where id in (";
+	for (int c = 0; c < queryCount; ++c) {
+		updt.ss << wlst.at(c).getId();
+		if(c<queryCount-1) {
+			updt.ss << ",";
 		}
-		w.setRandomNumber(newRandomNumber);
-		*ss << "begin;update world set randomnumber = " << newRandomNumber << " where id = " << w.getId() << ";commit;";
-	}
-}
-void TeBkUmLpqRouter::updatesMultiUtilCh(void* ctx, bool status, const std::string& query, int counter) {
-	UpdQrData* updt = (UpdQrData*)ctx;
-	if(!status) {
-		updt->status = status;
 	}
+	updt.ss << ");commit;";
+
+	qu.reset();
+	qu.withUpdateQuery(updt.ss.str());
+	sqli->executeUpdateMultiQuery(&qu);
 }
 
 void TeBkUmLpqRouter::updateCache() {
 	CacheInterface* cchi = CacheManager::getImpl();
 	LibpqDataSourceImpl* sqli = getDb();
 
-	try {
-		std::vector<TeBkUmLpqWorld> wlist;
-		sqli->executeQuery(WORLD_ALL_QUERY, NULL, &wlist, &TeBkUmLpqRouter::updateCacheUtil);
+	std::vector<TeBkUmLpqWorld> wlst;
 
-		for(std::vector<TeBkUmLpqWorld>::iterator it=wlist.begin(); it != wlist.end(); ++it) {
-			char str[12];
-			sprintf(str, "%d;%d", (*it).getId(), (*it).getRandomNumber());
-			cchi->setRaw(CastUtil::fromNumber((*it).getId()), str);
+	LibpqQuery q;
+	q.withSelectQuery(WORLD_ALL_QUERY, false).withContext(&wlst).withCb6([](void* ctx, int row, int col, char* value) {
+		std::vector<TeBkUmLpqWorld>* wlst = (std::vector<TeBkUmLpqWorld>*)ctx;
+		if(col==0) {
+			wlst->emplace_back(ntohl(*((uint32_t *) value)));
+		} else {
+			wlst->back().setRandomNumber(ntohl(*((uint32_t *) value)));
 		}
-		CacheManager::cleanImpl(cchi);
-		CacheManager::triggerAppInitCompletion();
-	} catch(const std::exception& e) {
-		CacheManager::cleanImpl(cchi);
-		throw e;
+	});
+	sqli->executeQuery(&q);
+
+	for(std::vector<TeBkUmLpqWorld>::iterator it=wlst.begin(); it != wlst.end(); ++it) {
+		char str[12];
+		sprintf(str, "%d;%d", (*it).getId(), (*it).getRandomNumber());
+		cchi->setRaw((*it).getId(), str);
 	}
-}
-void TeBkUmLpqRouter::updateCacheUtil(void* ctx, int rn, std::vector<LibpqRes>& data) {
-	std::vector<TeBkUmLpqWorld>* wlist = (std::vector<TeBkUmLpqWorld>*)ctx;
-	wlist->emplace_back(ntohl(*((uint32_t *) data.at(0).d)), ntohl(*((uint32_t *) data.at(1).d)));
+	CacheManager::cleanImpl(cchi);
+	CacheManager::triggerAppInitCompletion();
 }
 
 void TeBkUmLpqRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
-	strToNum(q, ql, queryCount);
-	if(queryCount<1)queryCount=1;
-	else if(queryCount>500)queryCount=500;
+	CommonUtils::fastStrToNum(q, ql, queryCount);
+	queryCount = std::max(1, std::min(queryCount, 500));
 
 	wlst.reserve(queryCount);
 
 	CacheInterface* cchi = CacheManager::getImpl();
 
-	try {
-		std::vector<std::string> keys, values;
-		for (int c = 0; c < queryCount; ++c) {
-			int rid = rand() % 10000 + 1;
-			keys.emplace_back(CastUtil::fromNumber(rid));
-		}
-		cchi->mgetRaw(keys, values);
-		for (int c = 0; c < queryCount; ++c) {
-			std::string& v = values.at(c);
-			size_t fn = v.find(";");
-			int tmp = 0;
-			strToNum(v.substr(0, fn).c_str(), fn, tmp);
-			int tmp1 = 0;
-			strToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1);
-			wlst.emplace_back(tmp, tmp1);
-		}
-		CacheManager::cleanImpl(cchi);
-	} catch(const std::exception& e) {
-		CacheManager::cleanImpl(cchi);
-		throw e;
+	std::vector<unsigned long long> keys;
+	for (int c = 0; c < queryCount; ++c) {
+		keys.emplace_back(CommonUtils::fastrand(g_seed) % 10000 + 1);
+	}
+	std::vector<std::string> values;
+	cchi->getValues(keys, values);
+	for (int c = 0; c < queryCount; ++c) {
+		std::string& v = values.at(c);
+		size_t fn = v.find(";");
+		int tmp = 0;
+		CommonUtils::fastStrToNum(v.substr(0, fn).c_str(), fn, tmp);
+		int tmp1 = 0;
+		CommonUtils::fastStrToNum(v.substr(fn+1).c_str(), v.length()-fn-1, tmp1);
+		wlst.emplace_back(tmp, tmp1);
 	}
+	CacheManager::cleanImpl(cchi);
 }
 
-void TeBkUmLpqRouter::handleTemplate(HttpResponse* res) {
+void TeBkUmLpqRouter::handleTemplate(HttpRequest* req, HttpResponse* res, SocketInterface* sif) {
 	LibpqDataSourceImpl* sqli = getDb();
 
-	try {
-		Context ctx;
-		std::list<TeBkUmLpqFortune> flst;
-		sqli->executeQuery(FORTUNE_ALL_QUERY, NULL, &flst, &TeBkUmLpqRouter::getContextUtil);
-
-		flst.emplace_back(0, "Additional fortune added at request time.");
-		flst.sort();
+	Context ctx;
+	std::list<TeBkUmLpqFortune> flst;
+
+	LibpqQuery q;
+	q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb0([](void* ctx, PGresult* res) {
+		std::list<TeBkUmLpqFortune>* flst = (std::list<TeBkUmLpqFortune>*)ctx;
+		int cols = PQnfields(res);
+		int rows = PQntuples(res);
+		for(int i=0; i<rows; i++) {
+			for (int j = 0; j < cols; ++j) {
+				if(j==0) {
+					flst->emplace_back(ntohl(*((uint32_t *) PQgetvalue(res, i, j))));
+				} else {
+					TeBkUmLpqFortune& w = flst->back();
+					w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)PQgetvalue(res, i, j), (size_t)PQgetlength(res, i, j), w.message_i, w.allocd);
+				}
+			}
+		}
+	});
+	sqli->executeQuery(&q);
 
-		ctx.insert(std::pair<std::string, void*>("fortunes", &flst));
+	flst.emplace_back(0, "Additional fortune added at request time.");
+	flst.sort();
 
-		fcpstream str;
-		tmplFunc(&ctx, str);
-		res->setContent(str.str());
-		res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	} catch(...) {
-		throw;
-	}
-}
-void TeBkUmLpqRouter::getContextUtil(void* ctx, int rn, int cn, char * d, int l) {
-	std::list<TeBkUmLpqFortune>* flst = (std::list<TeBkUmLpqFortune>*)ctx;
-	if(cn==0) {
-		flst->emplace_back(ntohl(*((uint32_t *) d)));
-	} else {
-		TeBkUmLpqFortune& w = flst->back();
-		w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)d, (size_t)l, w.message_i, w.allocd);
-	}
-}
+	ctx.emplace("fortunes", &flst);
 
-//https://stackoverflow.com/questions/9631225/convert-strings-specified-by-length-not-nul-terminated-to-int-float
-bool TeBkUmLpqRouter::strToNum(const char* str, int len, int& ret) {
-    ret = 0;
-    for(int i = 0; i < len; ++i)
-    {
-    	if(!isdigit(str[i])) return false;
-        ret = ret * 10 + (str[i] - '0');
-    }
-    return true;
+	fcpstream str;
+	tmplFunc(&ctx, str);
+	std::string out = str.str();
+	std::string h;
+	res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_HTML, req->getHttpVers(), req->isClose(), out.length());
+	sif->writeDirect(h, out);
 }
 
+//Do not use this class with non-embedded servers as it needs access to the underlying socket
+//and writes the response directly to the socket, use TeBkUmLpqRouterPicoV for all lang-server implementations
 bool TeBkUmLpqRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface* sif) {
+	std::string h;
 	if(StringUtil::endsWith(req->getPath(), "/plaintext")) {
-		res->setContent(HELLO_WORLD);
-		res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_TEXT_PLAIN, (int)HELLO_WORLD.length());
+		sif->writeDirect(h, HELLO_WORLD);
 	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
 		TeBkUmLpqMessage msg;
 		msg.setMessage(HELLO_WORLD);
 		JSONSerialize::serializeObject(&msg, m_ser, res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+		sif->writeDirect(h, res->getContent());
 	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
 		TeBkUmLpqWorld msg;
 		db(msg);
 		JSONSerialize::serializeObject(&msg, w_ser, res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
-	} else if(StringUtil::endsWith(req->getPath(), "/queries_old")) {
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
+	} else if(StringUtil::endsWith(req->getPath(), "/querie_")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		queries(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
 	} else if(StringUtil::endsWith(req->getPath(), "/queries")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		queriesMulti(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
 	} else if(StringUtil::endsWith(req->getPath(), "/fortunes")) {
-		handleTemplate(res);
-	} else if(StringUtil::endsWith(req->getPath(), "/bupdates")) {
+		handleTemplate(req, res, sif);
+	} else if(StringUtil::endsWith(req->getPath(), "/update_")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		updates(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
 	} else if(StringUtil::endsWith(req->getPath(), "/updates")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		updatesMulti(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
 	} else if(StringUtil::endsWith(req->getPath(), "/cached-worlds")) {
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		cachedWorlds(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
-		res->setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
+		res->httpStatus(HTTPResponseStatus::Ok).generateHeadResponse(h, ContentTypes::CONTENT_TYPE_APPLICATION_JSON, req->getHttpVers(), req->isClose());
+		sif->writeDirect(h, res->getContent());
 	} else {
-		res->setHTTPResponseStatus(HTTPResponseStatus::NotFound);
+		res->httpStatus(HTTPResponseStatus::NotFound).generateHeadResponse(h, req->getHttpVers(), true);
+		sif->writeDirect(h);
 	}
-	res->setDone(true);
-	return true;
+	return false;
 }
 
 TemplatePtr TeBkUmLpqRouter::tmplFunc;
@@ -533,3 +525,95 @@ LibpqDataSourceImpl* TeBkUmLpqRouter::getDb() {
 	}
 	return sqli;
 }
+
+TeBkUmLpqRouterPicoV::TeBkUmLpqRouterPicoV() {
+}
+
+TeBkUmLpqRouterPicoV::~TeBkUmLpqRouterPicoV() {
+}
+
+void TeBkUmLpqRouterPicoV::handleTemplate(HttpResponse* res) {
+	LibpqDataSourceImpl* sqli = getDb();
+
+	Context ctx;
+	std::list<TeBkUmLpqFortune> flst;
+
+	LibpqQuery q;
+	q.withSelectQuery(FORTUNE_ALL_QUERY).withContext(&flst).withCb5([](void* ctx, int rn, int cn, char * d, int l) {
+		std::list<TeBkUmLpqFortune>* flst = (std::list<TeBkUmLpqFortune>*)ctx;
+		if(cn==0) {
+			flst->emplace_back(ntohl(*((uint32_t *) d)));
+		} else {
+			TeBkUmLpqFortune& w = flst->back();
+			w.message = CryptoHandler::sanitizeHtmlFast((const uint8_t *)d, (size_t)l, w.message_i, w.allocd);
+		}
+	});
+	sqli->executeQuery(&q);
+
+
+	flst.emplace_back(0, "Additional fortune added at request time.");
+	flst.sort();
+
+	ctx.emplace("fortunes", &flst);
+
+	fcpstream str;
+	tmplFunc(&ctx, str);
+	res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML).setContent(str.str());
+}
+
+bool TeBkUmLpqRouterPicoV::route(HttpRequest *req, HttpResponse *res, SocketInterface *sif) {
+	if(StringUtil::endsWith(req->getPath(), "/plaintext")) {
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_TEXT_PLAIN).setContent(HELLO_WORLD);
+	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
+		TeBkUmLpqMessage msg;
+		msg.setMessage(HELLO_WORLD);
+		JSONSerialize::serializeObject(&msg, m_ser, res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
+		TeBkUmLpqWorld msg;
+		db(msg);
+		JSONSerialize::serializeObject(&msg, w_ser, res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/querie_")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		std::vector<TeBkUmLpqWorld> msg;
+		queries(params[0].val, params[0].val_len, msg);
+		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/queries")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		std::vector<TeBkUmLpqWorld> msg;
+		queriesMulti(params[0].val, params[0].val_len, msg);
+		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/fortunes")) {
+		handleTemplate(res);
+	} else if(StringUtil::endsWith(req->getPath(), "/update_")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		std::vector<TeBkUmLpqWorld> msg;
+		updates(params[0].val, params[0].val_len, msg);
+		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/updates")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		std::vector<TeBkUmLpqWorld> msg;
+		updatesMulti(params[0].val, params[0].val_len, msg);
+		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else if(StringUtil::endsWith(req->getPath(), "/cached-worlds")) {
+		struct yuarel_param params[1];
+		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
+		std::vector<TeBkUmLpqWorld> msg;
+		cachedWorlds(params[0].val, params[0].val_len, msg);
+		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
+		res->httpStatus(HTTPResponseStatus::Ok).setContentType(ContentTypes::CONTENT_TYPE_APPLICATION_JSON);
+	} else {
+		res->httpStatus(HTTPResponseStatus::NotFound);
+	}
+	res->setDone(true);
+	return true;
+}

+ 1 - 1
frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUm.cpp

@@ -260,7 +260,7 @@ bool TeBkUmRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface* s
 			fcpstream str;
 			tmplFunc(&ctx, str);
 			res->setContent(str.str());
-			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		}
 	} else if(StringUtil::endsWith(path, "/updates")) {

+ 19 - 19
frameworks/C++/treefrog/benchmark_config.json

@@ -3,63 +3,63 @@
   "tests": [{
     "default": {
       "json_url": "/json/json",
-      "db_url": "/world/random",
-      "query_url": "/world/queries/",
+      "db_url": "/world/prandom",
+      "query_url": "/world/pqueries/",
       "fortune_url": "/fortune/index",
-      "update_url": "/world/updates/",
+      "update_url": "/world/pupdates/",
       "plaintext_url": "/world/plain",
-      "cached_query_url": "/world/cached_queries/",
+      "cached_query_url": "/world/cached_pqueries/",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "MySQL",
+      "database": "Postgres",
       "framework": "treefrog",
       "language": "C++",
+      "flavor": "None",
       "orm": "Micro",
       "platform": "None",
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "treefrog-thread",
+      "display_name": "treefrog-postgres",
       "notes": "",
       "versus": ""
     },
-    "postgres": {
+    "mysql": {
       "json_url": "/json/json",
-      "db_url": "/world/prandom",
-      "query_url": "/world/pqueries/",
+      "db_url": "/world/random",
+      "query_url": "/world/queries/",
       "fortune_url": "/fortune/index",
-      "update_url": "/world/pupdates/",
+      "update_url": "/world/updates/",
       "plaintext_url": "/world/plain",
-      "cached_query_url": "/world/cached_pqueries/",
+      "cached_query_url": "/world/cached_queries/",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "Postgres",
+      "database": "MySQL",
       "framework": "treefrog",
       "language": "C++",
-      "flavor": "None",
       "orm": "Micro",
       "platform": "None",
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "treefrog-postgres",
+      "display_name": "treefrog-mysql",
       "notes": "",
       "versus": ""
     },
     "epoll": {
       "json_url": "/json/json",
-      "db_url": "/world/random",
-      "query_url": "/world/queries/",
+      "db_url": "/world/prandom",
+      "query_url": "/world/pqueries/",
       "fortune_url": "/fortune/index",
-      "update_url": "/world/updates/",
+      "update_url": "/world/pupdates/",
       "plaintext_url": "/world/plain",
-      "cached_query_url": "/world/cached_queries/",
+      "cached_query_url": "/world/cached_pqueries/",
       "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
-      "database": "MySQL",
+      "database": "Postgres",
       "framework": "treefrog",
       "language": "C++",
       "flavor": "None",

+ 19 - 19
frameworks/C++/treefrog/config.toml

@@ -4,6 +4,24 @@ name = "treefrog"
 [main]
 urls.plaintext = "/world/plain"
 urls.json = "/json/json"
+urls.db = "/world/prandom"
+urls.query = "/world/pqueries/"
+urls.update = "/world/pupdates/"
+urls.fortune = "/fortune/index"
+urls.cached_query = "/world/cached_pqueries/"
+approach = "Realistic"
+classification = "Fullstack"
+database = "Postgres"
+database_os = "Linux"
+os = "Linux"
+orm = "Micro"
+platform = "None"
+webserver = "None"
+versus = ""
+
+[mysql]
+urls.plaintext = "/world/plain"
+urls.json = "/json/json"
 urls.db = "/world/random"
 urls.query = "/world/queries/"
 urls.update = "/world/updates/"
@@ -37,7 +55,7 @@ platform = "None"
 webserver = "None"
 versus = "treefrog"
 
-[postgres]
+[epoll]
 urls.plaintext = "/world/plain"
 urls.json = "/json/json"
 urls.db = "/world/prandom"
@@ -54,21 +72,3 @@ orm = "Micro"
 platform = "None"
 webserver = "None"
 versus = ""
-
-[epoll]
-urls.plaintext = "/world/plain"
-urls.json = "/json/json"
-urls.db = "/world/random"
-urls.query = "/world/queries/"
-urls.update = "/world/updates/"
-urls.fortune = "/fortune/index"
-urls.cached_query = "/world/cached_queries/"
-approach = "Realistic"
-classification = "Fullstack"
-database = "MySQL"
-database_os = "Linux"
-os = "Linux"
-orm = "Micro"
-platform = "None"
-webserver = "None"
-versus = ""

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

@@ -246,12 +246,12 @@ Cache.SettingsFile=cache.ini
 
 # Specify the cache backend, such as 'sqlite', 'mongodb'
 # or 'redis'.
-Cache.Backend=redis
+Cache.Backend=sqlite
 
 # Probability of starting garbage collection (GC) for cache.
 # If 100 is specified, GC will be started at a rate of once per 100
 # sets. If 0 is specified, the GC never starts.
-Cache.GcProbability=10000
+Cache.GcProbability=100000
 
 # If true, enable LZ4 compression when storing data.
 Cache.EnableCompression=no

+ 1 - 2
frameworks/C++/treefrog/controllers/jsoncontroller.cpp

@@ -8,8 +8,7 @@ void JsonController::index()
 
 void JsonController::json()
 {
-    QVariantMap obj;
-    obj[QStringLiteral("message")] = "Hello, World!";
+    static QJsonObject obj {{"message", "Hello, World!"}};
     renderJson(obj);
 }
 

+ 3 - 4
frameworks/C++/treefrog/treefrog-epoll.dockerfile

@@ -2,7 +2,7 @@ FROM buildpack-deps:focal
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=1.31.1
+ENV TFVER=2.1.0
 
 RUN apt-get update -yqq && apt-get upgrade -yq && apt-get install -yqq --no-install-recommends \
     software-properties-common unzip wget make cmake gcc clang libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
@@ -31,11 +31,10 @@ RUN qmake -r CONFIG+=release -spec linux-clang
 
 # 2. Compile applicaton
 RUN make
-RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
+RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=epoll|g' config/application.ini
 
 EXPOSE 8080
 
 # 3. Start TreeFrog
-CMD service redis-server start && \
-    treefrog /workspace
+CMD treefrog /workspace

+ 3 - 4
frameworks/C++/treefrog/treefrog-mongodb.dockerfile

@@ -2,7 +2,7 @@ FROM buildpack-deps:focal
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=1.31.1
+ENV TFVER=2.1.0
 
 RUN apt-get update -yqq && apt-get upgrade -yq && apt-get install -yqq --no-install-recommends \
     software-properties-common unzip wget make cmake gcc clang libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
@@ -31,11 +31,10 @@ RUN qmake -r CONFIG+=release -spec linux-clang
 
 # 2. Compile applicaton
 RUN make
-RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
+RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 EXPOSE 8080
 
 # 3. Start TreeFrog
-CMD service redis-server start && \
-    treefrog /workspace
+CMD treefrog /workspace

+ 3 - 4
frameworks/C++/treefrog/treefrog-postgres.dockerfile → frameworks/C++/treefrog/treefrog-mysql.dockerfile

@@ -2,7 +2,7 @@ FROM buildpack-deps:focal
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=1.31.1
+ENV TFVER=2.1.0
 
 RUN apt-get update -yqq && apt-get upgrade -yq && apt-get install -yqq --no-install-recommends \
     software-properties-common unzip wget make cmake gcc clang libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
@@ -31,11 +31,10 @@ RUN qmake -r CONFIG+=release -spec linux-clang
 
 # 2. Compile applicaton
 RUN make
-RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
+RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 EXPOSE 8080
 
 # 3. Start TreeFrog
-CMD service redis-server start && \
-    treefrog /workspace
+CMD treefrog /workspace

+ 3 - 4
frameworks/C++/treefrog/treefrog.dockerfile

@@ -2,7 +2,7 @@ FROM buildpack-deps:focal
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
-ENV TFVER=1.31.1
+ENV TFVER=2.1.0
 
 RUN apt-get update -yqq && apt-get upgrade -yq && apt-get install -yqq --no-install-recommends \
     software-properties-common unzip wget make cmake gcc clang libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
@@ -31,11 +31,10 @@ RUN qmake -r CONFIG+=release -spec linux-clang
 
 # 2. Compile applicaton
 RUN make
-RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
+RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 EXPOSE 8080
 
 # 3. Start TreeFrog
-CMD service redis-server start && \
-    treefrog /workspace
+CMD treefrog /workspace

+ 2 - 2
frameworks/CSharp/appmpower/benchmark_config.json

@@ -38,7 +38,7 @@
         "webserver": "Kestrel",
         "os": "Linux",
         "database_os": "Linux",
-        "display_name": "appMpower [Middleware, Odbc, Pg]",
+        "display_name": "appMpower [Middleware, Pg, Odbc]",
         "notes": "",
         "versus": "aspcore-mw-ado-pg"
       },
@@ -59,7 +59,7 @@
         "webserver": "Kestrel",
         "os": "Linux",
         "database_os": "Linux",
-        "display_name": "appMpower [Middleware, Odbc, My]",
+        "display_name": "appMpower [Middleware, My, Odbc]",
         "notes": "",
         "versus": "aspcore-mw-ado-my"
       }

+ 2 - 2
frameworks/CSharp/appmpower/src/Db/PooledConnections.cs

@@ -10,7 +10,7 @@ namespace appMpower.Db
       private static short _createdConnections = 0;
 
 #if MYSQL
-      private static short _maxConnections = 1250; 
+      private static short _maxConnections = 500; 
 #else
       private static short _maxConnections = 500;
 #endif
@@ -85,4 +85,4 @@ namespace appMpower.Db
          }
       }
    }
-}
+}

+ 2 - 2
frameworks/Java/isocket-nio/pom.xml

@@ -97,8 +97,8 @@
                     <verbose>true</verbose>
                     <fork>true</fork>
                     <compilerArgument>-nowarn</compilerArgument>
-                    <source>1.7</source>
-                    <target>1.7</target>
+                    <source>11</source>
+                    <target>11</target>
                     <encoding>UTF-8</encoding>
                     <debug>false</debug>
                 </configuration>

+ 8 - 0
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/Consts.java

@@ -0,0 +1,8 @@
+package cn.ibaijia.tfb;
+
+public class Consts {
+
+    public static final byte[] TEXT_TYPE = "text/plain".getBytes();
+    public static final byte[] JSON_TYPE = "application/json".getBytes();
+
+}

+ 33 - 0
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/DateUtil.java

@@ -0,0 +1,33 @@
+package cn.ibaijia.tfb;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+public class DateUtil {
+
+    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);//Fri, 09 Jul 2021 09:10:42 UTC
+
+    private static byte[] date = ("\r\nDate:" + dateFormat.format(new Date())).getBytes();
+
+    public static byte[] getDate() {
+        return date;
+    }
+
+    public static void start() {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                while (true) {
+                    date = ("\r\nDate:" + dateFormat.format(new Date())).getBytes();
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+
+                    }
+                }
+            }
+        }).start();
+    }
+
+}

+ 7 - 4
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/HttpBootstrap.java

@@ -12,6 +12,7 @@ public class HttpBootstrap {
     private static final Logger logger = LoggerFactory.getLogger(HttpBootstrap.class);
 
     public static void main(String[] args) {
+        DateUtil.start();
         Server server = new Server("0.0.0.0", 8080);
         server.addProtocol(new SimpleHttpProtocol());
         server.setProcessor(new PlanTextProcessor());
@@ -23,10 +24,12 @@ public class HttpBootstrap {
         });
         int processorNumber = Runtime.getRuntime().availableProcessors();
         server.setThreadNumber(processorNumber);
-//        server.setUseDirectBuffer(true);
-        server.setPoolSize(16 * 1024);
-        server.setReadBuffSize(4 * 1024);
-        server.setBacklog(1024 * 8);
+        server.setUseDirectBuffer(true);
+        server.setReadFirst(true);
+        server.setUsePool(true);
+        server.setPoolPageSize(16 * 1024);
+        server.setBuffSize(1 * 1024);
+        server.setBacklog(1024 * 4);
         server.start();
     }
 

+ 9 - 2
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpEntity.java

@@ -4,7 +4,14 @@ public abstract class HttpEntity {
 
     public String charset = "UTF-8";
 
-    public abstract String getHeader(String name);
-    public abstract void setHeader(String name,String value);
+    public abstract byte[] getHeader(byte[] name);
+
+    public abstract byte[] getHeader(String name);
+
+    public abstract void setHeader(byte[] name, byte[] value);
+
+    public abstract void setContentType(String contentType);
+
+    public abstract void setContentType(byte[] contentType);
 
 }

+ 30 - 6
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpRequestEntity.java

@@ -1,19 +1,21 @@
 package cn.ibaijia.tfb.http;
 
+import cn.ibaijia.tfb.Consts;
+
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
 public class HttpRequestEntity extends HttpEntity {
 
 
-
     public ByteBuffer bodyBuffer = null;
     public boolean chunked = false;
     public int contentLength = -1;
     public int crNum = 0;
     public int lfNum = 0;
-    public String tmp;
+    public byte[] tmp;
 
 
     //请求行
@@ -24,17 +26,39 @@ public class HttpRequestEntity extends HttpEntity {
     //请求体
     public String body;
     //第一次 请求header时解析 第一行不要
-    private Map<String, String> headers = new HashMap<>();
+    private Map<byte[], byte[]> headers = new HashMap<>();
+    private byte[] contentType = Consts.TEXT_TYPE;
 
-    public String getHeader(String name) {
-        return this.headers.get(name);
+    @Override
+    public byte[] getHeader(byte[] name) {
+        for (Map.Entry<byte[], byte[]> entry : headers.entrySet()) {
+            if (Arrays.equals(entry.getKey(), name)) {
+                return entry.getValue();
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public byte[] getHeader(String name) {
+        return getHeader(name.getBytes());
     }
 
     @Override
-    public void setHeader(String name, String value) {
+    public void setHeader(byte[] name, byte[] value) {
         this.headers.put(name, value);
     }
 
+    @Override
+    public void setContentType(String contentType) {
+        this.contentType = contentType.getBytes();
+    }
+
+    @Override
+    public void setContentType(byte[] contentType) {
+        this.contentType = contentType;
+    }
+
     public void processBody() {
         bodyBuffer.flip();
         byte[] bytes = new byte[bodyBuffer.remaining()];

+ 64 - 25
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/http/HttpResponseEntity.java

@@ -1,54 +1,93 @@
 package cn.ibaijia.tfb.http;
 
+import cn.ibaijia.tfb.Consts;
+import cn.ibaijia.tfb.DateUtil;
+
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 public class HttpResponseEntity extends HttpEntity {
-    public static final String protocol = "HTTP/1.1";
-    public int statusCode = 200;
-    public String status = "OK";
+    private static final byte[] PROTOCOL = "HTTP/1.1 ".getBytes();
+    private static final byte[] STATUS_200 = "200 OK".getBytes();
+    private static final byte[] CRLF = "\r\n".getBytes();
+    private static final byte[] COLON = ":".getBytes();
+    private static final byte[] SERVER_NAME = "\r\nServer:tfb\r\n".getBytes();
+    private static final byte[] CONTENT_LENGTH_HEAD = "\r\nContent-Length:".getBytes();
+    private static final byte[] CONTENT_TYPE_HEAD = "\r\nContent-Type:".getBytes();
 
+    private byte[] contentType = Consts.TEXT_TYPE;
     //响应体
-    public String body = "";
+    public String body;
 
     //请求头 或者 响应头
-    public Map<String, String> headers = new HashMap<>();
+    public Map<byte[], byte[]> headers = new HashMap<>();
+
+    @Override
+    public byte[] getHeader(byte[] name) {
+        for (Map.Entry<byte[], byte[]> entry : headers.entrySet()) {
+            if (Arrays.equals(entry.getKey(), name)) {
+                return entry.getValue();
+            }
+        }
+        return null;
+    }
 
     @Override
-    public String getHeader(String name) {
-        return headers.get(name);
+    public byte[] getHeader(String name) {
+        return getHeader(name.getBytes());
     }
 
     @Override
-    public void setHeader(String name, String value) {
+    public void setHeader(byte[] name, byte[] value) {
         headers.put(name, value);
     }
 
-    public int getStatusCode() {
-        return statusCode;
+    @Override
+    public void setContentType(String contentType) {
+        this.contentType = contentType.getBytes();
     }
 
-    public void setStatusCode(int statusCode) {
-        this.statusCode = statusCode;
+    @Override
+    public void setContentType(byte[] contentType) {
+        this.contentType = contentType;
     }
 
-    public String getStatus() {
-        return status;
+    public ByteBuffer toBuffer(ByteBuffer byteBuffer) {
+        byteBuffer.put(PROTOCOL);
+        byteBuffer.put(STATUS_200);
+        byteBuffer.put(DateUtil.getDate());
+        byteBuffer.put(CONTENT_LENGTH_HEAD);
+        byteBuffer.put(String.valueOf(body.length()).getBytes());
+        byteBuffer.put(CONTENT_TYPE_HEAD);
+        byteBuffer.put(contentType);
+        byteBuffer.put(SERVER_NAME);
+        for (Map.Entry<byte[], byte[]> header : headers.entrySet()) {
+            byteBuffer.put(header.getKey());
+            byteBuffer.put(COLON);
+            byteBuffer.put(header.getValue());
+            byteBuffer.put(CRLF);
+        }
+        byteBuffer.put(CRLF);
+        byteBuffer.put(body.getBytes());
+        byteBuffer.flip();
+        return byteBuffer;
     }
 
-    public void setStatus(String status) {
-        this.status = status;
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        HttpResponseEntity that = (HttpResponseEntity) o;
+        return Objects.equals(body, that.body) &&
+                Objects.equals(headers, that.headers);
     }
 
-    public ByteBuffer toBuffer() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(protocol).append(" ").append(statusCode).append(" ").append(status).append("\r\n");
-        sb.append("Content-Length:").append(body.length()).append("\r\n");
-        for (Map.Entry<String, String> header : headers.entrySet()) {
-            sb.append(header.getKey()).append(":").append(header.getValue()).append("\r\n");
-        }
-        sb.append("\r\n").append(body);
-        return ByteBuffer.wrap(sb.toString().getBytes());
+    @Override
+    public int hashCode() {
+
+        return Objects.hash(body, headers);
     }
 }

+ 9 - 44
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/processor/PlanTextProcessor.java

@@ -2,9 +2,7 @@ package cn.ibaijia.tfb.processor;
 
 import cn.ibaijia.isocket.processor.Processor;
 import cn.ibaijia.isocket.session.Session;
-import cn.ibaijia.isocket.session.SessionManager;
-import cn.ibaijia.isocket.util.BufferPool;
-import cn.ibaijia.isocket.util.BufferState;
+import cn.ibaijia.tfb.Consts;
 import cn.ibaijia.tfb.http.HttpEntity;
 import cn.ibaijia.tfb.http.HttpRequestEntity;
 import cn.ibaijia.tfb.http.HttpResponseEntity;
@@ -12,62 +10,33 @@ import com.alibaba.fastjson.JSON;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.concurrent.locks.ReentrantLock;
-
 public class PlanTextProcessor implements Processor<HttpEntity> {
     private static final Logger logger = LoggerFactory.getLogger(PlanTextProcessor.class);
-    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);//Fri, 09 Jul 2021 09:10:42 UTC
-    private static final String SERVER_NAME = "isocket-nio-tfb";
-    private static final String TEXT_TYPE = "text/plain; charset=UTF-8";
-    private static final String JSON_TYPE = "application/json; charset=UTF-8";
-    private static ReentrantLock lock = new ReentrantLock();
-    private static String dateHeader = dateFormat.format(new Date());
-
-    private String getDateHeader() {
-        //TODO
-        if (lock.tryLock()) {
-            dateHeader = dateFormat.format(new Date());
-        }
-        return dateHeader;
-    }
 
     @Override
     public boolean process(final Session session, final HttpEntity httpEntity) {
         HttpRequestEntity httpRequestEntity = (HttpRequestEntity) httpEntity;
         String url = httpRequestEntity.url;
         logger.trace("url:{}", url);
-        if (url.equals("/plaintext")) {
+        if ("/plaintext".equals(url)) {
             HttpResponseEntity httpResponseEntity = new HttpResponseEntity();
-            httpResponseEntity.setHeader("Content-Type", TEXT_TYPE);
-            httpResponseEntity.setHeader("Server", SERVER_NAME);
-            httpResponseEntity.setHeader("Date", getDateHeader());
+            httpResponseEntity.setContentType(Consts.TEXT_TYPE);
             httpResponseEntity.body = "Hello, World!";
             session.write(httpResponseEntity);
-        } else if (url.equals("/json")) {
+        } else if ("/json".equals(url)) {
             HttpResponseEntity httpResponseEntity = new HttpResponseEntity();
-            httpResponseEntity.setHeader("Content-Type", JSON_TYPE);
-            httpResponseEntity.setHeader("Server", SERVER_NAME);
-            httpResponseEntity.setHeader("Date", getDateHeader());
+            httpResponseEntity.setContentType(Consts.JSON_TYPE);
             httpResponseEntity.body = JSON.toJSONString(new Message("Hello, World!"));
             session.write(httpResponseEntity);
-        } else if (url.equals("/state")) {
+        } else if ("/state".equals(url)) {
             HttpResponseEntity httpResponseEntity = new HttpResponseEntity();
-            httpResponseEntity.setHeader("Content-Type", JSON_TYPE);
-            httpResponseEntity.setHeader("Server", SERVER_NAME);
-            httpResponseEntity.setHeader("Date", getDateHeader());
+            httpResponseEntity.setContentType(Consts.JSON_TYPE);
             State state = new State();
-            state.sessionCount = SessionManager.getSessionCount();
-            state.bufferState = new BufferState();
             httpResponseEntity.body = JSON.toJSONString(state);
             session.write(httpResponseEntity);
         } else {
             HttpResponseEntity httpResponseEntity = new HttpResponseEntity();
-            httpResponseEntity.setHeader("Content-Type", TEXT_TYPE);
-            httpResponseEntity.setHeader("Server", SERVER_NAME);
-            httpResponseEntity.setHeader("Date", getDateHeader());
+            httpResponseEntity.setContentType(Consts.TEXT_TYPE);
             httpResponseEntity.body = "hi";
             session.write(httpResponseEntity);
         }
@@ -78,12 +47,8 @@ public class PlanTextProcessor implements Processor<HttpEntity> {
     public void processError(Session session, HttpEntity httpEntity, Throwable throwable) {
         logger.error("processError:", throwable);
         HttpResponseEntity httpResponseEntity = new HttpResponseEntity();
-        httpResponseEntity.setHeader("Content-Type", TEXT_TYPE);
-        httpResponseEntity.setHeader("Server", SERVER_NAME);
-        httpResponseEntity.setHeader("Date", getDateHeader());
+        httpResponseEntity.setContentType(Consts.TEXT_TYPE);
         httpResponseEntity.body = "hi";
-        httpResponseEntity.statusCode = 500;
-        httpResponseEntity.status = "Internal Server Error";
         session.write(httpResponseEntity);
     }
 }

+ 2 - 4
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/processor/State.java

@@ -1,10 +1,8 @@
 package cn.ibaijia.tfb.processor;
 
-import cn.ibaijia.isocket.util.BufferState;
-
 public class State {
 
-    public int sessionCount;
-    public BufferState bufferState;
+//    public int sessionCount;
+//    public BufferState bufferState;
 
 }

+ 31 - 36
frameworks/Java/isocket-nio/src/main/java/cn/ibaijia/tfb/protocol/SimpleHttpProtocol.java

@@ -9,14 +9,12 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.nio.ByteBuffer;
+import java.util.Arrays;
 
 public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
 
     private static final Logger logger = LoggerFactory.getLogger(SimpleHttpProtocol.class);
 
-    private static final String CONTENT_LENGTH = "CONTENT-LENGTH";
-    private static final String TRANSFER_ENCODING = "TRANSFER-ENCODING";
-    private static final String CHUNKED = "CHUNKED";
     private static final byte CR13 = (byte) 13; // \CR \r
     private static final byte LF10 = (byte) 10; // \LF \n
     private static final byte SPACE0 = (byte) 32; // \SP
@@ -40,22 +38,22 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
         }
 
         if (!httpEntity.headerComplete() && byteBuffer.hasRemaining()) { //解析header
-            readHeader(byteBuffer, session, httpEntity);
+            readHeader(byteBuffer, httpEntity);
         }
 
-        if (httpEntity.headerComplete() && httpEntity.bodyBuffer != null && byteBuffer.hasRemaining()) {// 解析body
-            readBody(byteBuffer, session, httpEntity);
-        }
-
-        if (httpEntity.complete()) {
-            session.setAttribute(httpEntityKey, null);
-            return httpEntity;
+        if (httpEntity.headerComplete()) {
+            if (httpEntity.complete()) {
+                session.setAttribute(httpEntityKey, null);
+                return httpEntity;
+            }
+            if (httpEntity.bodyBuffer != null && byteBuffer.hasRemaining()) { // 解析request body
+                readBody(byteBuffer, httpEntity);
+            }
         }
-
         return null;
     }
 
-    private void readHeader(ByteBuffer byteBuffer, Session session, HttpRequestEntity httpEntity) {
+    private void readHeader(ByteBuffer byteBuffer, HttpRequestEntity httpEntity) {
         try {
             ByteBuffer buf = byteBuffer.duplicate();
             int startPos = 0;
@@ -71,6 +69,11 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
                     httpEntity.crNum = 0;
                     httpEntity.lfNum = 0;
                 }
+
+                if (httpEntity.headerComplete()) {
+                    return;
+                }
+
                 if (httpEntity.isReadHeadLine()) {
                     if (b == SPACE0) {
                         int len = endPos - startPos - 1;
@@ -80,21 +83,16 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
                         buf.position(startPos);
                         if (httpEntity.method == null) {
                             httpEntity.method = new String(bytes);
-                            continue;
-                        }
-                        if (httpEntity.url == null) {
+                        } else if (httpEntity.url == null) {
                             httpEntity.url = new String(bytes);
-                            continue;
                         }
-                    }
-                    if (httpEntity.crNum == 1 && httpEntity.lfNum == 1) {
+                    } else if (httpEntity.crNum == 1 && httpEntity.lfNum == 1) {
                         int len = endPos - startPos - 2;
                         byte[] bytes = new byte[len];
                         buf.get(bytes, 0, len);
                         startPos = endPos;
                         buf.position(startPos);
                         httpEntity.protocol = new String(bytes);
-                        continue;
                     }
                 } else {
                     if (b == COLON && httpEntity.tmp == null) {
@@ -103,26 +101,23 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
                         buf.get(bytes, 0, len);
                         startPos = endPos;
                         buf.position(startPos);
-                        httpEntity.tmp = new String(bytes);
-                        continue;
-                    }
-                    if (httpEntity.crNum == 1 && httpEntity.lfNum == 1) {
+                        httpEntity.tmp = bytes;
+                    } else if (httpEntity.crNum == 1 && httpEntity.lfNum == 1) {
                         int len = endPos - startPos - 2;
                         byte[] bytes = new byte[len];
                         buf.get(bytes, 0, len);
                         startPos = endPos;
                         buf.position(startPos);
-                        String value = new String(bytes);
-                        httpEntity.setHeader(httpEntity.tmp, value);
+                        httpEntity.setHeader(httpEntity.tmp, bytes);
                         httpEntity.tmp = null;
-                        if (CONTENT_LENGTH.equals(httpEntity.tmp)) {
-                            httpEntity.contentLength = (value == null ? 0 : Integer.valueOf(value));
-                            httpEntity.bodyBuffer = ByteBuffer.allocate(httpEntity.contentLength);//TODO can pooling
-                        }
-                        if (CHUNKED.equals(httpEntity.tmp)) {
-                            httpEntity.chunked = true;
+//                        if (Arrays.equals(CONTENT_LENGTH, httpEntity.tmp)) {
+//                            httpEntity.contentLength = (value == null ? 0 : Integer.valueOf(value));
+//                            httpEntity.bodyBuffer = ByteBuffer.allocate(httpEntity.contentLength);//TODO can pooling
+//                        }
+//                        if (Arrays.equals(CHUNKED, httpEntity.tmp)) {
+//                            httpEntity.chunked = true;
 //                            throw new RuntimeException("not support chunked");
-                        }
+//                        }
                     }
                 }
             }
@@ -131,7 +126,7 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
         }
     }
 
-    private void readBody(ByteBuffer byteBuffer, Session session, HttpRequestEntity httpEntity) {
+    private void readBody(ByteBuffer byteBuffer, HttpRequestEntity httpEntity) {
         try {
             if (httpEntity.bodyBuffer.hasRemaining()) {
                 if (byteBuffer.remaining() <= httpEntity.bodyBuffer.remaining()) {
@@ -152,8 +147,8 @@ public class SimpleHttpProtocol implements Protocol<ByteBuffer, HttpEntity> {
 
     @Override
     public ByteBuffer encode(HttpEntity httpEntity, Session session) {
+        ByteBuffer byteBuffer = session.getHandler().getPooledByteBuff().get();
         HttpResponseEntity httpResponseEntity = (HttpResponseEntity) httpEntity;
-
-        return httpResponseEntity.toBuffer();
+        return httpResponseEntity.toBuffer(byteBuffer);
     }
 }

+ 4 - 4
frameworks/Java/officefloor/src/woof_benchmark_sqlclient/src/main/java/net/officefloor/benchmark/SqlClientOfficeFloorMain.java

@@ -130,7 +130,7 @@ public class SqlClientOfficeFloorMain implements DatabaseOperations {
 		// Nothing thread specific to set up
 	}
 
-	private static final int DB_COUNT = 1;
+	private static final int DB_COUNT = 2;
 
 	@Override
 	public void db(DbSendResponse sender) {
@@ -152,7 +152,7 @@ public class SqlClientOfficeFloorMain implements DatabaseOperations {
 				});
 	}
 
-	private static final int QUERIES_COUNT = 1;
+	private static final int QUERIES_COUNT = 2;
 
 	@Override
 	public void queries(int queryCount, QueriesSendResponse sender) {
@@ -202,7 +202,7 @@ public class SqlClientOfficeFloorMain implements DatabaseOperations {
 				});
 	}
 
-	private static final int UPDATE_COUNT = 1;
+	private static final int UPDATE_COUNT = 2;
 
 	@Override
 	public void update(int queryCount, UpdateSendResponse sender) {
@@ -263,4 +263,4 @@ public class SqlClientOfficeFloorMain implements DatabaseOperations {
 		throw new UnsupportedOperationException("/cached-worlds test not supported");
 	}
 
-}
+}

+ 9 - 2
frameworks/Java/redkale/benchmark_config.json

@@ -24,6 +24,10 @@
             "graalvm": {
                 "plaintext_url": "/plaintext",
                 "json_url": "/json",
+                "db_url": "/db",
+                "query_url": "/queries?q=", 
+                "fortune_url": "/fortunes",
+                "update_url": "/updates?q=",
                 "cached_query_url": "/cached-worlds?q=",
                 "port": 8080,
                 "approach": "Realistic",
@@ -44,6 +48,9 @@
             "native": {
                 "plaintext_url": "/plaintext",
                 "json_url": "/json",
+                "db_url": "/db",
+                "query_url": "/queries?q=", 
+                "update_url": "/updates?q=",
                 "cached_query_url": "/cached-worlds?q=",
                 "port": 8080,
                 "approach": "Realistic",
@@ -81,9 +88,9 @@
             },
             "postgres": {
                 "db_url": "/db",
-                "query_url2": "/queries?q=", 
+                "query_url": "/queries?q=", 
                 "fortune_url": "/fortunes",
-                "update_url2": "/updates?q=",
+                "update_url": "/updates?q=",
                 "port": 8080,
                 "approach": "Realistic",
                 "classification": "Fullstack",

+ 9 - 5
frameworks/Java/redkale/conf/application.xml

@@ -5,12 +5,16 @@
     <resources>
         <executor threads="0"/>
         <properties>    
-            <property name="system.property.convert.tiny" value="false"/>      
+            <property name="system.property.vertx.threadChecks" value="false"/> 
+            <property name="system.property.vertx.disableTCCL" value="true"/> 
+            <property name="system.property.vertx.disableMetrics" value="true"/> 
+            <property name="system.property.vertx.disableContextTimings" value="true"/> 
+            
+            <property name="system.property.redkale.convert.tiny" value="false"/>      
             <property name="system.property.redkale.skip.counter" value="true"/>  
-            <property name="system.property.net.invoker.max.onstack" value="24"/>
-            <property name="system.property.http.request.pipeline.sameheaders" value="true"/>  
-            <property name="system.property.http.response.header.server" value="redkale"/>
-            <property name="system.property.http.response.header.connection" value="none"/>
+            <property name="system.property.redkale.http.request.pipeline.sameheaders" value="true"/>  
+            <property name="system.property.redkale.http.response.header.server" value="redkale"/>
+            <property name="system.property.redkale.http.response.header.connection" value="none"/>
         </properties>
     </resources> 
         

+ 0 - 2
frameworks/Java/redkale/conf/persistence.xml

@@ -6,7 +6,6 @@
         <properties>
             <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://tfb-database:5432/hello_world"/>
             <property name="javax.persistence.jdbc.preparecache" value="true"/>
-            <property name="javax.persistence.connections.limit" value="512"/>
             <property name="javax.persistence.jdbc.user" value="benchmarkdbuser"/>
             <property name="javax.persistence.jdbc.password" value="benchmarkdbpass"/>
         </properties>
@@ -17,7 +16,6 @@
         <properties>
             <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://tfb-database:5432/hello_world"/>
             <property name="javax.persistence.jdbc.preparecache" value="true"/>
-            <property name="javax.persistence.connections.limit" value="512"/>
             <property name="javax.persistence.jdbc.user" value="benchmarkdbuser"/>
             <property name="javax.persistence.jdbc.password" value="benchmarkdbpass"/>
         </properties>

+ 7 - 0
frameworks/Java/redkale/config.toml

@@ -17,6 +17,10 @@ versus = "Redkale"
 [graalvm]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
+urls.db = "/db"
+urls.fortune = "/fortunes"
+urls.query = "/queries?q="
+urls.update = "/updates?q="
 urls.cached_query = "/cached-worlds?q="
 approach = "Realistic"
 classification = "Fullstack"
@@ -31,6 +35,9 @@ versus = "Redkale"
 [native]
 urls.plaintext = "/plaintext"
 urls.json = "/json"
+urls.db = "/db"
+urls.query = "/queries?q="
+urls.update = "/updates?q="
 urls.cached_query = "/cached-worlds?q="
 approach = "Realistic"
 classification = "Fullstack"

+ 152 - 0
frameworks/Java/redkale/pom-native.xml

@@ -0,0 +1,152 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.redkalex</groupId>
+    <artifactId>redkale-benchmark</artifactId>
+    <version>1.0.0</version>
+
+    <properties>
+        <!-- the main class -->
+        <main.class>org.redkale.boot.Application</main.class>
+        <stack.version>1.0.0</stack.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>
+    </properties> 
+
+    <dependencies>  
+        <dependency>
+            <groupId>org.redkale</groupId>
+            <artifactId>redkale</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.redkalex</groupId>
+            <artifactId>redkale-plugins</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency> 
+            <groupId>com.fizzed</groupId>
+            <artifactId>rocker-compiler</artifactId>
+            <version>1.3.0</version>
+        </dependency> 
+        <!--
+        <dependency> 
+            <groupId>io.vertx</groupId>
+            <artifactId>vertx-pg-client</artifactId>
+            <version>4.1.2</version>
+        </dependency> 
+        -->
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>central</id>
+            <name>Central Repository</name>
+            <url>https://repo.maven.apache.org/maven2</url>
+        </repository>
+        <repository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+        </repository>
+    </repositories>
+    
+    <pluginRepositories>
+        <pluginRepository>
+            <id>central</id>
+            <name>Central Repository</name>
+            <url>https://repo.maven.apache.org/maven2</url>
+        </pluginRepository>
+        <pluginRepository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository> 
+    </pluginRepositories>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.0</version>                         
+            </plugin>
+                 
+            <plugin>
+                <groupId>org.redkale.maven.plugins</groupId>
+                <artifactId>redkale-maven-plugin</artifactId>
+                <version>1.0.0-SNAPSHOT</version>                                                
+                <configuration>		
+                    <nativeimageArgs>
+                        <arg>--allow-incomplete-classpath</arg>
+                        <arg>--no-fallback</arg>
+                    </nativeimageArgs>
+                </configuration>                                    
+                <executions>
+                    <execution>
+                        <id>redkale-compile</id> 
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>                   
+                    </execution>
+                </executions>    
+            </plugin>
+                 
+            <plugin>
+                <groupId>com.fizzed</groupId>
+                <artifactId>rocker-maven-plugin</artifactId>
+                <version>1.3.0</version>
+                <executions>
+                    <execution>
+                        <id>generate-rocker-templates</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <javaVersion>1.8</javaVersion>
+                            <templateDirectory>${basedir}/src/main/templates</templateDirectory>
+                            <outputDirectory>${basedir}/target/generated-sources/rocker</outputDirectory>
+                            <discardLogicWhitespace>false</discardLogicWhitespace>
+                            <addAsSources>true</addAsSources>
+                            <optimize>true</optimize>
+                            <failOnError>true</failOnError>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.2.0</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>${main.class}</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+</project>

+ 27 - 1
frameworks/Java/redkale/pom.xml

@@ -33,10 +33,36 @@
             <version>1.3.0</version>
         </dependency> 
         
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-all</artifactId>
+            <version>4.1.65.Final</version>
+        </dependency>
+        <!--
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-transport-native-epoll</artifactId>
+            <version>4.1.65.Final</version>
+            <classifier>linux-x86_64</classifier>
+        </dependency>
+        
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-transport-native-kqueue</artifactId>
+            <version>4.1.65.Final</version>
+            <classifier>osx-x86_64</classifier>
+        </dependency>
+        -->
         <dependency> 
             <groupId>io.vertx</groupId>
             <artifactId>vertx-pg-client</artifactId>
-            <version>4.1.2</version>
+            <version>3.9.2</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.netty</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency> 
     </dependencies>
 

+ 1 - 1
frameworks/Java/redkale/redkale-native.dockerfile

@@ -2,7 +2,7 @@ FROM maven:3.6.3-openjdk-16-slim as maven
 WORKDIR /redkale
 COPY src src
 COPY conf conf
-COPY pom.xml pom.xml
+COPY pom-native.xml pom.xml
 RUN mvn package -q
 
 

+ 11 - 11
frameworks/Java/redkale/src/main/java/org/redkalex/benchmark/Service.java

@@ -5,6 +5,8 @@
  */
 package org.redkalex.benchmark;
 
+import com.fizzed.rocker.RockerOutput;
+import com.fizzed.rocker.runtime.ArrayOfByteArraysOutput;
 import java.util.Random;
 import java.util.concurrent.*;
 import javax.annotation.Resource;
@@ -23,8 +25,6 @@ public class Service extends AbstractService {
 
     private static final byte[] helloBytes = "Hello, world!".getBytes();
 
-    private static final boolean cached = Boolean.getBoolean("benchmarks.cache");
-
     private final ThreadLocal<RedRandom> rands = ThreadLocal.withInitial(() -> new RedRandom());
 
     @Resource
@@ -44,7 +44,7 @@ public class Service extends AbstractService {
 
     @RestMapping(name = "db")
     public CompletableFuture<World> findWorldAsync(ChannelContext context) {
-        return source.findAsync(World.class, context, 1 + randomInt(ThreadLocalRandom.current(), 10000));
+        return source.findAsync(World.class, context, randomId(rands.get()));
     }
 
     @RestMapping(name = "queries")
@@ -55,7 +55,7 @@ public class Service extends AbstractService {
         final CompletableFuture[] futures = new CompletableFuture[size];
         for (int i = 0; i < size; i++) {
             final int index = i;
-            futures[index] = source.findAsync(World.class, context, 1 + randomInt(random, 10000)).thenAccept(v -> worlds[index] = v);
+            futures[index] = source.findAsync(World.class, context, randomId(random)).thenAccept(v -> worlds[index] = v);
         }
         return CompletableFuture.allOf(futures).thenApply(v -> worlds);
     }
@@ -68,17 +68,17 @@ public class Service extends AbstractService {
         final CompletableFuture[] futures = new CompletableFuture[size];
         for (int i = 0; i < size; i++) {
             final int index = i;
-            futures[index] = source.findAsync(World.class, context, 1 + randomInt(random, 10000)).thenAccept(v -> worlds[index] = v.randomNumber(1 + randomInt(random, 10000)));
+            futures[index] = source.findAsync(World.class, context, randomId(random)).thenAccept(v -> worlds[index] = v.randomNumber(randomId(random)));
         }
         return CompletableFuture.allOf(futures).thenCompose(v -> source.updateAsync(context, World.sort(worlds))).thenApply(v -> worlds);
     }
 
     @RestMapping(name = "fortunes")
-    public CompletableFuture<HttpResult<String>> queryFortunes() {
+    public CompletableFuture<HttpResult<byte[]>> queryFortunes() {
         return source.queryListAsync(Fortune.class).thenApply((fortunes) -> {
             fortunes.add(new Fortune(0, "Additional fortune added at request time."));
-            String html = FortunesTemplate.template(Fortune.sort(fortunes)).render().toString();
-            return new HttpResult("text/html; charset=utf-8", html);
+            RockerOutput out = FortunesTemplate.template(Fortune.sort(fortunes)).render();
+            return new HttpResult("text/html; charset=utf-8", ((ArrayOfByteArraysOutput) out).toByteArray());
         });
     }
 
@@ -90,12 +90,12 @@ public class Service extends AbstractService {
             }
         }
         final int size = Math.min(500, Math.max(1, q));
-        return cache.random(ThreadLocalRandom.current(), size);
+        return cache.random(rands.get(), size);
     }
 
-    protected int randomInt(Random rand, int bound) {
+    protected int randomId(Random rand) {
         long s = rand.nextLong();
-        return (int) ((s < 0 ? -s : s) % bound);
+        return (int) ((s < 0 ? -s : s) % 10000) + 1;
     }
 
 }

+ 11 - 1
frameworks/Java/simple-server/pom.xml

@@ -18,7 +18,10 @@
 		<mainClass>com.simplyti.cloud.server.benchmark.Main</mainClass>
 
 		<!-- Simple Server -->
-		<simple-server.version>0.0.4-rc3</simple-server.version>
+		<simple-server.version>0.0.5-rc1</simple-server.version>
+		
+		<!-- Guava -->
+		<guava.version>30.1.1-jre</guava.version>
 		
 		<!-- Lombok -->
 		<lombok.version>1.18.4</lombok.version>
@@ -89,6 +92,13 @@
 			<artifactId>simple-server-di-guice</artifactId>
 			<version>${simple-server.version}</version>
 		</dependency>
+		
+		<!-- Guava -->
+		<dependency>
+		    <groupId>com.google.guava</groupId>
+		    <artifactId>guava</artifactId>
+		    <version>${guava.version}</version>
+		</dependency>
 
 		<!-- Logging -->
 		<dependency>

+ 6 - 3
frameworks/Java/wildfly-ee/pom.xml

@@ -14,6 +14,9 @@
 		<version.compiler.plugin>3.8.1</version.compiler.plugin>
 		<version.war.plugin>3.3.1</version.war.plugin>
 		<version.javaee.api>8.0</version.javaee.api>
+		<version.wildfly.bootable>24.0.1.Final</version.wildfly.bootable>
+		<version.wildfly.maven.jar.plugin>5.0.2.Final</version.wildfly.maven.jar.plugin>
+		<version.wildfly.galleon.datasources.feature.pack>2.0.3.Final</version.wildfly.galleon.datasources.feature.pack>
 	</properties>
 
 	<dependencies>
@@ -66,16 +69,16 @@
 					<plugin>
 						<groupId>org.wildfly.plugins</groupId>
 						<artifactId>wildfly-jar-maven-plugin</artifactId>
-						<version>4.0.0.Final</version>
+						<version>${version.wildfly.maven.jar.plugin}</version>
 						<configuration>
 							<feature-packs>
 								<feature-pack>
-									<location>wildfly@maven(org.jboss.universe:community-universe)#23.0.0.Final</location>
+									<location>wildfly@maven(org.jboss.universe:community-universe)#${version.wildfly.bootable}</location>
 								</feature-pack>
 								<feature-pack>
 									<groupId>org.wildfly</groupId>
 									<artifactId>wildfly-datasources-galleon-pack</artifactId>
-									<version>1.2.3.Final</version>
+									<version>${version.wildfly.galleon.datasources.feature.pack}</version>
 								</feature-pack>
 							</feature-packs>
 							<layers>

+ 1 - 1
frameworks/Java/wildfly-ee/wildfly-ee.dockerfile

@@ -6,4 +6,4 @@ COPY src src
 COPY scripts scripts
 COPY pom.xml pom.xml
 RUN mvn clean package -P bootable-jar
-CMD java -Djava.net.preferIPv4Stack=true -Xmx24g -XX:+UseZGC -jar target/wildfly-ee-bootable.jar
+CMD java -Djava.net.preferIPv4Stack=true -XX:SoftMaxHeapSize=18g -Xmx24g -XX:+UseZGC -jar target/wildfly-ee-bootable.jar

+ 1 - 1
frameworks/JavaScript/express/README.md

@@ -12,7 +12,7 @@ This is the Express portion of a [benchmarking test suite](../) comparing a vari
 
 ## Infrastructure Software Versions
 The tests were run with:
-* [Node.js v14.15.0](http://nodejs.org/)
+* [Node.js v14.17.5](http://nodejs.org/)
 * [Express 4.17.1](http://expressjs.com/)
 
 ## Resources

+ 1 - 1
frameworks/JavaScript/express/express-mongodb.dockerfile

@@ -1,4 +1,4 @@
-FROM node:14.17.3-slim
+FROM node:14.17.5-slim
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/express/express-mysql.dockerfile

@@ -1,4 +1,4 @@
-FROM node:14.17.3-slim
+FROM node:14.17.5-slim
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/express/express-postgres.dockerfile

@@ -1,4 +1,4 @@
-FROM node:14.17.3-slim
+FROM node:14.17.5-slim
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/express/express.dockerfile

@@ -1,4 +1,4 @@
-FROM node:14.17.3-slim
+FROM node:14.17.5-slim
 
 COPY ./ ./
 

+ 1 - 1
frameworks/JavaScript/nodejs/README.md

@@ -16,7 +16,7 @@ The server is currently in Alpha state, but aims to be a drop-in replacement for
 
 ## Infrastructure Software Versions
 The tests were run with:
-* [Node.js v14.17.1](http://nodejs.org/)
+* [Node.js v14.17.5](http://nodejs.org/)
 
 * [Node MySQL 2.16.0](https://github.com/felixge/node-mysql/)
 * [Sequelize 5.15.1](https://github.com/sequelize/sequelize)

+ 1 - 1
frameworks/JavaScript/nodejs/nodejs.dockerfile

@@ -1,4 +1,4 @@
-FROM node:14.17.1-slim
+FROM node:14.17.5-slim
 
 ARG TFB_TEST_NAME
 

+ 1 - 4
frameworks/Kotlin/hexagon/README.md

@@ -18,10 +18,7 @@ You can run tests against any running server passing the `verify.endpoint` proje
 
 ## Test URLs
 
-In URLs replace `${DB_ENGINE}` with one of:
-
-* mongodb
-* postgresql
+In URLs replace `${DB_ENGINE}` with: `postgresql`
 
 and `${TEMPLATE_ENGINE}` with: `pebble`
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.