瀏覽代碼

Bump to ffead-cpp master version (#6772)

Sumeet Chhetri 3 年之前
父節點
當前提交
51559f9cfb
共有 56 個文件被更改,包括 2714 次插入1378 次删除
  1. 44 540
      frameworks/C++/ffead-cpp/benchmark_config.json
  2. 236 0
      frameworks/C++/ffead-cpp/benchmark_config_c1.json
  3. 157 0
      frameworks/C++/ffead-cpp/benchmark_config_c2.json
  4. 173 0
      frameworks/C++/ffead-cpp/benchmark_config_c3.json
  5. 752 0
      frameworks/C++/ffead-cpp/benchmark_config_orig.json
  6. 1 10
      frameworks/C++/ffead-cpp/ffead-cpp-base-debug.dockerfile
  7. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-crystal-h2o.dockerfile
  8. 2 4
      frameworks/C++/ffead-cpp/ffead-cpp-crystal-http.dockerfile
  9. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-d-hunt.dockerfile
  10. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-go-fasthttp.dockerfile
  11. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-go-gnet.dockerfile
  12. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-h2o.dockerfile
  13. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-java-base.dockerfile
  14. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-julia-http.dockerfile
  15. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-libreactor.dockerfile
  16. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p10-b.dockerfile
  17. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p10.dockerfile
  18. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p2-b.dockerfile
  19. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p2.dockerfile
  20. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p3-b.dockerfile
  21. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p3.dockerfile
  22. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p4-b.dockerfile
  23. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-p4.dockerfile
  24. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-pool-profiled.dockerfile
  25. 10 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-clibpqb-twoconn-profiled.dockerfile
  26. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-m.dockerfile
  27. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled-m.dockerfile
  28. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-pool-profiled.dockerfile
  29. 7 0
      frameworks/C++/ffead-cpp/ffead-cpp-postgresql-raw-async-profiled-m.dockerfile
  30. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-rust-base.dockerfile
  31. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-rust-rocket-base.dockerfile
  32. 93 0
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-clibpqb-pool-profiled-base.dockerfile
  33. 88 0
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-async-pool-profiled-base.dockerfile
  34. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-sql-raw-clibpqb-profiled-base.dockerfile
  35. 0 1
      frameworks/C++/ffead-cpp/ffead-cpp-swift-nio.dockerfile
  36. 1 1
      frameworks/C++/ffead-cpp/ffead-cpp-v-base.dockerfile
  37. 25 17
      frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-clibpqb-profiled-base.dockerfile
  38. 25 17
      frameworks/C++/ffead-cpp/ffead-cpp-v-picov-raw-profiled-base.dockerfile
  39. 8 8
      frameworks/C++/ffead-cpp/install-mimalloc-snmalloc.sh
  40. 1 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-backends.sh
  41. 13 11
      frameworks/C++/ffead-cpp/install_ffead-cpp-dependencies.sh
  42. 1 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-framework.sh
  43. 11 1
      frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-profiled.sh
  44. 5 0
      frameworks/C++/ffead-cpp/install_ffead-cpp-sql-raw-v-picov-profiled.sh
  45. 2 1
      frameworks/C++/ffead-cpp/run_ffead.sh
  46. 8 6
      frameworks/C++/ffead-cpp/sql-profiled-install-clang.sh
  47. 8 6
      frameworks/C++/ffead-cpp/sql-profiled-install.sh
  48. 26 3
      frameworks/C++/ffead-cpp/sql-profiled-util.sh
  49. 2 1
      frameworks/C++/ffead-cpp/sql-v-picov-profiled-install.sh
  50. 2 0
      frameworks/C++/ffead-cpp/te-benchmark-um-mgr/include/TeBkUmMgr.h
  51. 21 16
      frameworks/C++/ffead-cpp/te-benchmark-um-mgr/src/TeBkUmMgr.cpp
  52. 68 41
      frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/include/TeBkUmLpqAsync.h
  53. 459 411
      frameworks/C++/ffead-cpp/te-benchmark-um-pq-async/src/TeBkUmLpqAsync.cpp
  54. 21 19
      frameworks/C++/ffead-cpp/te-benchmark-um-pq/include/TeBkUmLpq.h
  55. 334 250
      frameworks/C++/ffead-cpp/te-benchmark-um-pq/src/TeBkUmLpq.cpp
  56. 1 1
      frameworks/C++/ffead-cpp/te-benchmark-um/src/TeBkUm.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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