Browse Source

Merge branch 'TechEmpower:master' into master

Jeremy Kuhn 3 years ago
parent
commit
c76b94e3f4
100 changed files with 3304 additions and 1586 deletions
  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. 39 0
      frameworks/C++/suil/README.md
  62. 1 0
      frameworks/C++/suil/benchmark/.gitattributes
  63. 78 0
      frameworks/C++/suil/benchmark/.gitignore
  64. 13 0
      frameworks/C++/suil/benchmark/3rdParty.cmake
  65. 35 0
      frameworks/C++/suil/benchmark/CMakeLists.txt
  66. 4 0
      frameworks/C++/suil/benchmark/cmake/Config.cmake.in
  67. 17 0
      frameworks/C++/suil/benchmark/src/app.scc
  68. 155 0
      frameworks/C++/suil/benchmark/src/main.cpp
  69. 29 0
      frameworks/C++/suil/benchmark_config.json
  70. 11 0
      frameworks/C++/suil/scripts/build.sh
  71. 22 0
      frameworks/C++/suil/scripts/download-framework.sh
  72. 18 0
      frameworks/C++/suil/suil.dockerfile
  73. 19 19
      frameworks/C++/treefrog/benchmark_config.json
  74. 19 19
      frameworks/C++/treefrog/config.toml
  75. 2 2
      frameworks/C++/treefrog/config/application.ini
  76. 1 2
      frameworks/C++/treefrog/controllers/jsoncontroller.cpp
  77. 3 4
      frameworks/C++/treefrog/treefrog-epoll.dockerfile
  78. 3 4
      frameworks/C++/treefrog/treefrog-mongodb.dockerfile
  79. 3 4
      frameworks/C++/treefrog/treefrog-mysql.dockerfile
  80. 3 4
      frameworks/C++/treefrog/treefrog.dockerfile
  81. 2 2
      frameworks/CSharp/appmpower/benchmark_config.json
  82. 2 2
      frameworks/CSharp/appmpower/src/Db/PooledConnections.cs
  83. 10 2
      frameworks/CSharp/aspnetcore-corert/PlatformBenchmarks/PlatformBenchmarks.csproj
  84. 31 0
      frameworks/CSharp/aspnetcore/Benchmarks.sln
  85. 4 5
      frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj
  86. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesDapperMiddleware.cs
  87. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesEfMiddleware.cs
  88. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesRawMiddleware.cs
  89. 3 8
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesDapperMiddleware.cs
  90. 3 8
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesEfMiddleware.cs
  91. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesRawMiddleware.cs
  92. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryDapperMiddleware.cs
  93. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryEfMiddleware.cs
  94. 3 7
      frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryRawMiddleware.cs
  95. 5 10
      frameworks/CSharp/aspnetcore/Benchmarks/Startup.cs
  96. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.json
  97. 1 1
      frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.updates.json
  98. 1 1
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.Caching.cs
  99. 1 41
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.HttpConnection.cs
  100. 2 3
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.Json.cs

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

@@ -7,6 +7,7 @@ export CUTELYST_VER=3.1.0
 apt update -qq && \
 apt update -qq && \
     apt install -yqq --no-install-recommends \
     apt install -yqq --no-install-recommends \
     cmake \
     cmake \
+    git \
     pkg-config \
     pkg-config \
     qtbase5-dev \
     qtbase5-dev \
     libqt5sql5-mysql \
     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)
 project(cutelyst_benchmarks LANGUAGES CXX)
 
 
 cmake_policy(SET CMP0069 NEW)
 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(Qt5 5.6.0 REQUIRED COMPONENTS Core Network Sql)
 find_package(ASqlQt5 0.43.0 REQUIRED)
 find_package(ASqlQt5 0.43.0 REQUIRED)
 find_package(Cutelyst3Qt5 3.1 REQUIRED)
 find_package(Cutelyst3Qt5 3.1 REQUIRED)
 find_package(Cutelee6Qt5 6.0.0 REQUIRED)
 find_package(Cutelee6Qt5 6.0.0 REQUIRED)
 find_package(PostgreSQL REQUIRED)
 find_package(PostgreSQL REQUIRED)
-find_package(mimalloc 1.0)
 
 
 # Auto generate moc files
 # Auto generate moc files
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTOMOC ON)
@@ -69,6 +77,7 @@ target_link_libraries(cutelyst-benchmarks
     Qt5::Network
     Qt5::Network
     Qt5::Sql
     Qt5::Sql
     ASqlQt5::Core
     ASqlQt5::Core
+    mimalloc
 )
 )
 if (mimalloc_FOUND)
 if (mimalloc_FOUND)
     target_link_libraries(cutelyst-benchmarks PUBLIC mimalloc)
     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());
         fortunes.reserve(result.size());
         auto it = result.begin();
         auto it = result.begin();
         while (it != result.end()) {
         while (it != result.end()) {
-            fortunes.push_back({it[0].toInt(), it[1].toString()});
+            fortunes.emplace_back(Fortune{it[0].toInt(), it[1].toString()});
             ++it;
             ++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) {
         std::sort(fortunes.begin(), fortunes.end(), [] (const Fortune &a1, const Fortune &a2) {
             return a1.message < a2.message;
             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
 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);
     out.reserve(4096);
 
 
     for (const Fortune &fortune : fortunes) {
     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();
     auto response = c->response();
     response->setBody(out);
     response->setBody(out);

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

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

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

@@ -1,121 +1,24 @@
 {
 {
 	"framework": "ffead-cpp",
 	"framework": "ffead-cpp",
 	"tests": [{
 	"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
-			"database": "mongodb",
+			"database": "postgres",
 			"framework": "ffead-cpp",
 			"framework": "ffead-cpp",
 			"language": "C++",
 			"language": "C++",
-			"orm": "Full",
+			"orm": "Raw",
 			"platform": "None",
 			"platform": "None",
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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": "",
 			"versus": "",
 			"tags": []
 			"tags": []
 		},
 		},
@@ -138,7 +41,7 @@
 			"webserver": "picov",
 			"webserver": "picov",
 			"os": "Linux",
 			"os": "Linux",
 			"database_os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov",
+			"display_name": "v",
 			"notes": "",
 			"notes": "",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"tags": []
@@ -162,7 +65,7 @@
 			"webserver": "picov",
 			"webserver": "picov",
 			"os": "Linux",
 			"os": "Linux",
 			"database_os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov-raw-profiled",
+			"display_name": "v-prof",
 			"notes": "",
 			"notes": "",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"tags": []
@@ -186,61 +89,16 @@
 			"webserver": "picov",
 			"webserver": "picov",
 			"os": "Linux",
 			"os": "Linux",
 			"database_os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-v-picov-raw-clibpqb-profiled",
+			"display_name": "v-prof-b",
 			"notes": "",
 			"notes": "",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"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",
 			"db_url": "/te-benchmark-um-pq/db",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
 			"update_url": "/te-benchmark-um-pq/updates?queries=",
 			"update_url": "/te-benchmark-um-pq/updates?queries=",
-			"cached_query_url": "/te-benchmark-um-pq/cached-worlds?count=",
 			"port": 8080,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
@@ -252,12 +110,12 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_os": "Linux",
 			"database_os": "Linux",
-			"display_name": "ffead-cpp-postgresql-raw",
-			"notes": "memory",
+			"display_name": "pg-raw-prof",
+			"notes": "memory profiled",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"tags": []
 		},
 		},
-		"postgresql-raw-profiled": {
+		"postgresql-raw-clibpqb-profiled": {
 			"db_url": "/te-benchmark-um-pq/db",
 			"db_url": "/te-benchmark-um-pq/db",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"query_url": "/te-benchmark-um-pq/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
 			"fortune_url": "/te-benchmark-um-pq/fortunes",
@@ -273,16 +131,16 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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": "",
 			"versus": "",
 			"tags": []
 			"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
@@ -294,19 +152,16 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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": "",
 			"versus": "",
 			"tags": []
 			"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",
 			"db_url": "/te-benchmark-um-pq-async/db",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
 			"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
@@ -318,16 +173,14 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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": "",
 			"versus": "",
 			"tags": []
 			"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
@@ -339,7 +192,7 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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",
 			"notes": "async memory profiled",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"tags": []
@@ -348,7 +201,7 @@
 			"db_url": "/te-benchmark-um-pq-async/db",
 			"db_url": "/te-benchmark-um-pq-async/db",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"query_url": "/te-benchmark-um-pq-async/queries?queries=",
 			"fortune_url": "/te-benchmark-um-pq-async/fortunes",
 			"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
@@ -360,80 +213,20 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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",
 			"notes": "async memory libpq batch patch profiled",
 			"versus": "",
 			"versus": "",
 			"tags": []
 			"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,
 			"port": 8080,
 			"approach": "Realistic",
 			"approach": "Realistic",
 			"classification": "Fullstack",
 			"classification": "Fullstack",
-			"database": "mongodb",
+			"database": "postgres",
 			"framework": "ffead-cpp",
 			"framework": "ffead-cpp",
 			"language": "C++",
 			"language": "C++",
 			"orm": "Raw",
 			"orm": "Raw",
@@ -441,299 +234,10 @@
 			"webserver": "ffead-cpp",
 			"webserver": "ffead-cpp",
 			"os": "Linux",
 			"os": "Linux",
 			"database_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": "",
 			"versus": "",
 			"tags": []
 			"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 maintainer="Sumeet Chhetri"
 LABEL version="6.0-debug"
 LABEL version="6.0-debug"
 LABEL description="Base ffead-cpp docker image with commit id - master"
 LABEL description="Base ffead-cpp docker image with commit id - master"
@@ -9,7 +9,6 @@ ENV DEBUG=on
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
 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/ /installs/te-benchmark-um/
 COPY te-benchmark-um-pq/ /installs/te-benchmark-um-pq/
 COPY te-benchmark-um-pq/ /installs/te-benchmark-um-pq/
 COPY te-benchmark-um-mgr/ /installs/te-benchmark-um-mgr/
 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}
 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}/
 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 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
 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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/libinter.so /usr/local/lib/libinter.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \
 	ln -s ${IROOT}/ffead-cpp-6.0/lib/libdinter.so /usr/local/lib/libdinter.so && \
 	ldconfig
 	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
 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
 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 /
 WORKDIR /

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

@@ -4,7 +4,6 @@ ENV IROOT=/installs
 
 
 ENV DEBIAN_FRONTEND noninteractive
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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}/
 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 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
 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 && \
 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-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/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/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
 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 && \
 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-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/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/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 maintainer="Sumeet Chhetri"
 LABEL version="6.0"
 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
 WORKDIR /tmp
 RUN mkdir postgresql
 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 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 -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
 RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /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 mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
@@ -93,6 +79,28 @@ ENV accept accept
 
 
 WORKDIR ${IROOT}
 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}/
 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 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
 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 maintainer="Sumeet Chhetri"
 LABEL version="6.0"
 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
 WORKDIR /tmp
 RUN mkdir postgresql
 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 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 -R -p /var/lib/postgresql/${PG_VERSION}/main /ssd/postgresql
 RUN cp /etc/postgresql/${PG_VERSION}/main/postgresql.conf /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 mv 60-postgresql-shm.conf /etc/sysctl.d/60-postgresql-shm.conf
@@ -93,6 +79,28 @@ ENV accept accept
 
 
 WORKDIR ${IROOT}
 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}/
 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 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
 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
 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
 mkdir -p out/release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 make && make install
 make && make install
 cd $IROOT
 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
 mkdir build
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
 ninja
 ninja
 cd $IROOT
 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
 	git clone https://github.com/chronoxor/CppServer
 	cd CppServer
 	cd CppServer
 	gil update
 	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
 	cd $IROOT/CppServer/build
 	./unix.sh
 	./unix.sh
 	cp $IROOT/CppServer/bin/libcppserver.a /usr/local/lib/
 	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 \
 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 \
 	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
 apt-get install --reinstall ca-certificates
 
 
+cd $IROOT
+
 mkdir /usr/local/share/ca-certificates/cacert.org
 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
 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
 update-ca-certificates
@@ -55,21 +57,21 @@ cd $IROOT
 rm -rf hiredis-1.0.0
 rm -rf hiredis-1.0.0
 
 
 cd $IROOT
 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
 mkdir -p out/release
 cd out/release
 cd out/release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 cmake ../.. -DCMAKE_BUILD_TYPE=Release
 make && make install
 make && make install
 cd $IROOT
 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
 mkdir build
 cd build
 cd build
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release
 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 ))
 WRIT_THREADS=$(( $MAX_THREADS / 3 ))
 SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
 SERV_THREADS=$(( $MAX_THREADS - $WRIT_THREADS ))
 
 
-#git checkout e243bc096cd570cfee1edfecbcd91f4c4056fa1a -b 6.0
 git clone https://github.com/sumeetchhetri/ffead-cpp
 git clone https://github.com/sumeetchhetri/ffead-cpp
 cd ffead-cpp
 cd ffead-cpp
+git checkout 1d892ae2c6155aa2d36c5f125ebd36433d9eb5aa -b 6.0
 rm -rf .git
 rm -rf .git
 cd ..
 cd ..
 mv ffead-cpp ffead-cpp-src
 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 &"
 nohup bash -c "./server.sh > ffead.log &"
 sleep 10
 sleep 10
 echo "ffead-cpp with sql-raw support launched"
 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' \
 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"
 	-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' \
 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"
 	-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' \
 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"
 	-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' \
 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"
 	-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' \
 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"
 echo "normal shutdown"
 rm -f serv.ctrl
 rm -f serv.ctrl
 pkill ffead-cpp
 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
 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
 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|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
 #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 &"
 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"
 	-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' \
 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"
 	-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' \
 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"
 	-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' \
 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"
 	-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"
 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 ODBCINI=${IROOT}/odbc.ini
 export ODBCSYSINI=${IROOT}
 export ODBCSYSINI=${IROOT}
 export LD_PRELOAD=/usr/local/lib/libmimalloc.so
 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
 cd $FFEAD_CPP_PATH
 
 
@@ -203,6 +203,7 @@ then
 elif [ "$2" = "v-picov" ]
 elif [ "$2" = "v-picov" ]
 then
 then
 	cd ${IROOT}
 	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
 	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
 	for i in $(seq 0 $(($(nproc --all)-1))); do
 		taskset -c $i ./main --server_dir=$FFEAD_CPP_PATH --server_port=8080 &
 		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
 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
 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
 rm -rf $IROOT/ffead-cpp-6.0-sql
 
 
-if [ "$1" = "batch" ]
+if [ "$1" = "batch-old" ]
 then
 then
 	apt remove -yqq libpq-dev
 	apt remove -yqq libpq-dev
 	apt autoremove -yqq
 	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.*
 	rm -f /usr/lib/x86_64-linux-gnu/libpq.*
-	apt update && apt install -y bison flex libreadline-dev
 	cd /tmp
 	cd /tmp
 	#wget -q https://github.com/an-tao/postgres/archive/batch_mode_ubuntu.tar.gz
 	#wget -q https://github.com/an-tao/postgres/archive/batch_mode_ubuntu.tar.gz
 	#tar -xzf 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
 	cp ../../../src/include/postgres_ext.h ../../../src/include/pg_config_ext.h libpq-fe.h /usr/include
 fi
 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" ]
 if [ "$2" = "clang" ]
 then
 then
 	apt update -yqq && apt install -yqq clang
 	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|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
 	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
 	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
 else
 	sed -i 's|add_subdirectory(${PROJECT_SOURCE_DIR}/web/te-benchmark-um-pq-async)||g' CMakeLists.txt
 	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|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
 	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
 	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 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
 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
 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
 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 id;
 	int randomNumber;
 	int randomNumber;
 public:
 public:
+	TeBkUmMgrWorld(int id);
+	TeBkUmMgrWorld(int id, int randomNumber);
 	TeBkUmMgrWorld();
 	TeBkUmMgrWorld();
 	virtual ~TeBkUmMgrWorld();
 	virtual ~TeBkUmMgrWorld();
 	int getId() const;
 	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;
 	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() {
 TeBkUmMgrWorld::TeBkUmMgrWorld() {
 	id = 0;
 	id = 0;
 	randomNumber = 0;
 	randomNumber = 0;
@@ -211,7 +221,7 @@ void TeBkUmMgrRouter::updateCache() {
 			TeBkUmMgrWorld& w = wlist.at(c);
 			TeBkUmMgrWorld& w = wlist.at(c);
 			char str[12];
 			char str[12];
 			sprintf(str, "%d;%d", w.getId(), w.getRandomNumber());
 			sprintf(str, "%d;%d", w.getId(), w.getRandomNumber());
-			cchi->setRaw(CastUtil::fromNumber(w.getId()), str);
+			cchi->setRaw(w.getId(), str);
 		}
 		}
 		CacheManager::cleanImpl(cchi);
 		CacheManager::cleanImpl(cchi);
 		CacheManager::triggerAppInitCompletion();
 		CacheManager::triggerAppInitCompletion();
@@ -251,26 +261,21 @@ void TeBkUmMgrRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmMgrW
 
 
 	CacheInterface* cchi = CacheManager::getImpl();
 	CacheInterface* cchi = CacheManager::getImpl();
 	try {
 	try {
-		std::vector<std::string> keys;
+		std::vector<unsigned long long> keys;
 		for (int c = 0; c < queryCount; ++c) {
 		for (int c = 0; c < queryCount; ++c) {
 			int rid = rand() % 10000 + 1;
 			int rid = rand() % 10000 + 1;
-			keys.push_back(CastUtil::fromNumber(rid));
+			keys.emplace_back(rid);
 		}
 		}
-
 		std::vector<std::string> values;
 		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);
 			std::string& v = values.at(c);
 			size_t fn = v.find(";");
 			size_t fn = v.find(";");
 			int tmp = 0;
 			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);
 		CacheManager::cleanImpl(cchi);
 	} catch(const std::exception& e) {
 	} catch(const std::exception& e) {
@@ -295,7 +300,7 @@ void TeBkUmMgrRouter::getContext(HttpRequest* request, Context* context) {
 		flst->push_back(nf);
 		flst->push_back(nf);
 		std::sort (flst->begin(), flst->end());
 		std::sort (flst->begin(), flst->end());
 
 
-		context->insert(std::pair<std::string, void*>("fortunes", flst));
+		context->emplace("fortunes", flst);
 	} catch(...) {
 	} catch(...) {
 		throw;
 		throw;
 	}
 	}
@@ -368,7 +373,7 @@ bool TeBkUmMgrRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface
 			fcpstream str;
 			fcpstream str;
 			tmplFunc(&ctx, str);
 			tmplFunc(&ctx, str);
 			res->setContent(str.str());
 			res->setContent(str.str());
-			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		}
 		}
 	} else if(StringUtil::endsWith(path, "/updates")) {
 	} 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 "string"
 #include "yuarel.h"
 #include "yuarel.h"
 #include "Router.h"
 #include "Router.h"
+#include <unordered_map>
+#include "ConfigurationData.h"
 
 
 class TeBkUmLpqAsyncWorld {
 class TeBkUmLpqAsyncWorld {
 	int id;
 	int id;
@@ -82,29 +84,47 @@ public:
 	void setMessage(const std::string& message);
 	void setMessage(const std::string& message);
 };
 };
 
 
-struct AsyncReq {
+struct AsyncDbReq {
 	float httpVers;
 	float httpVers;
 	bool conn_clos;
 	bool conn_clos;
 	SocketInterface* sif;
 	SocketInterface* sif;
-	LibpqDataSourceImpl* sqli;
-
 	TeBkUmLpqAsyncWorld w;
 	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;
 	std::vector<TeBkUmLpqAsyncWorld> vec;
+};
+
+struct AsyncFortuneReq {
+	float httpVers;
+	bool conn_clos;
+	SocketInterface* sif;
 	std::list<TeBkUmLpqAsyncFortune> flst;
 	std::list<TeBkUmLpqAsyncFortune> flst;
 };
 };
 
 
-struct CacheReq {
+struct AsyncCacheReq {
 	CacheInterface* cchi;
 	CacheInterface* cchi;
-
 	std::vector<TeBkUmLpqAsyncWorld> vec;
 	std::vector<TeBkUmLpqAsyncWorld> vec;
 };
 };
 
 
 class TeBkUmLpqAsyncRouter : public Router {
 class TeBkUmLpqAsyncRouter : public Router {
 	static const std::string HELLO_WORLD;
 	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;
 	static TemplatePtr tmplFunc;
 
 
@@ -112,43 +132,22 @@ class TeBkUmLpqAsyncRouter : public Router {
 	static Ser w_ser;
 	static Ser w_ser;
 	static SerCont wcont_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);
 	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>&);
 	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* sqli;
-	LibpqDataSourceImpl* getDb();
-	//static Logger logger;
+protected:
+	virtual LibpqDataSourceImpl* getDb(int max = 0);
 public:
 public:
 	TeBkUmLpqAsyncRouter& operator=(const TeBkUmLpqAsyncRouter& a) {
 	TeBkUmLpqAsyncRouter& operator=(const TeBkUmLpqAsyncRouter& a) {
 		return *this;
 		return *this;
@@ -159,7 +158,35 @@ public:
 	TeBkUmLpqAsyncRouter();
 	TeBkUmLpqAsyncRouter();
 	virtual ~TeBkUmLpqAsyncRouter();
 	virtual ~TeBkUmLpqAsyncRouter();
 	void updateCache();
 	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);
 	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_ */
 #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
  *  Created on: 03-Feb-2020
  *      Author: sumeetc
  *      Author: sumeetc
  */
  */
+
 #include "TeBkUmLpqAsync.h"
 #include "TeBkUmLpqAsync.h"
 
 
 int TeBkUmLpqAsyncWorld::getId() const {
 int TeBkUmLpqAsyncWorld::getId() const {
@@ -109,525 +110,528 @@ void TeBkUmLpqAsyncMessage::setMessage(const std::string& message) {
 }
 }
 
 
 const std::string TeBkUmLpqAsyncRouter::HELLO_WORLD = "Hello, World!";
 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;
 	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;
 	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->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::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()) {
 	if(it!=_qC.end()) {
 		return it->second;
 		return it->second;
 	}
 	}
 
 
 	std::stringstream ss;
 	std::stringstream ss;
-	ss << "update world as t set randomnumber = case id ";
+	ss << "update world as t set randomnumber = case id";
 
 
 	int pc = 1;
 	int pc = 1;
 	for (int c = 0; c < count; ++c) {
 	for (int c = 0; c < count; ++c) {
-		ss << "when $";
+		ss << " when $";
 		ss << pc++;
 		ss << pc++;
 		ss << " then $";
 		ss << " then $";
 		ss << pc++;
 		ss << pc++;
 	}
 	}
-	ss << "else randomnumber end where id in (";
+	ss << " else randomnumber end where id in (";
 	for (int c = 0; c < count; ++c) {
 	for (int c = 0; c < count; ++c) {
 		ss << "$" << pc++ << ",";
 		ss << "$" << pc++ << ",";
 	}
 	}
 	std::string q = ss.str();
 	std::string q = ss.str();
 	q = q.substr(0, q.length()-1);
 	q = q.substr(0, q.length()-1);
 	q += ")";
 	q += ")";
+
 	_qC[count] = std::move(q);
 	_qC[count] = std::move(q);
 	return _qC[count];
 	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;
 	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->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;
 	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->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() {
 void TeBkUmLpqAsyncRouter::updateCache() {
-	LibpqDataSourceImpl* sqli = getDb();
+	LibpqDataSourceImpl* sqli = getDb(1);
 
 
-	CacheReq* req = new CacheReq;
+	AsyncCacheReq* req = new AsyncCacheReq;
 	req->cchi = CacheManager::getImpl();
 	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) {
 void TeBkUmLpqAsyncRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmLpqAsyncWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
 	CacheInterface* cchi = CacheManager::getImpl();
 	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;
 		fcpstream str;
 		tmplFunc(&context, str);
 		tmplFunc(&context, str);
+		std::string out = str.str();
 		HttpResponse r;
 		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) {
 bool TeBkUmLpqAsyncRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface* sif) {
 	sif->use();
 	sif->use();
 	if(StringUtil::endsWith(req->getPath(), "/plaintext")) {
 	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();
 		sif->unUse();
 	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
 		TeBkUmLpqAsyncMessage msg;
 		TeBkUmLpqAsyncMessage msg;
 		msg.setMessage(HELLO_WORLD);
 		msg.setMessage(HELLO_WORLD);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		JSONSerialize::serializeObject(&msg, m_ser, res->getContentP());
 		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();
 		sif->unUse();
 	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
-		AsyncReq* ar = new AsyncReq;
+		/*AsyncDbReq* ar = new AsyncDbReq;
 		ar->sif = sif;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/queries")) {
 		struct yuarel_param params[1];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), 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->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		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];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), 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->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->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
 		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")) {
 	else if(StringUtil::endsWith(req->getPath(), "/fortunes")) {
-		AsyncReq* ar = new AsyncReq;
-		ar->sif = sif;
+		/*AsyncFortuneReq* ar = new AsyncFortuneReq;
 		ar->sif = sif;
 		ar->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		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];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), 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->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
 		ar->conn_clos = req->isClose();
 		updatesAsyncb(params[0].val, params[0].val_len, ar);
 		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];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), 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->sif = sif;
 		ar->httpVers = req->getHttpVers();
 		ar->httpVers = req->getHttpVers();
 		ar->conn_clos = req->isClose();
 		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);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqAsyncWorld> msg;
 		std::vector<TeBkUmLpqAsyncWorld> msg;
 		cachedWorlds(params[0].val, params[0].val_len, msg);
 		cachedWorlds(params[0].val, params[0].val_len, msg);
-		res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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();
 		sif->unUse();
 	} else {
 	} 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();
 		sif->unUse();
 	}
 	}
 	return false;
 	return false;
@@ -668,11 +669,58 @@ TeBkUmLpqAsyncRouter::TeBkUmLpqAsyncRouter() {
 }
 }
 
 
 TeBkUmLpqAsyncRouter::~TeBkUmLpqAsyncRouter() {
 TeBkUmLpqAsyncRouter::~TeBkUmLpqAsyncRouter() {
+	if(sqli!=NULL) {
+		DataSourceManager::cleanRawImpl(sqli);
+	}
 }
 }
 
 
-LibpqDataSourceImpl* TeBkUmLpqAsyncRouter::getDb() {
+LibpqDataSourceImpl* TeBkUmLpqAsyncRouter::getDb(int max) {
 	if(sqli==NULL) {
 	if(sqli==NULL) {
 		sqli = static_cast<LibpqDataSourceImpl*>(DataSourceManager::getRawImpl("PostgreSQL-DSN", "te-benchmark-um-pq-async"));
 		sqli = static_cast<LibpqDataSourceImpl*>(DataSourceManager::getRawImpl("PostgreSQL-DSN", "te-benchmark-um-pq-async"));
 	}
 	}
 	return sqli;
 	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 "yuarel.h"
 #include "Router.h"
 #include "Router.h"
 #include "Reflector.h"
 #include "Reflector.h"
+#include <unordered_map>
 
 
 class TeBkUmLpqWorld {
 class TeBkUmLpqWorld {
 	int id;
 	int id;
@@ -56,11 +57,12 @@ public:
 	void setId(int id);
 	void setId(int id);
 	int getRandomNumber() const;
 	int getRandomNumber() const;
 	void setRandomNumber(int randomNumber);
 	void setRandomNumber(int randomNumber);
+	bool operator < (const TeBkUmLpqWorld& other) const;
 };
 };
 
 
 struct UpdQrData {
 struct UpdQrData {
 	std::vector<TeBkUmLpqWorld>* wlist;
 	std::vector<TeBkUmLpqWorld>* wlist;
-	std::stringstream* ss;
+	std::stringstream ss;
 	bool status;
 	bool status;
 	int queryCount;
 	int queryCount;
 };
 };
@@ -80,6 +82,8 @@ public:
 	bool operator < (const TeBkUmLpqFortune& other) const;
 	bool operator < (const TeBkUmLpqFortune& other) const;
 };
 };
 
 
+class TeBkUmLpqRouterPicoV;
+
 class TeBkUmLpqMessage {
 class TeBkUmLpqMessage {
 	std::string message;
 	std::string message;
 public:
 public:
@@ -92,10 +96,11 @@ public:
 
 
 class TeBkUmLpqRouter : public Router {
 class TeBkUmLpqRouter : public Router {
 	static const std::string HELLO_WORLD;
 	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;
 	static TemplatePtr tmplFunc;
 
 
@@ -103,31 +108,20 @@ class TeBkUmLpqRouter : public Router {
 	static Ser w_ser;
 	static Ser w_ser;
 	static SerCont wcont_ser;
 	static SerCont wcont_ser;
 
 
-	static bool strToNum(const char* str, int len, int& ret);
-
 	void db(TeBkUmLpqWorld&);
 	void db(TeBkUmLpqWorld&);
 	void queries(const char*, int, std::vector<TeBkUmLpqWorld>&);
 	void queries(const char*, int, std::vector<TeBkUmLpqWorld>&);
 	void queriesMulti(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>&);
 	void updates(const char*, int, std::vector<TeBkUmLpqWorld>&);
-	static void updatesUtil(void* ctx, int, int, char *);
 	void updatesMulti(const char*, int, std::vector<TeBkUmLpqWorld>&);
 	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>&);
 	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* sqli;
 	LibpqDataSourceImpl* getDb();
 	LibpqDataSourceImpl* getDb();
 
 
 	std::string& getUpdQuery(int count);
 	std::string& getUpdQuery(int count);
+	friend class TeBkUmLpqRouterPicoV;
 public:
 public:
 	TeBkUmLpqRouter();
 	TeBkUmLpqRouter();
 	virtual ~TeBkUmLpqRouter();
 	virtual ~TeBkUmLpqRouter();
@@ -135,4 +129,12 @@ public:
 	bool route(HttpRequest* req, HttpResponse* res, SocketInterface* sif);
 	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_ */
 #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
  *  Created on: 03-Feb-2020
  *      Author: sumeetc
  *      Author: sumeetc
  */
  */
+
 #include "TeBkUmLpq.h"
 #include "TeBkUmLpq.h"
 
 
 int TeBkUmLpqWorld::getId() const {
 int TeBkUmLpqWorld::getId() const {
@@ -47,6 +48,10 @@ TeBkUmLpqWorld::TeBkUmLpqWorld(int id, int randomNumber) {
 	this->randomNumber = randomNumber;
 	this->randomNumber = randomNumber;
 }
 }
 
 
+bool TeBkUmLpqWorld::operator < (const TeBkUmLpqWorld& other) const {
+	return id < other.id;
+}
+
 TeBkUmLpqWorld::TeBkUmLpqWorld() {
 TeBkUmLpqWorld::TeBkUmLpqWorld() {
 	id = 0;
 	id = 0;
 	randomNumber = 0;
 	randomNumber = 0;
@@ -109,60 +114,57 @@ void TeBkUmLpqMessage::setMessage(const std::string& message) {
 }
 }
 
 
 const std::string TeBkUmLpqRouter::HELLO_WORLD = "Hello, World!";
 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) {
 void TeBkUmLpqRouter::db(TeBkUmLpqWorld& w) {
 	LibpqDataSourceImpl* sqli = getDb();
 	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) {
 void TeBkUmLpqRouter::queries(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
 	LibpqDataSourceImpl* sqli = getDb();
 	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) {
 void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
@@ -172,343 +174,333 @@ void TeBkUmLpqRouter::queriesMulti(const char* q, int ql, std::vector<TeBkUmLpqW
 	updt.wlist = &wlst;
 	updt.wlist = &wlst;
 	updt.status = true;
 	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::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()) {
 	if(it!=_qC.end()) {
 		return it->second;
 		return it->second;
 	}
 	}
 
 
 	std::stringstream ss;
 	std::stringstream ss;
-	ss << "update world as t set randomnumber = case id ";
+	ss << "update world as t set randomnumber = case id";
 
 
 	int pc = 1;
 	int pc = 1;
 	for (int c = 0; c < count; ++c) {
 	for (int c = 0; c < count; ++c) {
-		ss << "when $";
+		ss << " when $";
 		ss << pc++;
 		ss << pc++;
 		ss << " then $";
 		ss << " then $";
 		ss << pc++;
 		ss << pc++;
 	}
 	}
-	ss << "else randomnumber end where id in (";
+	ss << " else randomnumber end where id in (";
 	for (int c = 0; c < count; ++c) {
 	for (int c = 0; c < count; ++c) {
 		ss << "$" << pc++ << ",";
 		ss << "$" << pc++ << ",";
 	}
 	}
 	std::string q = ss.str();
 	std::string q = ss.str();
 	q = q.substr(0, q.length()-1);
 	q = q.substr(0, q.length()-1);
 	q += ")";
 	q += ")";
+
 	_qC[count] = std::move(q);
 	_qC[count] = std::move(q);
 	return _qC[count];
 	return _qC[count];
 }
 }
 
 
 void TeBkUmLpqRouter::updates(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 void TeBkUmLpqRouter::updates(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
 	LibpqDataSourceImpl* sqli = getDb();
 	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) {
 void TeBkUmLpqRouter::updatesMulti(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
 	LibpqDataSourceImpl* sqli = getDb();
 	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() {
 void TeBkUmLpqRouter::updateCache() {
 	CacheInterface* cchi = CacheManager::getImpl();
 	CacheInterface* cchi = CacheManager::getImpl();
 	LibpqDataSourceImpl* sqli = getDb();
 	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) {
 void TeBkUmLpqRouter::cachedWorlds(const char* q, int ql, std::vector<TeBkUmLpqWorld>& wlst) {
 	int queryCount = 0;
 	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);
 	wlst.reserve(queryCount);
 
 
 	CacheInterface* cchi = CacheManager::getImpl();
 	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();
 	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) {
 bool TeBkUmLpqRouter::route(HttpRequest* req, HttpResponse* res, SocketInterface* sif) {
+	std::string h;
 	if(StringUtil::endsWith(req->getPath(), "/plaintext")) {
 	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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/json")) {
 		TeBkUmLpqMessage msg;
 		TeBkUmLpqMessage msg;
 		msg.setMessage(HELLO_WORLD);
 		msg.setMessage(HELLO_WORLD);
 		JSONSerialize::serializeObject(&msg, m_ser, res->getContentP());
 		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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/db")) {
 		TeBkUmLpqWorld msg;
 		TeBkUmLpqWorld msg;
 		db(msg);
 		db(msg);
 		JSONSerialize::serializeObject(&msg, w_ser, res->getContentP());
 		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];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		std::vector<TeBkUmLpqWorld> msg;
 		queries(params[0].val, params[0].val_len, msg);
 		queries(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/queries")) {
 		struct yuarel_param params[1];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		std::vector<TeBkUmLpqWorld> msg;
 		queriesMulti(params[0].val, params[0].val_len, msg);
 		queriesMulti(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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")) {
 	} 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];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		std::vector<TeBkUmLpqWorld> msg;
 		updates(params[0].val, params[0].val_len, msg);
 		updates(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/updates")) {
 		struct yuarel_param params[1];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		std::vector<TeBkUmLpqWorld> msg;
 		updatesMulti(params[0].val, params[0].val_len, msg);
 		updatesMulti(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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")) {
 	} else if(StringUtil::endsWith(req->getPath(), "/cached-worlds")) {
 		struct yuarel_param params[1];
 		struct yuarel_param params[1];
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		yuarel_parse_query((char*)req->getQueryStr().data(), req->getQueryStr().size(), params, 1);
 		std::vector<TeBkUmLpqWorld> msg;
 		std::vector<TeBkUmLpqWorld> msg;
 		cachedWorlds(params[0].val, params[0].val_len, msg);
 		cachedWorlds(params[0].val, params[0].val_len, msg);
 		JSONSerialize::serializeObjectCont(&msg, wcont_ser, "vector", res->getContentP());
 		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 {
 	} 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;
 TemplatePtr TeBkUmLpqRouter::tmplFunc;
@@ -533,3 +525,95 @@ LibpqDataSourceImpl* TeBkUmLpqRouter::getDb() {
 	}
 	}
 	return sqli;
 	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;
 			fcpstream str;
 			tmplFunc(&ctx, str);
 			tmplFunc(&ctx, str);
 			res->setContent(str.str());
 			res->setContent(str.str());
-			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_SHTML);
+			res->setContentType(ContentTypes::CONTENT_TYPE_TEXT_HTML);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 			res->setHTTPResponseStatus(HTTPResponseStatus::Ok);
 		}
 		}
 	} else if(StringUtil::endsWith(path, "/updates")) {
 	} else if(StringUtil::endsWith(path, "/updates")) {

+ 39 - 0
frameworks/C++/suil/README.md

@@ -0,0 +1,39 @@
+# suil Benchmarking Test
+
+`Suil` is C++ Micro web framework which provides API's that can be used to design web applications in C++.
+- [See documentation](https://suilteam.com/) for more details
+- [Github Repo](https://github.com/dccarter/suil)
+
+### Test Type Implementation Source Code
+
+* [JSON](benchmark/src/main.cpp)
+* [PLAINTEXT](benchmark/src/main.cpp)
+* [DB](benchmark/src/main.cpp)
+* [QUERY](benchmark/src/main.cpp)
+* [UPDATE](benchmark/src/main.cpp)
+
+## Important Libraries
+The tests were run with:
+* [Software](https://www.example1.com/)
+* [Example](http://www.example2.com/)
+
+## Test URLs
+### JSON
+
+http://localhost:8080/json
+
+### PLAINTEXT
+
+http://localhost:8080/plaintext
+
+### DB
+
+http://localhost:8080/db
+
+### QUERY
+
+http://localhost:8080/query?queries=
+
+### UPDATE
+
+http://localhost:8080/update?queries=

+ 1 - 0
frameworks/C++/suil/benchmark/.gitattributes

@@ -0,0 +1 @@
+*.scc linguist-language=C++

+ 78 - 0
frameworks/C++/suil/benchmark/.gitignore

@@ -0,0 +1,78 @@
+
+### C template
+# Prerequisites
+*.d
+
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Linker output
+*.ilk
+*.map
+*.exp
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+*.su
+*.idb
+*.pdb
+
+# Kernel Module Compile Results
+*.mod*
+*.cmd
+modules.order
+Module.symvers
+Mkfile.old
+dkms.conf
+### C++ template
+# Prerequisites
+
+# Compiled Object files
+*.slo
+
+# Precompiled Headers
+
+# Compiled Dynamic libraries
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+
+# Build directories
+.build
+build
+.creator
+cmake-build-*
+
+# IDE files
+.idea

+ 13 - 0
frameworks/C++/suil/benchmark/3rdParty.cmake

@@ -0,0 +1,13 @@
+set(EP_INSTALL_DIR ${CMAKE_BINARY_DIR}/deps)
+
+include(ExternalProject)
+
+set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/3rdParty)
+set(EP_PREFIX  ${CMAKE_BINARY_DIR}/3rdParty)
+
+ExternalProject_Add(catch
+        PREFIX ${EP_PREFIX}/catch
+        GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+        GIT_TAG "v2.13.1"
+        CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${EP_INSTALL_DIR};-DCATCH_BUILD_EXAMPLES=OFF;-DCATCH_BUILD_TESTING=OFF;-DCATCH_INSTALL_DOCS=OFF;-DCATCH_INSTALL_HELPERS=OFF")
+set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL True)

+ 35 - 0
frameworks/C++/suil/benchmark/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.15)
+project(suil-bench VERSION 0.1.0 LANGUAGES C CXX)
+
+set(SUIL_BASE_PATH "" CACHE STRING "The root path when SCF is installed")
+if (SUIL_BASE_PATH)
+    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SUIL_BASE_PATH}/lib/cmake)
+endif()
+
+option(SUIL_BENCH_DEV "Build development binaries" OFF)
+if (SUIL_BENCH_DEV)
+    set(SUIL_BENCH_DEV 1)
+else()
+    set(SUIL_BENCH_DEV 0)
+endif()
+
+# Provides Suil* functions
+include(Suil)
+
+# Start a suil project
+SuilStartProject(suil-bench
+        EXPORTS ON
+        SCC_SOURCES src/app.scc)
+
+# Create an application target
+SuilApp(suil-bench
+    SOURCES
+        src/main.cpp
+        ${SUIL_PROJECT_SCC_PUB}/app.scc.cpp
+    LIBRARIES Suil::HttpServer
+    INSTALL   ON
+    DEPENDS   suil-bench-scc
+    DEFINES   SUIL_BENCH_DEV=${SUIL_BENCH_DEV})
+
+# Needed for installation to work
+SuilEndProject()

+ 4 - 0
frameworks/C++/suil/benchmark/cmake/Config.cmake.in

@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
+check_required_components(@SUIL_PROJECT_NAME@)

+ 17 - 0
frameworks/C++/suil/benchmark/src/app.scc

@@ -0,0 +1,17 @@
+#include <suil/base/string.hpp>
+#include <suil/db/symbols.scc.hpp>
+
+#pragma load sbg
+
+namespace suil::bench {
+
+    struct [[gen::sbg(json)]] Object {
+        String message{""};
+    };
+
+    struct [[gen::sbg(json)]] World {
+        [[PRIMARY_KEY]]
+        int id{0};
+        int randomNumber{0};
+    };
+}

+ 155 - 0
frameworks/C++/suil/benchmark/src/main.cpp

@@ -0,0 +1,155 @@
+//
+// Created by Mpho Mbotho on 2021-01-15.
+//
+
+#include    <suil/base/env.hpp>
+#include <suil/http/server/pgsqlmw.hpp>
+#include <suil/http/server/endpoint.hpp>
+#include <suil/http/server/sysattrs.hpp>
+
+
+#include "app.scc.hpp"
+
+using suil::net::ServerConfig;
+using suil::net::TcpSocketConfig;
+using suil::http::server::PgSqlMiddleware;
+using suil::http::server::Endpoint;
+using suil::http::server::SystemAttrs;
+using suil::http::server::Request;
+using suil::http::server::Response;
+using suil::db::Orm;
+using suil::db::PgSqlConnection;
+using suil::bench::World;
+
+using WorldOrm = Orm<PgSqlConnection, suil::bench::World>;
+
+#define DEFAULT_POSTGRES_CONN "postgres://build:passwd@postgres:5432/dev"
+
+static inline int randnum()
+{
+    // from https://stackoverflow.com/questions/1640258/need-a-fast-random-generator-for-c
+    constexpr int MAX_VALUE = 10000;
+    static int g_seed = 0;
+    g_seed = (214013*g_seed+2531011);
+    return 1 + ((g_seed>>16)&0x7FFF)%MAX_VALUE;
+}
+
+#if SUIL_BENCH_DEV==1
+void seedDatabase(PgSqlConnection& conn)
+{
+    constexpr int MAX_RECORDS = 10000;
+    WorldOrm orm("world", conn);
+    if (orm.cifne(false)) {
+        for (int i = 0; i < MAX_RECORDS; i++) {
+            orm.insert(World{.id = i+1, .randomNumber = randnum()});
+        }
+    }
+}
+#endif
+
+int main(int argc, char *argv[])
+{
+    suil::setup(opt(verbose, 1));
+    auto config = ServerConfig{
+        .socketConfig = TcpSocketConfig {
+            .bindAddr = {.name = "0.0.0.0", .port = 8080}
+        }
+    };
+
+    Endpoint<SystemAttrs, PgSqlMiddleware> ep{"/",
+          opt(serverConfig, std::move(config)),
+          opt(numberOfWorkers, 0)   /* Will run with number of available cores */
+    };
+
+    ep.middleware<PgSqlMiddleware>().setup(
+            suil::env("POSTGRES_CONN", DEFAULT_POSTGRES_CONN),
+            opt(ASYNC,   true),   // connections are async
+            opt(TIMEOUT, 5_sec),  // timeout on db transactions
+            opt(EXPIRES, 30_sec)  // connections are cached for 30 seconds
+    );
+
+#if SUIL_BENCH_DEV == 1
+    {
+        scoped(conn, ep.middleware<PgSqlMiddleware>().conn());
+        seedDatabase(conn);
+    }
+#endif
+
+    Route(ep, "/plaintext")
+    ("GET"_method)
+    .attrs(opt(ReplyType, "text/plain"))
+    ([]() {
+        return suil::String{"Hello, World!"};
+    });
+
+    Route(ep, "/json")
+    ("GET"_method)
+    .attrs(opt(ReplyType, "application/json"))
+    ([]() {
+        return suil::bench::Object{.message = "Hello, World!"};
+    });
+
+    Route(ep, "/db")
+    ("GET"_method)
+    .attrs(opt(ReplyType, "application/json"))
+    ([&ep]() {
+        scoped(conn, ep.middleware<PgSqlMiddleware>().conn());
+        WorldOrm orm("World", conn);
+        suil::bench::World obj{};
+        orm.find(opt(id, randnum()), obj);
+        return obj;
+    });
+
+    Route(ep, "/query")
+    ("GET"_method)
+    .attrs(opt(ReplyType, "application/json"))
+    ([&ep](const Request& req, Response& resp) {
+        auto queries = req.query().get<int>("queries") or int(1);
+        int count = std::max(1, std::min(*queries, 500));
+
+        scoped(conn, ep.context<PgSqlMiddleware>(req).conn());
+        std::vector<World> objects(count);
+        WorldOrm orm("World", conn);
+        for (auto& obj: objects) {
+            orm.find(opt(id, randnum()), obj);
+        }
+
+        resp.append(objects);
+        resp.end();
+    });
+
+    Route(ep, "/update")
+    ("GET"_method)
+    .attrs(opt(ReplyType, "application/json"))
+    ([&ep](const Request& req, Response& resp) {
+        auto queries = req.query().get<int>("queries") or int(1);
+        int count = std::max(1, std::min(*queries, 500));
+
+        scoped(conn, ep.context<PgSqlMiddleware>(req).conn());
+        std::vector<World> objects(count);
+
+        WorldOrm orm("World", conn);
+
+        for (auto& obj: objects) {
+            orm.find(opt(id, randnum()), obj);
+            obj.randomNumber = randnum();
+        }
+
+        {
+            suil::db::PgSqlTransaction txn(conn.get());
+            txn.begin();
+
+            // Sorting transactions to avoid postgres deadlock
+            std::sort(objects.begin(), objects.end(),
+                      [](const World& a, const World& b) { return a.id < b.id; });
+            for (auto& obj: objects) {
+                orm.update(obj);
+            }
+        }
+
+        resp.append(objects);
+        resp.end();
+    });
+
+    return ep.start();
+}

+ 29 - 0
frameworks/C++/suil/benchmark_config.json

@@ -0,0 +1,29 @@
+{
+  "framework": "suil",
+  "tests": [
+    {
+      "default": {
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "db_url": "/db",
+        "query_url": "/query?queries=",
+        "update_url": "/update?queries=",
+        "port": 8080,
+        "approach": "Stripped",
+        "classification": "Micro",
+        "database": "postgres",
+        "framework": "suil",
+        "language": "C++",
+        "flavor": "None",
+        "orm": "Micro",
+        "platform": "None",
+        "webserver": "None",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "suil",
+        "notes": "",
+        "versus": "None"
+      }
+    }
+  ]
+}

+ 11 - 0
frameworks/C++/suil/scripts/build.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+# Build project
+mkdir -p .build
+cd .build
+cmake .. -DCMAKE_BUILD_TYPE=Release \
+         -DCMAKE_INSTALL_PREFIX=/install \
+         -DSUIL_BASE_PATH=$(cat /var/SUIL_BASE)
+make install

+ 22 - 0
frameworks/C++/suil/scripts/download-framework.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+# Download's suil
+RELEASE_NAME=v${SUIL_VERSION}
+if [ -n "${SUIL_VERSION_TAG}" ] ; then
+    RELEASE_NAME=${RELEASE_NAME}-${SUIL_VERSION_TAG}
+fi
+
+echo "Fetching suil {version=${SUIL_VERSION}} artifacts"
+BASE_DIR=Suil-${SUIL_VERSION}-${SUIL_CONFIGURATION}
+BINARY=${BASE_DIR}.tar.gz
+DOWNLOAD_URL="https://github.com/dccarter/suil/releases/download/${RELEASE_NAME}/${BINARY}"
+echo "Downloading suil from ${DOWNLOAD_URL}"
+wget -q ${DOWNLOAD_URL} -O /tmp/${BINARY}
+tar -xzf /tmp/${BINARY} -C /var
+ls /var/${BASE_DIR}
+echo "Suil upacked /var/${BASE_DIR}"
+
+echo /var/$BASE_DIR > /var/SUIL_BASE
+echo $DOWNLOAD_URL  > /var/SUIL_DOWNLOAD_URL

+ 18 - 0
frameworks/C++/suil/suil.dockerfile

@@ -0,0 +1,18 @@
+FROM suilteam/base:alpine
+
+COPY ./ suil-bench
+
+ENV SUIL_VERSION=0.1.0
+ENV SUIL_VERSION_TAG=alpha
+ENV SUIL_CONFIGURATION=Release
+
+WORKDIR /suil-bench
+RUN ./scripts/download-framework.sh
+
+WORKDIR /suil-bench/benchmark
+RUN ../scripts/build.sh
+
+ENV POSTGRES_CONN="postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world"
+
+EXPOSE 8080
+CMD ["/install/bin/suil-bench"]

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

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

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

@@ -4,6 +4,24 @@ name = "treefrog"
 [main]
 [main]
 urls.plaintext = "/world/plain"
 urls.plaintext = "/world/plain"
 urls.json = "/json/json"
 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.db = "/world/random"
 urls.query = "/world/queries/"
 urls.query = "/world/queries/"
 urls.update = "/world/updates/"
 urls.update = "/world/updates/"
@@ -37,7 +55,7 @@ platform = "None"
 webserver = "None"
 webserver = "None"
 versus = "treefrog"
 versus = "treefrog"
 
 
-[postgres]
+[epoll]
 urls.plaintext = "/world/plain"
 urls.plaintext = "/world/plain"
 urls.json = "/json/json"
 urls.json = "/json/json"
 urls.db = "/world/prandom"
 urls.db = "/world/prandom"
@@ -54,21 +72,3 @@ orm = "Micro"
 platform = "None"
 platform = "None"
 webserver = "None"
 webserver = "None"
 versus = ""
 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'
 # Specify the cache backend, such as 'sqlite', 'mongodb'
 # or 'redis'.
 # or 'redis'.
-Cache.Backend=redis
+Cache.Backend=sqlite
 
 
 # Probability of starting garbage collection (GC) for cache.
 # Probability of starting garbage collection (GC) for cache.
 # If 100 is specified, GC will be started at a rate of once per 100
 # If 100 is specified, GC will be started at a rate of once per 100
 # sets. If 0 is specified, the GC never starts.
 # sets. If 0 is specified, the GC never starts.
-Cache.GcProbability=10000
+Cache.GcProbability=100000
 
 
 # If true, enable LZ4 compression when storing data.
 # If true, enable LZ4 compression when storing data.
 Cache.EnableCompression=no
 Cache.EnableCompression=no

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

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

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

@@ -2,7 +2,7 @@ FROM buildpack-deps:focal
 
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 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 \
 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 \
     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
 # 2. Compile applicaton
 RUN make
 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
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=epoll|g' config/application.ini
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 
 # 3. Start TreeFrog
 # 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 DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 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 \
 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 \
     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
 # 2. Compile applicaton
 RUN make
 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
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 
 # 3. Start TreeFrog
 # 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 DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 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 \
 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 \
     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
 # 2. Compile applicaton
 RUN make
 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
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 
 # 3. Start TreeFrog
 # 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 DEBIAN_FRONTEND noninteractive
 ENV DEBCONF_NOWARNINGS yes
 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 \
 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 \
     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
 # 2. Compile applicaton
 RUN make
 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
 RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=thread|g' config/application.ini
 
 
 EXPOSE 8080
 EXPOSE 8080
 
 
 # 3. Start TreeFrog
 # 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",
         "webserver": "Kestrel",
         "os": "Linux",
         "os": "Linux",
         "database_os": "Linux",
         "database_os": "Linux",
-        "display_name": "appMpower [Middleware, Odbc, Pg]",
+        "display_name": "appMpower [Middleware, Pg, Odbc]",
         "notes": "",
         "notes": "",
         "versus": "aspcore-mw-ado-pg"
         "versus": "aspcore-mw-ado-pg"
       },
       },
@@ -59,7 +59,7 @@
         "webserver": "Kestrel",
         "webserver": "Kestrel",
         "os": "Linux",
         "os": "Linux",
         "database_os": "Linux",
         "database_os": "Linux",
-        "display_name": "appMpower [Middleware, Odbc, My]",
+        "display_name": "appMpower [Middleware, My, Odbc]",
         "notes": "",
         "notes": "",
         "versus": "aspcore-mw-ado-my"
         "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;
       private static short _createdConnections = 0;
 
 
 #if MYSQL
 #if MYSQL
-      private static short _maxConnections = 1250; 
+      private static short _maxConnections = 500; 
 #else
 #else
       private static short _maxConnections = 500;
       private static short _maxConnections = 500;
 #endif
 #endif
@@ -85,4 +85,4 @@ namespace appMpower.Db
          }
          }
       }
       }
    }
    }
-}
+}

+ 10 - 2
frameworks/CSharp/aspnetcore-corert/PlatformBenchmarks/PlatformBenchmarks.csproj

@@ -6,7 +6,6 @@
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 
 
     <!-- Opt out of the "easy mode" of the CoreRT compiler (http://aka.ms/OptimizeCoreRT) -->
     <!-- Opt out of the "easy mode" of the CoreRT compiler (http://aka.ms/OptimizeCoreRT) -->
-    <TrimMode>link</TrimMode>
     <IlcOptimizationPreference>Speed</IlcOptimizationPreference>
     <IlcOptimizationPreference>Speed</IlcOptimizationPreference>
     <IlcPgoOptimize>true</IlcPgoOptimize>
     <IlcPgoOptimize>true</IlcPgoOptimize>
 
 
@@ -27,6 +26,15 @@
 
 
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="Utf8Json" Version="1.3.7" />
     <PackageReference Include="Utf8Json" Version="1.3.7" />
-    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="6.0.0-*" />
+    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" />
   </ItemGroup>
   </ItemGroup>
+   
+  <Target Name="ConfigureTrimming"
+    BeforeTargets="PrepareForILLink">
+    <ItemGroup>
+      <ManagedAssemblyToLink>
+        <TrimMode>link</TrimMode>
+      </ManagedAssemblyToLink>
+    </ItemGroup>
+  </Target>
 </Project>
 </Project>

+ 31 - 0
frameworks/CSharp/aspnetcore/Benchmarks.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31717.71
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatformBenchmarks", "PlatformBenchmarks\PlatformBenchmarks.csproj", "{047A5FF4-56BB-4BEF-9DCF-9B6051365423}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{047A5FF4-56BB-4BEF-9DCF-9B6051365423}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C65B0C4A-B242-4A03-AC80-4B1DC6C1DF57}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {69C5D834-F31B-4F07-97EC-E4DD5AF417DE}
+	EndGlobalSection
+EndGlobal

+ 4 - 5
frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 <Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
   <PropertyGroup>
-    <TargetFramework>net5.0</TargetFramework>
+    <TargetFramework>net6.0</TargetFramework>
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
   </PropertyGroup>
   </PropertyGroup>
 
 
@@ -12,11 +12,10 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.5" />
-    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.5" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0-rc.1.21452.10" />
 
 
     <PackageReference Include="Dapper" Version="2.0.90" />
     <PackageReference Include="Dapper" Version="2.0.90" />
-    <PackageReference Include="MySqlConnector" Version="1.3.2" />
-    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
+    <PackageReference Include="MySqlConnector" Version="1.3.12" />
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0-rc.1" />
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesDapperMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleQueriesDapperMiddleware
     public class MultipleQueriesDapperMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryDapper));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryDapper));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -37,7 +33,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var rows = await db.LoadMultipleQueriesRows(count);
                 var rows = await db.LoadMultipleQueriesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesEfMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleQueriesEfMiddleware
     public class MultipleQueriesEfMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryEf));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryEf));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -37,7 +33,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var rows = await db.LoadMultipleQueriesRows(count);
                 var rows = await db.LoadMultipleQueriesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleQueriesRawMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleQueriesRawMiddleware
     public class MultipleQueriesRawMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryRaw));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiQueryRaw));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -37,7 +33,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var rows = await db.LoadMultipleQueriesRows(count);
                 var rows = await db.LoadMultipleQueriesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 8
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesDapperMiddleware.cs

@@ -2,25 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleUpdatesDapperMiddleware
     public class MultipleUpdatesDapperMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateDapper));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateDapper));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
-
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
         public MultipleUpdatesDapperMiddleware(RequestDelegate next)
         public MultipleUpdatesDapperMiddleware(RequestDelegate next)
@@ -37,7 +32,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var rows = await db.LoadMultipleUpdatesRows(count);
                 var rows = await db.LoadMultipleUpdatesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 8
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesEfMiddleware.cs

@@ -2,25 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleUpdatesEfMiddleware
     public class MultipleUpdatesEfMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateEf));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateEf));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
-
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
         public MultipleUpdatesEfMiddleware(RequestDelegate next)
         public MultipleUpdatesEfMiddleware(RequestDelegate next)
@@ -37,7 +32,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var rows = await db.LoadMultipleUpdatesRows(count);
                 var rows = await db.LoadMultipleUpdatesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/MultipleUpdatesRawMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class MultipleUpdatesRawMiddleware
     public class MultipleUpdatesRawMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateRaw));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbMultiUpdateRaw));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -37,7 +33,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var rows = await db.LoadMultipleUpdatesRows(count);
                 var rows = await db.LoadMultipleUpdatesRows(count);
 
 
-                var result = JsonConvert.SerializeObject(rows, _jsonSettings);
+                var result = JsonSerializer.Serialize(rows, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryDapperMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class SingleQueryDapperMiddleware
     public class SingleQueryDapperMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryDapper));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryDapper));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -35,7 +31,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var db = httpContext.RequestServices.GetService<DapperDb>();
                 var row = await db.LoadSingleQueryRow();
                 var row = await db.LoadSingleQueryRow();
 
 
-                var result = JsonConvert.SerializeObject(row, _jsonSettings);
+                var result = JsonSerializer.Serialize(row, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryEfMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class SingleQueryEfMiddleware
     public class SingleQueryEfMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryEf));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryEf));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -34,7 +30,7 @@ namespace Benchmarks.Middleware
             {
             {
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var db = httpContext.RequestServices.GetService<EfDb>();
                 var row = await db.LoadSingleQueryRow();
                 var row = await db.LoadSingleQueryRow();
-                var result = JsonConvert.SerializeObject(row, _jsonSettings);
+                var result = JsonSerializer.Serialize(row, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 3 - 7
frameworks/CSharp/aspnetcore/Benchmarks/Middleware/SingleQueryRawMiddleware.cs

@@ -2,24 +2,20 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
 using System;
 using System;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
 
 
 namespace Benchmarks.Middleware
 namespace Benchmarks.Middleware
 {
 {
     public class SingleQueryRawMiddleware
     public class SingleQueryRawMiddleware
     {
     {
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryRaw));
         private static readonly PathString _path = new PathString(Scenarios.GetPath(s => s.DbSingleQueryRaw));
-        private static readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
-        {
-            ContractResolver = new CamelCasePropertyNamesContractResolver()
-        };
+        private static readonly JsonSerializerOptions _serializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase };
 
 
         private readonly RequestDelegate _next;
         private readonly RequestDelegate _next;
 
 
@@ -35,7 +31,7 @@ namespace Benchmarks.Middleware
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var db = httpContext.RequestServices.GetService<RawDb>();
                 var row = await db.LoadSingleQueryRow();
                 var row = await db.LoadSingleQueryRow();
 
 
-                var result = JsonConvert.SerializeObject(row, _jsonSettings);
+                var result = JsonSerializer.Serialize(row, _serializerOptions);
 
 
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.StatusCode = StatusCodes.Status200OK;
                 httpContext.Response.ContentType = "application/json";
                 httpContext.Response.ContentType = "application/json";

+ 5 - 10
frameworks/CSharp/aspnetcore/Benchmarks/Startup.cs

@@ -1,22 +1,20 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
-using System;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.Text.Encodings.Web;
-using System.Text.Unicode;
 using Benchmarks.Configuration;
 using Benchmarks.Configuration;
 using Benchmarks.Data;
 using Benchmarks.Data;
 using Benchmarks.Middleware;
 using Benchmarks.Middleware;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
 using MySqlConnector;
 using MySqlConnector;
 using Npgsql;
 using Npgsql;
+using System;
+using System.Data.Common;
+using System.Text.Encodings.Web;
+using System.Text.Unicode;
 
 
 namespace Benchmarks
 namespace Benchmarks
 {
 {
@@ -106,10 +104,7 @@ namespace Benchmarks
 
 
             if (Scenarios.Any("Mvc"))
             if (Scenarios.Any("Mvc"))
             {
             {
-                var mvcBuilder = services
-                    .AddMvcCore()
-                    .SetCompatibilityVersion(CompatibilityVersion.Latest)
-                    ;
+                var mvcBuilder = services.AddMvcCore();
 
 
                 if (Scenarios.MvcViews || Scenarios.Any("MvcDbFortunes"))
                 if (Scenarios.MvcViews || Scenarios.Any("MvcDbFortunes"))
                 {
                 {

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.json

@@ -1,4 +1,4 @@
 {
 {
-  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Delay Us=500;Write Coalescing Buffer Threshold Bytes=1000",
+  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000",
   "Database": "postgresql"
   "Database": "postgresql"
 }
 }

+ 1 - 1
frameworks/CSharp/aspnetcore/Benchmarks/appsettings.postgresql.updates.json

@@ -1,4 +1,4 @@
 {
 {
-  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Delay Us=500;Write Coalescing Buffer Threshold Bytes=1000",
+  "ConnectionString": "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=18;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000",
   "Database": "postgresql"
   "Database": "postgresql"
 }
 }

+ 1 - 1
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.Caching.cs

@@ -12,7 +12,7 @@ namespace PlatformBenchmarks
     {
     {
         private async Task Caching(PipeWriter pipeWriter, int count)
         private async Task Caching(PipeWriter pipeWriter, int count)
         {
         {
-            OutputMultipleQueries(pipeWriter, await Db.LoadCachedQueries(count));
+            OutputMultipleQueries(pipeWriter, await Db.LoadCachedQueries(count), SerializerContext.CachedWorldArray);
         }
         }
     }
     }
 }
 }

+ 1 - 41
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.HttpConnection.cs

@@ -112,21 +112,10 @@ namespace PlatformBenchmarks
 
 
             if (state == State.StartLine)
             if (state == State.StartLine)
             {
             {
-#if NET5_0
                 if (Parser.ParseRequestLine(new ParsingAdapter(this), ref reader))
                 if (Parser.ParseRequestLine(new ParsingAdapter(this), ref reader))
                 {
                 {
                     state = State.Headers;
                     state = State.Headers;
                 }
                 }
-#else
-                var unconsumedSequence = reader.Sequence.Slice(reader.Position);
-                if (Parser.ParseRequestLine(new ParsingAdapter(this), unconsumedSequence, out var consumed, out _))
-                {
-                    state = State.Headers;
-
-                    var parsedLength = unconsumedSequence.Slice(reader.Position, consumed).Length;
-                    reader.Advance(parsedLength);
-                }
-#endif
             }
             }
 
 
             if (state == State.Headers)
             if (state == State.Headers)
@@ -197,21 +186,10 @@ namespace PlatformBenchmarks
 
 
             if (state == State.StartLine)
             if (state == State.StartLine)
             {
             {
-#if NET5_0
                 if (Parser.ParseRequestLine(new ParsingAdapter(this), ref reader))
                 if (Parser.ParseRequestLine(new ParsingAdapter(this), ref reader))
                 {
                 {
                     state = State.Headers;
                     state = State.Headers;
                 }
                 }
-#else
-                var unconsumedSequence = reader.Sequence.Slice(reader.Position);
-                if (Parser.ParseRequestLine(new ParsingAdapter(this), unconsumedSequence, out var consumed, out _))
-                {
-                    state = State.Headers;
-
-                    var parsedLength = unconsumedSequence.Slice(reader.Position, consumed).Length;
-                    reader.Advance(parsedLength);
-                }
-#endif
             }
             }
 
 
             if (state == State.Headers)
             if (state == State.Headers)
@@ -246,8 +224,6 @@ namespace PlatformBenchmarks
         }
         }
 #endif
 #endif
 
 
-#if NET5_0
-
         public void OnStaticIndexedHeader(int index)
         public void OnStaticIndexedHeader(int index)
         {
         {
         }
         }
@@ -259,17 +235,10 @@ namespace PlatformBenchmarks
         public void OnHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
         public void OnHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
         {
         {
         }
         }
+
         public void OnHeadersComplete(bool endStream)
         public void OnHeadersComplete(bool endStream)
         {
         {
         }
         }
-#else
-        public void OnHeader(Span<byte> name, Span<byte> value)
-        {
-        }
-        public void OnHeadersComplete()
-        {
-        }
-#endif
 
 
         private static void ThrowUnexpectedEndOfData()
         private static void ThrowUnexpectedEndOfData()
         {
         {
@@ -311,7 +280,6 @@ namespace PlatformBenchmarks
             public ParsingAdapter(BenchmarkApplication requestHandler)
             public ParsingAdapter(BenchmarkApplication requestHandler)
                 => RequestHandler = requestHandler;
                 => RequestHandler = requestHandler;
 
 
-#if NET5_0
             public void OnStaticIndexedHeader(int index) 
             public void OnStaticIndexedHeader(int index) 
                 => RequestHandler.OnStaticIndexedHeader(index);
                 => RequestHandler.OnStaticIndexedHeader(index);
 
 
@@ -326,14 +294,6 @@ namespace PlatformBenchmarks
 
 
             public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
             public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
                 => RequestHandler.OnStartLine(versionAndMethod, targetPath, startLine);
                 => RequestHandler.OnStartLine(versionAndMethod, targetPath, startLine);
-#else
-            public void OnHeader(Span<byte> name, Span<byte> value)
-                => RequestHandler.OnHeader(name, value);
-            public void OnHeadersComplete()
-                => RequestHandler.OnHeadersComplete();
-            public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
-                => RequestHandler.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
-#endif
         }
         }
     }
     }
 }
 }

+ 2 - 3
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkApplication.Json.cs

@@ -1,7 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 
-using System;
 using System.Buffers;
 using System.Buffers;
 using System.Text.Json;
 using System.Text.Json;
 
 
@@ -9,7 +8,7 @@ namespace PlatformBenchmarks
 {
 {
     public partial class BenchmarkApplication
     public partial class BenchmarkApplication
     {
     {
-        private readonly static uint _jsonPayloadSize = (uint)JsonSerializer.SerializeToUtf8Bytes(new JsonMessage { message = "Hello, World!" }, SerializerOptions).Length;
+        private readonly static uint _jsonPayloadSize = (uint)JsonSerializer.SerializeToUtf8Bytes(new JsonMessage { message = "Hello, World!" }, SerializerContext.JsonMessage).Length;
 
 
         private readonly static AsciiString _jsonPreamble =
         private readonly static AsciiString _jsonPreamble =
             _http11OK +
             _http11OK +
@@ -30,7 +29,7 @@ namespace PlatformBenchmarks
             utf8JsonWriter.Reset(bodyWriter);
             utf8JsonWriter.Reset(bodyWriter);
 
 
             // Body
             // Body
-            JsonSerializer.Serialize<JsonMessage>(utf8JsonWriter, new JsonMessage { message = "Hello, World!" }, SerializerOptions);
+            JsonSerializer.Serialize(utf8JsonWriter, new JsonMessage { message = "Hello, World!" }, SerializerContext.JsonMessage);        
         }
         }
     }
     }
 }
 }

Some files were not shown because too many files changed in this diff