Browse Source

Merge pull request #35 from TechEmpower/master

aa
三刀 1 year ago
parent
commit
f08a35be08
100 changed files with 725 additions and 2321 deletions
  1. 3 1
      Dockerfile
  2. 0 19
      frameworks/C++/silicon/CMakeLists.txt
  3. 0 8
      frameworks/C++/silicon/README.md
  4. 0 28
      frameworks/C++/silicon/benchmark_config.json
  5. 0 47
      frameworks/C++/silicon/build/symbols.hh
  6. 0 102
      frameworks/C++/silicon/build/techempower.hh
  7. 0 41
      frameworks/C++/silicon/build/techempower_lwan.cc
  8. 0 48
      frameworks/C++/silicon/build/techempower_microhttpd.cc
  9. 0 19
      frameworks/C++/silicon/config.toml
  10. 0 39
      frameworks/C++/silicon/silicon.dockerfile
  11. 2 2
      frameworks/C++/userver/userver-bare.dockerfile
  12. 2 2
      frameworks/C++/userver/userver.dockerfile
  13. 0 29
      frameworks/C/duda/README.md
  14. 0 24
      frameworks/C/duda/benchmark_config.json
  15. 0 13
      frameworks/C/duda/duda.dockerfile
  16. 0 7
      frameworks/C/duda/webservice/Makefile.in
  17. 0 81
      frameworks/C/duda/webservice/main.c
  18. 1 0
      frameworks/C/h2o/benchmark_config.json
  19. 6 4
      frameworks/C/h2o/src/database.c
  20. 2 2
      frameworks/C/h2o/src/database.h
  21. 115 60
      frameworks/C/h2o/src/handlers/world.c
  22. 3 3
      frameworks/CSharp/beetlex/Benchmarks.sln
  23. 2 3
      frameworks/CSharp/beetlex/Benchmarks/Benchmarks.csproj
  24. 5 4
      frameworks/CSharp/beetlex/Benchmarks/Program.cs
  25. 2 3
      frameworks/CSharp/beetlex/PlatformBenchmarks/DBRaw.cs
  26. 3 2
      frameworks/CSharp/beetlex/PlatformBenchmarks/GMTDate.cs
  27. 30 11
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.Caching.cs
  28. 201 151
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.cs
  29. 23 11
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.db.cs
  30. 14 10
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.default.cs
  31. 27 58
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.fortunes.cs
  32. 14 20
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.json.cs
  33. 3 5
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.plaintext.cs
  34. 32 13
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.queries.cs
  35. 14 11
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.updates.cs
  36. 23 17
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpServer.cs
  37. 57 57
      frameworks/CSharp/beetlex/PlatformBenchmarks/HttpToken.cs
  38. 19 0
      frameworks/CSharp/beetlex/PlatformBenchmarks/NetApplication.cs
  39. 6 6
      frameworks/CSharp/beetlex/PlatformBenchmarks/PlatformBenchmarks.csproj
  40. 6 0
      frameworks/CSharp/beetlex/PlatformBenchmarks/Program.cs
  41. 3 14
      frameworks/CSharp/beetlex/PlatformBenchmarks/RequestData.cs
  42. 0 12
      frameworks/CSharp/beetlex/beetlex-core-updb.dockerfile
  43. 2 2
      frameworks/CSharp/beetlex/beetlex-core.dockerfile
  44. 2 2
      frameworks/CSharp/beetlex/beetlex.dockerfile
  45. 0 19
      frameworks/CSharp/beetlex/benchmark_config.json
  46. 0 12
      frameworks/CSharp/beetlex/config.toml
  47. 6 6
      frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj
  48. 1 1
      frameworks/Crystal/grip/grip.cr
  49. 1 1
      frameworks/Crystal/grip/grip.dockerfile
  50. 2 2
      frameworks/Crystal/grip/shard.yml
  51. 0 7
      frameworks/Crystal/h2o.cr/README.md
  52. 0 26
      frameworks/Crystal/h2o.cr/benchmark_config.json
  53. 0 15
      frameworks/Crystal/h2o.cr/config.toml
  54. 0 24
      frameworks/Crystal/h2o.cr/h2o.cr.dockerfile
  55. 0 114
      frameworks/Crystal/h2o.cr/h2o_evloop_hello.cr
  56. 0 7
      frameworks/Crystal/h2o.cr/run.sh
  57. 0 15
      frameworks/Crystal/h2o.cr/shard.yml
  58. 1 1
      frameworks/Crystal/kemal/kemal-concurrent-queries.dockerfile
  59. 1 1
      frameworks/Crystal/kemal/kemal.dockerfile
  60. 21 21
      frameworks/Crystal/kemal/shard.lock
  61. 3 3
      frameworks/Crystal/kemal/shard.yml
  62. 0 5
      frameworks/Crystal/raze/README.md
  63. 0 28
      frameworks/Crystal/raze/benchmark_config.json
  64. 0 19
      frameworks/Crystal/raze/config.toml
  65. 0 107
      frameworks/Crystal/raze/raze.cr
  66. 0 17
      frameworks/Crystal/raze/raze.dockerfile
  67. 0 7
      frameworks/Crystal/raze/run.sh
  68. 0 22
      frameworks/Crystal/raze/shard.lock
  69. 0 18
      frameworks/Crystal/raze/shard.yml
  70. 0 20
      frameworks/Crystal/raze/views/fortunes.ecr
  71. 0 1
      frameworks/FSharp/oxpecker/README.md
  72. 3 0
      frameworks/FSharp/oxpecker/oxpecker.dockerfile
  73. 0 1
      frameworks/FSharp/oxpecker/src/App/App.fsproj
  74. 49 64
      frameworks/FSharp/oxpecker/src/App/Program.fs
  75. 1 1
      frameworks/Java/baratine/README.md
  76. 0 39
      frameworks/Java/comsat/README.md
  77. 0 83
      frameworks/Java/comsat/benchmark_config.json
  78. 0 100
      frameworks/Java/comsat/build.gradle
  79. 0 14
      frameworks/Java/comsat/comsat-servlet-undertow.dockerfile
  80. 0 14
      frameworks/Java/comsat/comsat-webactors-netty.dockerfile
  81. 0 14
      frameworks/Java/comsat/comsat-webactors-undertow.dockerfile
  82. 0 14
      frameworks/Java/comsat/comsat.dockerfile
  83. 0 54
      frameworks/Java/comsat/config.toml
  84. 0 6
      frameworks/Java/comsat/src/main/java/hello/Server.java
  85. 0 10
      frameworks/Java/comsat/src/main/java/hello/World.java
  86. 0 46
      frameworks/Java/comsat/src/main/java/hello/servlet/JettyServer.java
  87. 0 30
      frameworks/Java/comsat/src/main/java/hello/servlet/JsonServlet.java
  88. 0 24
      frameworks/Java/comsat/src/main/java/hello/servlet/PlaintextServlet.java
  89. 0 101
      frameworks/Java/comsat/src/main/java/hello/servlet/UndertowServer.java
  90. 0 68
      frameworks/Java/comsat/src/main/java/hello/webactors/NettyServer.java
  91. 0 57
      frameworks/Java/comsat/src/main/java/hello/webactors/UndertowServer.java
  92. 0 57
      frameworks/Java/comsat/src/main/java/hello/webactors/WebActor.java
  93. 1 1
      frameworks/Java/micronaut/gradle.properties
  94. 1 1
      frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile
  95. 3 3
      frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile
  96. 1 1
      frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile
  97. 3 3
      frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile
  98. 1 1
      frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile
  99. 3 3
      frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile
  100. 1 1
      frameworks/Java/micronaut/micronaut-graalvm.dockerfile

+ 3 - 1
Dockerfile

@@ -18,7 +18,10 @@ RUN apt-get -yqq update && \
       libpq-dev \
       libpq-dev \
       pkg-config \
       pkg-config \
       python3 \
       python3 \
+      python3-colorama \
       python3-dev \
       python3-dev \
+      python3-dnspython \
+      python3-packaging \
       python3-pip \
       python3-pip \
       python3-psutil \
       python3-psutil \
       python3-psycopg2 \
       python3-psycopg2 \
@@ -28,7 +31,6 @@ RUN apt-get -yqq update && \
     # Ubuntu's equivalent packages are too old and/or broken.
     # Ubuntu's equivalent packages are too old and/or broken.
     pip3 install \
     pip3 install \
       --break-system-packages \
       --break-system-packages \
-      colorama==0.3.1 \
       docker==7.0.0 \
       docker==7.0.0 \
       mysqlclient==2.2.4 \
       mysqlclient==2.2.4 \
       pymongo==4.7.2
       pymongo==4.7.2

+ 0 - 19
frameworks/C++/silicon/CMakeLists.txt

@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(silicon)
-
-include_directories(/include $ENV{MICROHTTPD_HOME}/include)
-
-link_directories(/lib $ENV{MICROHTTPD_HOME}/lib)
-
-add_definitions(-std=c++14 -ftemplate-depth=1024 -DNDEBUG -O3)
-
-add_executable(silicon_tpc_mysql techempower_microhttpd.cc)
-target_link_libraries(silicon_tpc_mysql microhttpd mysqlclient)
-
-add_executable(silicon_epoll_mysql techempower_microhttpd.cc)
-set_target_properties(silicon_epoll_mysql PROPERTIES COMPILE_FLAGS "-DTFB_USE_EPOLL")
-target_link_libraries(silicon_epoll_mysql microhttpd mysqlclient)
-
-add_executable(silicon_lwan_mysql techempower_lwan.cc)
-target_link_libraries(silicon_lwan_mysql mysqlclient lwan ubsan curl z pthread dl luajit-5.1)

+ 0 - 8
frameworks/C++/silicon/README.md

@@ -1,8 +0,0 @@
-# C++/silicon Benchmarking test
-
-Silicon is a C++ web framework located at https://github.com/matt-42/silicon
-
-### Note
-
-The `silicon-epoll-mysql` and `silicon-lwan-mysql` tests are currently not working. They have been removed from the `benchmark_config.json` file but the implementations still exist. You can see the old `benchmark_config.json` [here](https://github.com/TechEmpower/FrameworkBenchmarks/blob/5d44d57cbb5cbc209a2d6aeb23010b466c055200/frameworks/C%2B%2B/silicon/benchmark_config.json).
-

+ 0 - 28
frameworks/C++/silicon/benchmark_config.json

@@ -1,28 +0,0 @@
-{
-  "framework": "silicon",
-  "tests": [{
-    "default": {
-      "json_url"       : "/json",
-      "db_url"         : "/db",
-      "query_url"      : "/queries?queries=",
-      "fortune_url"    : "/fortunes",
-      "update_url"     : "/updates?queries=",
-      "plaintext_url"  : "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Micro",
-      "database": "MySQL",
-      "framework": "silicon",
-      "language": "C++",
-      "flavor": "None",
-      "orm": "Full",
-      "platform": "None",
-      "webserver": "microhttpd",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "silicon-tpc-mysql",
-      "notes": "",
-      "versus": "silicon"
-    }
-  }]
-}

+ 0 - 47
frameworks/C++/silicon/build/symbols.hh

@@ -1,47 +0,0 @@
-// Generated by iod_generate_symbols.
-#include <iod/symbol.hh>
-#ifndef IOD_SYMBOL_db
-#define IOD_SYMBOL_db
-    iod_define_symbol(db)
-#endif
-
-#ifndef IOD_SYMBOL_fortunes
-#define IOD_SYMBOL_fortunes
-    iod_define_symbol(fortunes)
-#endif
-
-#ifndef IOD_SYMBOL_id
-#define IOD_SYMBOL_id
-    iod_define_symbol(id)
-#endif
-
-#ifndef IOD_SYMBOL_json
-#define IOD_SYMBOL_json
-    iod_define_symbol(json)
-#endif
-
-#ifndef IOD_SYMBOL_message
-#define IOD_SYMBOL_message
-    iod_define_symbol(message)
-#endif
-
-#ifndef IOD_SYMBOL_plaintext
-#define IOD_SYMBOL_plaintext
-    iod_define_symbol(plaintext)
-#endif
-
-#ifndef IOD_SYMBOL_queries
-#define IOD_SYMBOL_queries
-    iod_define_symbol(queries)
-#endif
-
-#ifndef IOD_SYMBOL_randomNumber
-#define IOD_SYMBOL_randomNumber
-    iod_define_symbol(randomNumber)
-#endif
-
-#ifndef IOD_SYMBOL_updates
-#define IOD_SYMBOL_updates
-    iod_define_symbol(updates)
-#endif
-

+ 0 - 102
frameworks/C++/silicon/build/techempower.hh

@@ -1,102 +0,0 @@
-#include <unistd.h>
-#include <iostream>
-#include <silicon/api.hh>
-#include <silicon/middleware_factories.hh>
-#include <silicon/middlewares/mysql_connection.hh>
-#include <silicon/middlewares/mysql_orm.hh>
-#include "symbols.hh"
-
-using namespace s;
-using namespace sl;
-
-typedef decltype(D(_id(_auto_increment, _primary_key) = int(),
-                   _randomNumber = int())) random_number;
-
-typedef decltype(D(_id(_auto_increment, _primary_key) = int(),
-                   _message = std::string())) fortune;
-
-typedef mysql_orm_factory<random_number> rn_orm_factory;
-typedef mysql_orm<random_number> rn_orm;
-
-typedef mysql_orm_factory<fortune> fortune_orm_factory;
-typedef mysql_orm<fortune> fortune_orm;
-
-
-std::string escape_html_entities(std::string& data)
-{
-    std::string buffer;
-    buffer.reserve(data.size());
-    for(size_t pos = 0; pos != data.size(); ++pos) {
-        switch(data[pos]) {
-            case '&':  buffer.append("&amp;");       break;
-            case '\"': buffer.append("&quot;");      break;
-            case '\'': buffer.append("&apos;");      break;
-            case '<':  buffer.append("&lt;");        break;
-            case '>':  buffer.append("&gt;");        break;
-            default:   buffer.append(&data[pos], 1); break;
-        }
-    }
-    return std::move(buffer);
-}
-
-auto techempower_api = http_api(
-
-  GET / _plaintext = [] () { return response(_content_type = string_ref("text/plain"),
-                                       _body = string_ref("Hello, World!")); },
-
-  GET / _json = [] () { return response(_content_type = string_ref("application/json"),
-                                  _body = D(_message = "Hello, World!")); },
-                        
-  GET / _db = [] (rn_orm& orm) {
-    random_number r;
-    orm.find_by_id(1245, r);
-    return response(_content_type = "application/json",
-                    _body = r);
-  },
-
-  GET / _queries * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
-    int N = atoi(param.queries.c_str());
-    N = std::max(1, std::min(N, 500));
-
-    std::vector<random_number> qs(N);
-    for (int i = 0; i < N; i++)
-      orm.find_by_id(1 + rand() % 9999, qs[i]);
-    return response(_content_type = "application/json",
-                    _body = std::move(qs));
-  },
-
-  GET / _updates * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
-    int N = atoi(param.queries.c_str());
-    N = std::max(1, std::min(N, 500));
-
-    std::vector<random_number> qs(N);
-    for (int i = 0; i < N; i++)
-    {
-      orm.find_by_id(1 + rand() % 9999, qs[i]);
-      qs[i].randomNumber = 1 + rand() % 9999;
-      orm.update(qs[i]);
-    }
-    return response(_content_type = "application/json",
-                    _body = std::move(qs));
-  },
-  
-  GET / _fortunes = [] (fortune_orm& orm) {
-    std::vector<fortune> table;
-    orm.forall([&] (fortune& f) { table.push_back(f); });
-    table.push_back(fortune(0, "Additional fortune added at request time."));
-
-    std::sort(table.begin(), table.end(),
-              [] (const fortune& a, const fortune& b) { return a.message < b.message; });
-
-    std::stringstream ss;
-
-    ss << "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
-    for(auto& f : table)
-      ss << "<tr><td>" << f.id << "</td><td>" << escape_html_entities(f.message) << "</td></tr>";
-    ss << "</table></body></html>";
-
-    return response(_content_type = "text/html; charset=utf-8",
-                    _body = ss.str());
-  }
-  
-  );

+ 0 - 41
frameworks/C++/silicon/build/techempower_lwan.cc

@@ -1,41 +0,0 @@
-#include <silicon/backends/lwan.hh>
-
-#include "techempower.hh"
-
-using namespace s;
-using namespace sl;
-
-int main(int argc, char* argv[])
-{
-  if (argc != 3)
-  {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port" << std::endl;
-    return 1;
-  }
-
-  auto techempower_middlewares = middleware_factories(
-    mysql_connection_factory(argv[1], "benchmarkdbuser", "benchmarkdbpass", "hello_world"),
-    fortune_orm_factory("Fortune"),
-    rn_orm_factory("World")
-    );
-  
-  try
-  {
-
-    // Write the pid.
-    std::ofstream pidfile(argv[3]);
-    pidfile << getpid() << std::endl;
-    pidfile.close();
-
-    // Start the server.
-    sl::lwan_json_serve(techempower_api, techempower_middlewares, atoi(argv[2]));
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-  catch (sl::error::error& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-}

+ 0 - 48
frameworks/C++/silicon/build/techempower_microhttpd.cc

@@ -1,48 +0,0 @@
-#include <silicon/backends/mhd.hh>
-
-#include "techempower.hh"
-
-using namespace s;
-using namespace sl;
-
-int main(int argc, char* argv[])
-{
-
-  if (argc != 4)
-  {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port nthreads" << std::endl;
-    return 1;
-  }
-
-  auto techempower_middlewares = middleware_factories(
-    mysql_connection_factory(argv[1], "benchmarkdbuser", "benchmarkdbpass", "hello_world"),
-    fortune_orm_factory("Fortune"),
-    rn_orm_factory("World")
-    );
-  
-  try
-  {
-    // Write the pid.
-    std::ofstream pidfile(argv[3]);
-    pidfile << getpid() << std::endl;
-    pidfile.close();
-
-    // Start the server.
-    sl::mhd_json_serve(techempower_api, techempower_middlewares, atoi(argv[2]), _blocking
-#ifdef TFB_USE_EPOLL
-                       , _linux_epoll, _nthreads = atoi(argv[3])
-#else
-                       , _one_thread_per_connection
-#endif
-      );
-    
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-  catch (sl::error::error& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-}

+ 0 - 19
frameworks/C++/silicon/config.toml

@@ -1,19 +0,0 @@
-[framework]
-name = "silicon"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Micro"
-database = "MySQL"
-database_os = "Linux"
-os = "Linux"
-orm = "Full"
-platform = "None"
-webserver = "microhttpd"
-versus = "silicon"

+ 0 - 39
frameworks/C++/silicon/silicon.dockerfile

@@ -1,39 +0,0 @@
-FROM buildpack-deps:xenial
-
-RUN apt-get update -yqq && apt-get install -yqq software-properties-common cmake apt-transport-https
-
-RUN add-apt-repository -s "deb http://apt.llvm.org/`lsb_release -cs`/ llvm-toolchain-`lsb_release -cs`-3.9 main"
-RUN wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add -
-RUN apt-get update -yqq
-RUN apt-get install -yqq clang-3.9 lldb-3.9
-
-ENV MICROHTTPD_VERSION=0.9.39
-ENV MICROHTTPD=/libmicrohttpd
-ENV MICROHTTPD_HOME=$MICROHTTPD-$VERSION
-
-RUN wget http://mirror.ibcp.fr/pub/gnu/libmicrohttpd/libmicrohttpd-$MICROHTTPD_VERSION.tar.gz
-RUN tar xf libmicrohttpd-$MICROHTTPD_VERSION.tar.gz
-RUN cd libmicrohttpd-$MICROHTTPD_VERSION && \
-    ./configure --prefix=$MICROHTTPD_HOME && \
-    make install
-
-ENV PATH=${MICROHTTPD_HOME}/bin:${PATH}
-
-RUN apt-get install -yqq libboost-dev cmake
-
-ENV SILICON=/silicon
-
-COPY ./ ./
-
-RUN git clone https://github.com/matt-42/silicon.git && \
-    cd silicon && \
-    git checkout ecaf04887c9dbbf0f457afab1f487268f6aeffab && \
-    CC=clang-3.9 CXX=clang++-3.9 ./install.sh /
-
-RUN cd build && \
-    cmake .. -DCMAKE_CXX_COMPILER=clang++-3.9 && \
-    make silicon_tpc_mysql
-
-EXPOSE 8080
-
-CMD /build/silicon_tpc_mysql tfb-database 8080 $(nproc)

+ 2 - 2
frameworks/C++/userver/userver-bare.dockerfile

@@ -1,4 +1,4 @@
-FROM ghcr.io/userver-framework/ubuntu-userver-build-base:v2 AS builder
+FROM ghcr.io/userver-framework/ubuntu-22.04-userver-pg AS builder
 
 
 RUN apt update && \
 RUN apt update && \
     apt install -y lsb-release wget software-properties-common gnupg && \
     apt install -y lsb-release wget software-properties-common gnupg && \
@@ -6,7 +6,7 @@ RUN apt update && \
 
 
 WORKDIR /src
 WORKDIR /src
 RUN git clone https://github.com/userver-framework/userver.git && \
 RUN git clone https://github.com/userver-framework/userver.git && \
-    cd userver && git checkout c2ca5454f0b0e93dd0a2e082904dedda5cda3052
+    cd userver && git checkout ec1a3b07793f8d4cd0968cd61d8e6079d667a1e7
 
 
 COPY userver_benchmark/ ./
 COPY userver_benchmark/ ./
 RUN mkdir build && cd build && \
 RUN mkdir build && cd build && \

+ 2 - 2
frameworks/C++/userver/userver.dockerfile

@@ -1,4 +1,4 @@
-FROM ghcr.io/userver-framework/ubuntu-userver-build-base:v2 AS builder
+FROM ghcr.io/userver-framework/ubuntu-22.04-userver-pg AS builder
 
 
 RUN apt update && \
 RUN apt update && \
     apt install -y lsb-release wget software-properties-common gnupg && \
     apt install -y lsb-release wget software-properties-common gnupg && \
@@ -6,7 +6,7 @@ RUN apt update && \
 
 
 WORKDIR /src
 WORKDIR /src
 RUN git clone https://github.com/userver-framework/userver.git && \
 RUN git clone https://github.com/userver-framework/userver.git && \
-    cd userver && git checkout c2ca5454f0b0e93dd0a2e082904dedda5cda3052
+    cd userver && git checkout ec1a3b07793f8d4cd0968cd61d8e6079d667a1e7
 
 
 COPY userver_benchmark/ ./
 COPY userver_benchmark/ ./
 RUN mkdir build && cd build && \
 RUN mkdir build && cd build && \

+ 0 - 29
frameworks/C/duda/README.md

@@ -1,29 +0,0 @@
-# Duda I/O Benchmarking Test
-
-This is the web service used to benchmark Duda I/O web services framework.
-
-http://duda.io
-
-## Requirements
-
-Just the GNU C Compiler and a Linux system running Kernel version >= 2.6.32
-
-## Tests available
-
-### 1. JSON
-
-URL: /json
-
-### 6. Plain text
-
-URL: /plaintext
-
-## About pending tests
-
-Most of tests that are related to database query are pending and will be available for the next Round.
-
-## Contact
-
-Eduardo Silva <[email protected]>
-
-

+ 0 - 24
frameworks/C/duda/benchmark_config.json

@@ -1,24 +0,0 @@
-{
-  "framework": "duda",
-  "tests": [{
-    "default": {
-      "json_url": "/json",
-      "plaintext_url": "/plaintext",
-      "port": 2001,
-      "approach": "Realistic",
-      "classification": "Platform",
-      "database": "None",
-      "framework": "None",
-      "language": "C",
-      "flavor": "None",
-      "orm": "Raw",
-      "platform": "duda",
-      "webserver": "Monkey",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Duda I/O",
-      "notes": "",
-      "versus": "duda"
-    }
-  }]
-}

+ 0 - 13
frameworks/C/duda/duda.dockerfile

@@ -1,13 +0,0 @@
-FROM python:2.7
-
-COPY ./ ./
-# Get v0.31 (no official releases that work 2015-06-25)
-
-RUN git clone https://github.com/monkey/dudac.git
-RUN cd dudac && git checkout 7c3d5b03b09fb4cb5f5e338fff72df2e25e95ef0 && \
-    ./dudac -r && \
-    ./dudac -s
-
-EXPOSE 2001
-
-CMD ["./dudac/dudac", "-w", "webservice", "-p", "2001"]

+ 0 - 7
frameworks/C/duda/webservice/Makefile.in

@@ -1,7 +0,0 @@
-NAME    = ws
-CC      = gcc
-CFLAGS  = -g -Wall -O2
-LDFLAGS =
-DEFS    =
-INCDIR  =
-OBJECTS = main.o

+ 0 - 81
frameworks/C/duda/webservice/main.c

@@ -1,81 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-
-/*
- * Duda I/O Benchmark Tests
- * ========================
- * This web service is made for the performance contest made by
- * TechEmpower, mode details here:
- *
- *     http://www.techempower.com/benchmarks
- *
- * At the moment only Tests 1 & 6 are implemented.
- */
-
-#include "webservice.h"
-#include "packages/json/json.h"
-
-/* Test Macros (Tn) */
-#define JSON_CONTENT_TYPE    "Content-Type: application/json"
-#define PLAIN_CONTENT_TYPE   "Content-Type: text/plain"
-#define T6_BODY              "Hello, World!"
-
-DUDA_REGISTER("Duda I/O Benchmark Test", "WS Bench");
-
-/*
- * Test type 1: JSON serialization
- * ===============================
- * This test use the JSON API object to compose the JSON response
- */
-void cb_json(duda_request_t *dr)
-{
-    char *body;
-    int body_len;
-    json_t *j_root;
-
-    /* Instance the JSON object and compose the content */
-    j_root = json->create_object();
-    json->add_to_object(j_root,
-                        "message",
-                        json->create_string("Hello, World!"));
-
-    /* Format output to string */
-    body = json->print_unformatted_gc(dr, j_root);
-    body_len = strlen(body);
-
-    /* Delete the JSON tree */
-    json->delete(j_root);
-
-    /* Compose the response */
-    response->http_status(dr, 200);
-    response->http_header_n(dr, JSON_CONTENT_TYPE, sizeof(JSON_CONTENT_TYPE) - 1);
-    response->print(dr, body, body_len);
-    response->end(dr, NULL);
-}
-
-
-/*
- * Test type 6: Plaintext
- * ======================
- */
-void cb_plaintext(duda_request_t *dr)
-{
-    response->http_status(dr, 200);
-    response->http_header_n(dr, PLAIN_CONTENT_TYPE, sizeof(PLAIN_CONTENT_TYPE) - 1);
-    response->print(dr, T6_BODY, sizeof(T6_BODY) - 1);
-    response->end(dr, NULL);
-}
-
-int duda_main()
-{
-    /* load packages */
-    duda_load_package(json, "json");
-
-    /* let this web service own the virtual host */
-    conf->service_root();
-
-    /* set callbacks */
-    map->static_add("/json", "cb_json");            /* Test #1 */
-    map->static_add("/plaintext", "cb_plaintext");  /* Test #6 */
-
-    return 0;
-}

+ 1 - 0
frameworks/C/h2o/benchmark_config.json

@@ -1,5 +1,6 @@
 {
 {
   "framework": "h2o",
   "framework": "h2o",
+  "maintainers": ["volyrique"],
   "tests": [{
   "tests": [{
     "default": {
     "default": {
       "json_url": "/json",
       "json_url": "/json",

+ 6 - 4
frameworks/C/h2o/src/database.c

@@ -56,8 +56,8 @@ typedef struct {
 
 
 typedef struct {
 typedef struct {
 	list_t l;
 	list_t l;
-	const char *name;
-	const char *query;
+	char *name;
+	char *query;
 } prepared_statement_t;
 } prepared_statement_t;
 
 
 static h2o_socket_t *create_socket(int sd, h2o_loop_t *loop);
 static h2o_socket_t *create_socket(int sd, h2o_loop_t *loop);
@@ -713,8 +713,8 @@ void add_prepared_statement(const char *name, const char *query, list_t **prepar
 
 
 	memset(p, 0, sizeof(*p));
 	memset(p, 0, sizeof(*p));
 	p->l.next = *prepared_statements;
 	p->l.next = *prepared_statements;
-	p->name = name;
-	p->query = query;
+	p->name = h2o_strdup(NULL, name, SIZE_MAX).base;
+	p->query = h2o_strdup(NULL, query, SIZE_MAX).base;
 	*prepared_statements = &p->l;
 	*prepared_statements = &p->l;
 }
 }
 
 
@@ -791,6 +791,8 @@ void remove_prepared_statements(list_t *prepared_statements)
 			                                                        prepared_statements);
 			                                                        prepared_statements);
 
 
 			prepared_statements = prepared_statements->next;
 			prepared_statements = prepared_statements->next;
+			free(p->name);
+			free(p->query);
 			free(p);
 			free(p);
 		} while (prepared_statements);
 		} while (prepared_statements);
 }
 }

+ 2 - 2
frameworks/C/h2o/src/database.h

@@ -49,10 +49,10 @@ typedef struct db_query_param_t {
 	on_result_t on_result;
 	on_result_t on_result;
 	void (*on_timeout)(struct db_query_param_t *);
 	void (*on_timeout)(struct db_query_param_t *);
 	const char *command;
 	const char *command;
-	const char * const *paramValues;
-	const int *paramLengths;
 	const int *paramFormats;
 	const int *paramFormats;
+	const int *paramLengths;
 	const Oid *paramTypes;
 	const Oid *paramTypes;
+	const char * const *paramValues;
 	size_t nParams;
 	size_t nParams;
 	uint_fast32_t flags;
 	uint_fast32_t flags;
 	int resultFormat;
 	int resultFormat;

+ 115 - 60
frameworks/C/h2o/src/handlers/world.c

@@ -57,17 +57,18 @@
 // MAX_UPDATE_QUERY_LEN must be updated whenever UPDATE_QUERY_BEGIN, UPDATE_QUERY_ELEM,
 // MAX_UPDATE_QUERY_LEN must be updated whenever UPDATE_QUERY_BEGIN, UPDATE_QUERY_ELEM,
 // UPDATE_QUERY_MIDDLE, UPDATE_QUERY_ELEM2, and UPDATE_QUERY_END are changed.
 // UPDATE_QUERY_MIDDLE, UPDATE_QUERY_ELEM2, and UPDATE_QUERY_END are changed.
 #define UPDATE_QUERY_BEGIN "UPDATE " WORLD_TABLE_NAME " SET randomNumber = CASE id "
 #define UPDATE_QUERY_BEGIN "UPDATE " WORLD_TABLE_NAME " SET randomNumber = CASE id "
-#define UPDATE_QUERY_ELEM "WHEN %" PRIu32 " THEN %" PRIu32 " "
-#define UPDATE_QUERY_MIDDLE "ELSE randomNumber END WHERE id IN (%" PRIu32
-#define UPDATE_QUERY_ELEM2 ",%" PRIu32
+#define UPDATE_QUERY_ELEM "WHEN $%zu::integer THEN $%zu::integer "
+#define UPDATE_QUERY_MIDDLE "ELSE randomNumber END WHERE id IN ($1::integer"
+#define UPDATE_QUERY_ELEM2 ",$%zu::integer"
 #define UPDATE_QUERY_END ");"
 #define UPDATE_QUERY_END ");"
 
 
 #define MAX_UPDATE_QUERY_LEN(n) \
 #define MAX_UPDATE_QUERY_LEN(n) \
 	(sizeof(UPDATE_QUERY_BEGIN) + sizeof(UPDATE_QUERY_MIDDLE) + \
 	(sizeof(UPDATE_QUERY_BEGIN) + sizeof(UPDATE_QUERY_MIDDLE) + \
 	 sizeof(UPDATE_QUERY_END) - 1 - sizeof(UPDATE_QUERY_ELEM2) + \
 	 sizeof(UPDATE_QUERY_END) - 1 - sizeof(UPDATE_QUERY_ELEM2) + \
 	 (n) * (sizeof(UPDATE_QUERY_ELEM) - 1 + sizeof(UPDATE_QUERY_ELEM2) - 1 + \
 	 (n) * (sizeof(UPDATE_QUERY_ELEM) - 1 + sizeof(UPDATE_QUERY_ELEM2) - 1 + \
-	        3 * (sizeof(MKSTR(MAX_ID)) - 1) - 3 * (sizeof(PRIu32) - 1) - 3))
+	        3 * sizeof(MKSTR(MAX_QUERIES)) - 3 * (sizeof("%zu") - 1)))
 
 
+#define UPDATE_QUERY_NAME_PREFIX WORLD_TABLE_NAME "Update"
 #define USE_CACHE 2
 #define USE_CACHE 2
 #define WORLD_QUERY "SELECT * FROM " WORLD_TABLE_NAME " WHERE id = $1::integer;"
 #define WORLD_QUERY "SELECT * FROM " WORLD_TABLE_NAME " WHERE id = $1::integer;"
 
 
@@ -259,11 +260,16 @@ static int do_multiple_queries(bool do_update, bool use_cache, h2o_req_t *req)
 	size_t sz = base_size + num_query_in_progress * sizeof(query_param_t);
 	size_t sz = base_size + num_query_in_progress * sizeof(query_param_t);
 
 
 	if (do_update) {
 	if (do_update) {
-		const size_t reuse_size = (num_query_in_progress - 1) * sizeof(query_param_t);
-		const size_t update_query_len = MAX_UPDATE_QUERY_LEN(num_query);
+		size_t s = base_size + sizeof(query_param_t);
 
 
-		if (update_query_len > reuse_size)
-			sz += update_query_len - reuse_size;
+		s = (s + _Alignof(const char *) - 1) / _Alignof(const char *);
+		s = s * _Alignof(const char *) + 2 * num_query * sizeof(const char *);
+		s = (s + _Alignof(int) - 1) / _Alignof(int);
+		s = s * _Alignof(int) + 4 * num_query * sizeof(int);
+		s += sizeof(UPDATE_QUERY_NAME_PREFIX MKSTR(MAX_QUERIES));
+
+		if (s > sz)
+			sz = s;
 	}
 	}
 
 
 	multiple_query_ctx_t * const query_ctx = h2o_mem_alloc(sz);
 	multiple_query_ctx_t * const query_ctx = h2o_mem_alloc(sz);
@@ -332,65 +338,57 @@ static int do_multiple_queries(bool do_update, bool use_cache, h2o_req_t *req)
 
 
 static void do_updates(multiple_query_ctx_t *query_ctx)
 static void do_updates(multiple_query_ctx_t *query_ctx)
 {
 {
-	char *iter = (char *) (query_ctx->query_param + 1);
-	size_t sz = MAX_UPDATE_QUERY_LEN(query_ctx->num_result);
-
-	// Sort the results to avoid database deadlock.
-	qsort(query_ctx->res, query_ctx->num_result, sizeof(*query_ctx->res), compare_items);
-	query_ctx->query_param->param.command = iter;
-	query_ctx->query_param->param.nParams = 0;
-	query_ctx->query_param->param.on_result = on_update_result;
-	query_ctx->query_param->param.paramFormats = NULL;
-	query_ctx->query_param->param.paramLengths = NULL;
-	query_ctx->query_param->param.paramValues = NULL;
-	query_ctx->query_param->param.flags = 0;
+	size_t offset =
+		offsetof(multiple_query_ctx_t, res) + query_ctx->num_result * sizeof(*query_ctx->res);
 
 
-	int c = snprintf(iter, sz, UPDATE_QUERY_BEGIN);
-
-	if ((size_t) c >= sz)
-		goto error;
-
-	iter += c;
-	sz -= c;
-
-	for (size_t i = 0; i < query_ctx->num_result; i++) {
-		query_ctx->res[i].random_number = 1 + get_random_number(MAX_ID,
-		                                                        &query_ctx->ctx->random_seed);
-		c = snprintf(iter,
-		             sz,
-		             UPDATE_QUERY_ELEM,
-		             query_ctx->res[i].id,
-		             query_ctx->res[i].random_number);
+	offset = ((offset + _Alignof(query_param_t) - 1) / _Alignof(query_param_t));
+	offset = offset * _Alignof(query_param_t) + sizeof(query_param_t);
+	offset = (offset + _Alignof(const char *) - 1) / _Alignof(const char *);
+	offset *= _Alignof(const char *);
 
 
-		if ((size_t) c >= sz)
-			goto error;
+	const char ** const paramValues = (const char **) ((char *) query_ctx + offset);
+	const size_t nParams = query_ctx->num_result * 2;
 
 
-		iter += c;
-		sz -= c;
-	}
+	offset += nParams * sizeof(*paramValues);
+	offset = (offset + _Alignof(int) - 1) / _Alignof(int);
+	offset *= _Alignof(int);
 
 
-	c = snprintf(iter, sz, UPDATE_QUERY_MIDDLE, query_ctx->res->id);
+	int * const paramFormats = (int *) ((char *) query_ctx + offset);
+	int * const paramLengths = paramFormats + nParams;
+	char * const command = (char *) (paramLengths + nParams);
+	const size_t command_size =
+		sizeof(UPDATE_QUERY_NAME_PREFIX MKSTR(MAX_QUERIES)) - sizeof(UPDATE_QUERY_NAME_PREFIX) + 1;
+	const int c = snprintf(command + sizeof(UPDATE_QUERY_NAME_PREFIX) - 1,
+	                       command_size,
+	                       "%zu",
+	                       query_ctx->num_result);
 
 
-	if ((size_t) c >= sz)
+	if ((size_t) c >= command_size)
 		goto error;
 		goto error;
 
 
-	iter += c;
-	sz -= c;
-
-	for (size_t i = 1; i < query_ctx->num_result; i++) {
-		c = snprintf(iter, sz, UPDATE_QUERY_ELEM2, query_ctx->res[i].id);
-
-		if ((size_t) c >= sz)
-			goto error;
-
-		iter += c;
-		sz -= c;
-	}
-
-	c = snprintf(iter, sz, UPDATE_QUERY_END);
+	memcpy(command, UPDATE_QUERY_NAME_PREFIX, sizeof(UPDATE_QUERY_NAME_PREFIX) - 1);
+	// Sort the results to avoid database deadlock.
+	qsort(query_ctx->res, query_ctx->num_result, sizeof(*query_ctx->res), compare_items);
 
 
-	if ((size_t) c >= sz)
-		goto error;
+	for (size_t i = 0; i < query_ctx->num_result; i++) {
+		query_ctx->res[i].id = htonl(query_ctx->res[i].id);
+		query_ctx->res[i].random_number =
+				htonl(1 + get_random_number(MAX_ID, &query_ctx->ctx->random_seed));
+		paramFormats[2 * i] = 1;
+		paramFormats[2 * i + 1] = 1;
+		paramLengths[2 * i] = sizeof(query_ctx->res[i].id);
+		paramLengths[2 * i + 1] = sizeof(query_ctx->res[i].random_number);
+		paramValues[2 * i] = (const char *) &query_ctx->res[i].id;
+		paramValues[2 * i + 1] = (const char *) &query_ctx->res[i].random_number;
+	}
+
+	query_ctx->query_param->param.command = command;
+	query_ctx->query_param->param.flags = IS_PREPARED;
+	query_ctx->query_param->param.nParams = nParams;
+	query_ctx->query_param->param.on_result = on_update_result;
+	query_ctx->query_param->param.paramFormats = paramFormats;
+	query_ctx->query_param->param.paramLengths = paramLengths;
+	query_ctx->query_param->param.paramValues = paramValues;
 
 
 	if (execute_database_query(&query_ctx->ctx->request_handler_data.hello_world_db,
 	if (execute_database_query(&query_ctx->ctx->request_handler_data.hello_world_db,
 	                           &query_ctx->query_param->param)) {
 	                           &query_ctx->query_param->param)) {
@@ -726,8 +724,14 @@ static result_return_t on_update_result(db_query_param_t *param, PGresult *resul
 		query_ctx->gen = get_json_generator(&query_ctx->ctx->json_generator,
 		query_ctx->gen = get_json_generator(&query_ctx->ctx->json_generator,
 		                                    &query_ctx->ctx->json_generator_num);
 		                                    &query_ctx->ctx->json_generator_num);
 
 
-		if (query_ctx->gen)
+		if (query_ctx->gen) {
+			for (size_t i = 0; i < query_ctx->num_result; i++) {
+				query_ctx->res[i].id = ntohl(query_ctx->res[i].id);
+				query_ctx->res[i].random_number = ntohl(query_ctx->res[i].random_number);
+			}
+
 			serialize_items(query_ctx->res, query_ctx->num_result, &query_ctx->gen, query_ctx->req);
 			serialize_items(query_ctx->res, query_ctx->num_result, &query_ctx->gen, query_ctx->req);
+		}
 		else
 		else
 			send_error(INTERNAL_SERVER_ERROR, REQ_ERROR, query_ctx->req);
 			send_error(INTERNAL_SERVER_ERROR, REQ_ERROR, query_ctx->req);
 	}
 	}
@@ -887,6 +891,57 @@ void initialize_world_handlers(h2o_hostconf_t *hostconf,
                                h2o_access_log_filehandle_t *log_handle,
                                h2o_access_log_filehandle_t *log_handle,
                                request_handler_data_t *data)
                                request_handler_data_t *data)
 {
 {
+	char name[sizeof(UPDATE_QUERY_NAME_PREFIX MKSTR(MAX_QUERIES))];
+	char query[MAX_UPDATE_QUERY_LEN(MAX_QUERIES)];
+	const size_t name_size = sizeof(name) - sizeof(UPDATE_QUERY_NAME_PREFIX) + 1;
+
+	assert(sizeof(name) >= sizeof(UPDATE_QUERY_NAME_PREFIX));
+	memcpy(name, UPDATE_QUERY_NAME_PREFIX, sizeof(UPDATE_QUERY_NAME_PREFIX) - 1);
+	assert(sizeof(query) >= sizeof(UPDATE_QUERY_BEGIN));
+	memcpy(query, UPDATE_QUERY_BEGIN, sizeof(UPDATE_QUERY_BEGIN) - 1);
+
+	for (size_t i = 0; i < MAX_QUERIES; i++) {
+		char *iter = query + sizeof(UPDATE_QUERY_BEGIN) - 1;
+		size_t sz = sizeof(query) - sizeof(UPDATE_QUERY_BEGIN) + 1;
+		int c = snprintf(name + sizeof(UPDATE_QUERY_NAME_PREFIX) - 1, name_size, "%zu", i + 1);
+
+		if ((size_t) c >= name_size)
+			continue;
+
+		for (size_t j = 0; j <= i; j++) {
+			c = snprintf(iter,
+			             sz,
+			             UPDATE_QUERY_ELEM,
+			             2 * j + 1,
+			             2 * j + 2);
+
+			if ((size_t) c >= sz)
+				continue;
+
+			iter += c;
+			sz -= c;
+		}
+
+		assert(sz >= sizeof(UPDATE_QUERY_MIDDLE));
+		memcpy(iter, UPDATE_QUERY_MIDDLE, sizeof(UPDATE_QUERY_MIDDLE) - 1);
+		iter += sizeof(UPDATE_QUERY_MIDDLE) - 1;
+		sz -= sizeof(UPDATE_QUERY_MIDDLE) - 1;
+
+		for (size_t j = 1; j <= i; j++) {
+			c = snprintf(iter, sz, UPDATE_QUERY_ELEM2, 2 * j + 1);
+
+			if ((size_t) c >= sz)
+				continue;
+
+			iter += c;
+			sz -= c;
+		}
+
+		assert(sz >= sizeof(UPDATE_QUERY_END));
+		memcpy(iter, UPDATE_QUERY_END, sizeof(UPDATE_QUERY_END));
+		add_prepared_statement(name, query, &data->prepared_statements);
+	}
+
 	add_prepared_statement(WORLD_TABLE_NAME, WORLD_QUERY, &data->prepared_statements);
 	add_prepared_statement(WORLD_TABLE_NAME, WORLD_QUERY, &data->prepared_statements);
 	register_request_handler("/cached-worlds", cached_queries, hostconf, log_handle);
 	register_request_handler("/cached-worlds", cached_queries, hostconf, log_handle);
 	register_request_handler("/db", single_query, hostconf, log_handle);
 	register_request_handler("/db", single_query, hostconf, log_handle);

+ 3 - 3
frameworks/CSharp/beetlex/Benchmarks.sln

@@ -1,11 +1,11 @@
 
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28010.2036
+# Visual Studio Version 17
+VisualStudioVersion = 17.9.34728.123
 MinimumVisualStudioVersion = 10.0.40219.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{12CA0190-5EA2-460F-ABC4-FAD454148EBF}"
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Benchmarks\Benchmarks.csproj", "{12CA0190-5EA2-460F-ABC4-FAD454148EBF}"
 EndProject
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlatformBenchmarks", "PlatformBenchmarks\PlatformBenchmarks.csproj", "{8ACF83AD-E861-4642-BEF3-A6211F99389D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlatformBenchmarks", "PlatformBenchmarks\PlatformBenchmarks.csproj", "{8ACF83AD-E861-4642-BEF3-A6211F99389D}"
 EndProject
 EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 2 - 3
frameworks/CSharp/beetlex/Benchmarks/Benchmarks.csproj

@@ -2,13 +2,12 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
-    <TargetFramework>net5.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ServerGarbageCollection>true</ServerGarbageCollection>
     <ServerGarbageCollection>true</ServerGarbageCollection>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <PackageReference Include="BeetleX.FastHttpApi" Version="1.9.6" />
     <PackageReference Include="BeetleX.FastHttpApi" Version="1.9.6" />
     <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
     <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
-    <PackageReference Include="Npgsql" Version="5.0.0-alpha1" />
-    <PackageReference Include="SpanJson" Version="3.0.1" />
+    <PackageReference Include="Npgsql" Version="8.0.3" />
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 5 - 4
frameworks/CSharp/beetlex/Benchmarks/Program.cs

@@ -6,9 +6,9 @@ using System;
 using System.Threading;
 using System.Threading;
 using System.Text;
 using System.Text;
 using BeetleX.Buffers;
 using BeetleX.Buffers;
-using SpanJson;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using BeetleX.EventArgs;
 using BeetleX.EventArgs;
+using System.Text.Json;
 
 
 namespace Benchmarks
 namespace Benchmarks
 {
 {
@@ -109,8 +109,8 @@ namespace Benchmarks
                 mComplete.TrySetResult(new object());
                 mComplete.TrySetResult(new object());
             };
             };
             mApiServer.Open();
             mApiServer.Open();
-            RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Delay Us=500;Write Coalescing Buffer Threshold Bytes=1000";
-            //RawDb._connectionString = "Server=192.168.2.19;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
+            RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
+            //RawDb._connectionString = "Server=localhost;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
             await mComplete.Task;
             await mComplete.Task;
         }
         }
 
 
@@ -140,7 +140,8 @@ namespace Benchmarks
 
 
         public override void Write(PipeStream stream, HttpResponse response)
         public override void Write(PipeStream stream, HttpResponse response)
         {
         {
-            JsonSerializer.NonGeneric.Utf8.SerializeAsync(Data, stream);
+
+            JsonSerializer.Serialize(stream, Data); ;
         }
         }
 
 
 
 

+ 2 - 3
frameworks/CSharp/beetlex/PlatformBenchmarks/DBRaw.cs

@@ -7,11 +7,11 @@ using System.Linq;
 using System.Runtime.Versioning;
 using System.Runtime.Versioning;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
-using System.Runtime.InteropServices.ComTypes;
-using BeetleX.EventArgs;
+
 using Microsoft.Extensions.Caching.Memory;
 using Microsoft.Extensions.Caching.Memory;
 using Npgsql;
 using Npgsql;
 
 
+
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
     public class RawDb
     public class RawDb
@@ -342,7 +342,6 @@ namespace PlatformBenchmarks
                     }
                     }
                 }
                 }
                 mInited = true;
                 mInited = true;
-                HttpServer.ApiServer.Log(LogType.Info, null, $"Init update commands cached");
                 return;
                 return;
             }
             }
         }
         }

+ 3 - 2
frameworks/CSharp/beetlex/PlatformBenchmarks/GMTDate.cs

@@ -1,4 +1,5 @@
-using BeetleX.Buffers;
+
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Text;
 using System.Text;
@@ -99,7 +100,7 @@ namespace PlatformBenchmarks
             return GetData(DateTime.Now);
             return GetData(DateTime.Now);
         }
         }
 
 
-        public void Write(PipeStream stream)
+        public void Write(IStreamWriter stream)
         {
         {
             var data = DATE;
             var data = DATE;
             stream.Write(data.Array, 0, data.Count);
             stream.Write(data.Array, 0, data.Count);

+ 30 - 11
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.Caching.cs

@@ -1,18 +1,18 @@
-using BeetleX;
-using BeetleX.Buffers;
-using SpanJson;
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
     public partial class HttpHandler
     public partial class HttpHandler
     {
     {
-       
 
 
-        public async Task caching(string queryString, PipeStream stream, HttpToken token, ISession session)
+
+        public async Task caching(string queryString, IStreamWriter stream)
         {
         {
             int count = 1;
             int count = 1;
             if (!string.IsNullOrEmpty(queryString))
             if (!string.IsNullOrEmpty(queryString))
@@ -30,20 +30,39 @@ namespace PlatformBenchmarks
                 count = 500;
                 count = 500;
             if (count < 1)
             if (count < 1)
                 count = 1;
                 count = 1;
+            ContentLengthMemory content = new ContentLengthMemory();
             try
             try
             {
             {
-                var data = await token.Db.LoadCachedQueries(count);
+                var data = await _db.LoadCachedQueries(count);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
-                token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+                content.Data = GetContentLengthMemory(stream);
                 GMTDate.Default.Write(stream);
                 GMTDate.Default.Write(stream);
-                token.ContentPostion = stream.CacheLength;
-                await JsonSerializer.NonGeneric.Utf8.SerializeAsync(data, stream);
+                stream.WriteSequenceNetStream.StartWriteLength();
+
+                var jsonWriter = GetJsonWriter(stream);
+                using (var unflush = stream.UnFlush())
+                {
+                    jsonWriter.WriteStartArray();
+                    foreach (var item in data)
+                    {
+                        jsonWriter.WriteStartObject();
+                        jsonWriter.WriteNumber("Id", item.Id);
+                        jsonWriter.WriteNumber("RandomNumber", item.RandomNumber);
+                        jsonWriter.WriteEndObject();
+                    }
+                    jsonWriter.WriteEndArray();
+                    jsonWriter.Flush();
+
+                }
             }
             }
             catch (Exception e_)
             catch (Exception e_)
             {
             {
-                stream.Write(e_.Message);
+                Context.GetLoger(BeetleX.Light.Logs.LogLevel.Error)?.WriteException(Context, "PlatformBenchmarks", "caching", e_);
+                stream.WriteString(e_.Message);
             }
             }
-            OnCompleted(stream, session, token);
+            var len = stream.WriteSequenceNetStream.EndWriteLength();
+            content.Full(len);
+
         }
         }
     }
     }
 }
 }

+ 201 - 151
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.cs

@@ -1,15 +1,21 @@
-using BeetleX;
-using BeetleX.Buffers;
-using BeetleX.EventArgs;
-using SpanJson;
+using BeetleX.Light;
+using BeetleX.Light.Memory;
 using System;
 using System;
+using System.Buffers;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
+using System.IO.Pipelines;
 using System.Text;
 using System.Text;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
-    public partial class HttpHandler : ServerHandlerBase
+
+
+
+
+    public partial class HttpHandler : SesionBase
     {
     {
         private static readonly AsciiString _line = new AsciiString("\r\n");
         private static readonly AsciiString _line = new AsciiString("\r\n");
 
 
@@ -45,7 +51,7 @@ namespace PlatformBenchmarks
 
 
         private static readonly AsciiString _cached_worlds = "/cached-worlds";
         private static readonly AsciiString _cached_worlds = "/cached-worlds";
 
 
-        private readonly static uint _jsonPayloadSize = (uint)System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(new JsonMessage { message = "Hello, World!" }, SerializerOptions).Length;
+        private readonly static uint _jsonPayloadSize = (uint)System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(new JsonMessage { message = "Hello, World!" }).Length;
 
 
 
 
 
 
@@ -65,14 +71,12 @@ namespace PlatformBenchmarks
         private readonly static AsciiString _jsonResultPreamble =
         private readonly static AsciiString _jsonResultPreamble =
         _httpsuccess
         _httpsuccess
         + _headerContentTypeJson
         + _headerContentTypeJson
-        + _headerServer
-       + _headerContentLength;
+        + _headerServer;
 
 
         private readonly static AsciiString _HtmlResultPreamble =
         private readonly static AsciiString _HtmlResultPreamble =
       _httpsuccess
       _httpsuccess
       + _headerContentTypeHtml
       + _headerContentTypeHtml
-      + _headerServer
-     + _headerContentLength;
+      + _headerServer;
 
 
 
 
 
 
@@ -83,24 +87,49 @@ namespace PlatformBenchmarks
 
 
         private static byte _question = 63;
         private static byte _question = 63;
 
 
-        public HttpHandler()
+        struct ContentLengthMemory
+        {
+            public Memory<byte> Data { get; set; }
+
+            public void Full(int length)
+            {
+                _headerContentLength.Data.CopyTo(Data);
+                var span = Data.Slice(_headerContentLength.Length).Span;
+                var len = span.Write(length.ToString(), Encoding.ASCII);
+                for (int i = len; i < span.Length - 2; i++)
+                {
+                    span[i] = 32;
+                }
+                span[^2] = 13;
+                span[^1] = 10;
+            }
+        }
+
+
+        protected Memory<byte> GetContentLengthMemory(IStreamWriter writer)
         {
         {
-            RequestDispatchs = new BeetleX.Dispatchs.DispatchCenter<HttpToken>(OnRequest, Math.Min(Environment.ProcessorCount, 16));
+            var result = writer.WriteSequenceNetStream.GetWriteMemory(28);
+            writer.WriteSequenceNetStream.WriteAdvance(28);
+            return result;
         }
         }
 
 
-        private BeetleX.Dispatchs.DispatchCenter<HttpToken> RequestDispatchs;
+        public NetContext Context { get; set; }
+
+        public HttpHandler()
+        {
 
 
+        }
 
 
+        private Queue<RequestData> _Requests = new Queue<RequestData>();
 
 
-        public override void Connected(IServer server, ConnectedEventArgs e)
+        private RawDb _db;
+
+        private RequestData _ReadRequest = null;
+        public override void Connected(NetContext context)
         {
         {
-            base.Connected(server, e);
-            e.Session.Socket.NoDelay = true;
-            var token = new HttpToken();
-            token.ThreadDispatcher = RequestDispatchs.Next();
-            token.Session = e.Session;
-            token.Db = new RawDb(new ConcurrentRandom(), Npgsql.NpgsqlFactory.Instance);
-            e.Session.Tag = token;
+            base.Connected(context);
+            this.Context = context;
+            _db = new RawDb(new ConcurrentRandom(), Npgsql.NpgsqlFactory.Instance); ;
         }
         }
 
 
         private int AnalysisUrl(ReadOnlySpan<byte> url)
         private int AnalysisUrl(ReadOnlySpan<byte> url)
@@ -114,195 +143,216 @@ namespace PlatformBenchmarks
 
 
         }
         }
 
 
-        private void OnRequest(HttpToken token)
+        public override void Receive(NetContext context, object message)
         {
         {
-            if (token.Requests.TryDequeue(out RequestData result))
+            var stream = context.Reader.ReadSequenceNetStream;
+            var reader = stream.GetReadOnlySequence();
+            var len = reader.IndexOf(_line);
+            while (len != null)
             {
             {
-                OnStartRequest(result, token.Session, token, token.Session.Stream.ToPipeStream());
-            }
-        }
-
-        public override void SessionReceive(IServer server, SessionReceiveEventArgs e)
-        {
-            base.SessionReceive(server, e);
-            PipeStream pipeStream = e.Session.Stream.ToPipeStream();
-            HttpToken token = (HttpToken)e.Session.Tag;
-            var result = pipeStream.IndexOfLine();
-            while (result.End != null)
-            {
-                if (result.Length == 2)
+                var lendata = len.Value;
+                stream.ReadAdvance(lendata.Length);
+                if (lendata.Length == 2)
                 {
                 {
-                    pipeStream.ReadFree(result.Length);
-                    OnStartRequest(token.CurrentRequest, e.Session, token, pipeStream);
+                    _Requests.Enqueue(_ReadRequest);
+                    _ReadRequest = null;
                 }
                 }
                 else
                 else
                 {
                 {
-                    if (token.CurrentRequest == null)
+                    if (_ReadRequest == null)
+                    {
+                        _ReadRequest = new RequestData();
+                    }
+                    if (_ReadRequest.Action == null)
                     {
                     {
-                        var request = new RequestData();
-                        byte[] buffer = null;
-                        buffer = new byte[result.Length];
-                        pipeStream.Read(buffer, 0, result.Length);
-                        request.Data = new ArraySegment<byte>(buffer, 0, result.Length);
-                        AnalysisAction(request);
-                        if (request.Action == ActionType.Plaintext)
-                        {
-                            token.CurrentRequest = request;
-                        }
-                        else
-                        {
-                            token.CurrentRequest = request;
-                            pipeStream.ReadFree((int)pipeStream.Length);
-                            OnStartRequest(request, e.Session, token, pipeStream);
-                            return;
-                        }
+                        AnalysisAction(lendata, out var type, out var querystring);
+                        _ReadRequest.Action = type;
+                        _ReadRequest.QueryString = querystring;
+
                     }
                     }
                     else
                     else
                     {
                     {
-                        pipeStream.ReadFree(result.Length);
+
                     }
                     }
                 }
                 }
-                if (pipeStream.Length > 0)
-                    result = pipeStream.IndexOfLine();
-                else
-                    break;
+                reader = stream.GetReadOnlySequence();
+                len = reader.IndexOf(_line);
+            }
+            if (_Requests.Count > 0)
+            {
+                OnStartRequest(context.Writer);
             }
             }
         }
         }
 
 
-        private void AnalysisAction(RequestData requestData)
+        //public override void SessionReceive(IServer server, SessionReceiveEventArgs e)
+        //{
+        //    base.SessionReceive(server, e);
+        //    PipeStream pipeStream = e.Session.Stream.ToPipeStream();
+        //    HttpToken token = (HttpToken)e.Session.Tag;
+        //    var result = pipeStream.IndexOfLine();
+        //    while (result.End != null)
+        //    {
+        //        if (result.Length == 2)
+        //        {
+        //            pipeStream.ReadFree(result.Length);
+        //            OnStartRequest(token.CurrentRequest, e.Session, token, pipeStream);
+        //        }
+        //        else
+        //        {
+        //            if (token.CurrentRequest == null)
+        //            {
+        //                var request = new RequestData();
+        //                byte[] buffer = null;
+        //                buffer = new byte[result.Length];
+        //                pipeStream.Read(buffer, 0, result.Length);
+        //                request.Data = new ArraySegment<byte>(buffer, 0, result.Length);
+        //                AnalysisAction(request);
+        //                if (request.Action == ActionType.Plaintext)
+        //                {
+        //                    token.CurrentRequest = request;
+        //                }
+        //                else
+        //                {
+        //                    token.CurrentRequest = request;
+        //                    pipeStream.ReadFree((int)pipeStream.Length);
+        //                    OnStartRequest(request, e.Session, token, pipeStream);
+        //                    return;
+        //                }
+        //            }
+        //            else
+        //            {
+        //                pipeStream.ReadFree(result.Length);
+        //            }
+        //        }
+        //        if (pipeStream.Length > 0)
+        //            result = pipeStream.IndexOfLine();
+        //        else
+        //            break;
+        //    }
+        //}
+
+        private void AnalysisAction(ReadOnlySequence<byte> line, out ActionType type, out string queryString)
         {
         {
-            var line = _line.AsSpan();
-            int len = requestData.Data.Count;
-            var receiveData = requestData.GetSpan();
-            ReadOnlySpan<byte> http = line;
-            ReadOnlySpan<byte> method = line;
-            ReadOnlySpan<byte> url = line;
-            int offset2 = 0;
-            int count = 0;
-            for (int i = 0; i < len; i++)
-            {
-                if (receiveData[i] == line[0])
-                {
-                    http = receiveData.Slice(offset2, i - offset2);
-                    break;
-                }
-                else
-                {
-                    if (receiveData[i] == _Space)
-                    {
-                        if (count != 0)
-                        {
-                            url = receiveData.Slice(offset2, i - offset2);
-                            offset2 = i + 1;
-                        }
-                        else
-                        {
-                            method = receiveData.Slice(offset2, i - offset2);
-                            offset2 = i + 1;
-                            count++;
-                        }
-                    }
-                }
-            }
-            int queryIndex = AnalysisUrl(url);
-            ReadOnlySpan<byte> baseUrl = default;
-            ReadOnlySpan<byte> queryString = default;
-            if (queryIndex > 0)
+            type = ActionType.Plaintext;
+            queryString = default;
+            var spanIndex = line.PositionOf((byte)32);
+            var postion = line.GetPosition(1, spanIndex.Value);
+            line = line.Slice(postion);
+            spanIndex = line.PositionOf((byte)32);
+            var url = line.Slice(0, spanIndex.Value);
+            int baseurlLen = 0;
+            spanIndex = url.PositionOf((byte)63);
+            if (spanIndex != null)
             {
             {
-                baseUrl = url.Slice(0, queryIndex);
-                queryString = url.Slice(queryIndex + 1, url.Length - queryIndex - 1);
-                requestData.QueryString = Encoding.ASCII.GetString(queryString);
+                baseurlLen = (int)url.Slice(0, spanIndex.Value).Length;
+                queryString = url.Slice(baseurlLen + 1).ReadString(Encoding.ASCII);
             }
             }
             else
             else
             {
             {
-                baseUrl = url;
+                baseurlLen = (int)url.Length;
             }
             }
+
+            Span<byte> baseUrl = stackalloc byte[baseurlLen];
+            url.Slice(0, baseurlLen).CopyTo(baseUrl);
+
             if (baseUrl.Length == _path_Plaintext.Length && baseUrl.StartsWith(_path_Plaintext))
             if (baseUrl.Length == _path_Plaintext.Length && baseUrl.StartsWith(_path_Plaintext))
             {
             {
-                requestData.Action = ActionType.Plaintext;
+                type = ActionType.Plaintext;
             }
             }
             else if (baseUrl.Length == _path_Json.Length && baseUrl.StartsWith(_path_Json))
             else if (baseUrl.Length == _path_Json.Length && baseUrl.StartsWith(_path_Json))
             {
             {
-                requestData.Action = ActionType.Json;
+                type = ActionType.Json;
             }
             }
             else if (baseUrl.Length == _path_Db.Length && baseUrl.StartsWith(_path_Db))
             else if (baseUrl.Length == _path_Db.Length && baseUrl.StartsWith(_path_Db))
             {
             {
-                requestData.Action = ActionType.Db;
+                type = ActionType.Db;
             }
             }
             else if (baseUrl.Length == _path_Queries.Length && baseUrl.StartsWith(_path_Queries))
             else if (baseUrl.Length == _path_Queries.Length && baseUrl.StartsWith(_path_Queries))
             {
             {
-                requestData.Action = ActionType.Queries;
+                type = ActionType.Queries;
             }
             }
 
 
             else if (baseUrl.Length == _cached_worlds.Length && baseUrl.StartsWith(_cached_worlds))
             else if (baseUrl.Length == _cached_worlds.Length && baseUrl.StartsWith(_cached_worlds))
             {
             {
-                requestData.Action = ActionType.Caching;
+                type = ActionType.Caching;
             }
             }
 
 
             else if (baseUrl.Length == _path_Updates.Length && baseUrl.StartsWith(_path_Updates))
             else if (baseUrl.Length == _path_Updates.Length && baseUrl.StartsWith(_path_Updates))
             {
             {
-                requestData.Action = ActionType.Updates;
+                type = ActionType.Updates;
             }
             }
             else if (baseUrl.Length == _path_Fortunes.Length && baseUrl.StartsWith(_path_Fortunes))
             else if (baseUrl.Length == _path_Fortunes.Length && baseUrl.StartsWith(_path_Fortunes))
             {
             {
-                requestData.Action = ActionType.Fortunes;
+                type = ActionType.Fortunes;
             }
             }
             else
             else
             {
             {
-                requestData.Action = ActionType.Other;
+                type = ActionType.Other;
             }
             }
         }
         }
 
 
-        public virtual async Task OnStartRequest(RequestData data, ISession session, HttpToken token, PipeStream stream)
+        public async Task OnStartRequest(IStreamWriter stream)
         {
         {
-            ActionType type = data.Action;
-            if (type == ActionType.Plaintext)
-            {
-                await Plaintext(stream, token, session);
-            }
-            else if (type == ActionType.Json)
-            {
-                await Json(stream, token, session);
-            }
-            else if (type == ActionType.Db)
-            {
-                await db(stream, token, session);
-            }
-            else if (type == ActionType.Queries)
-            {
-                await queries(data.QueryString, stream, token, session);
-            }
-            else if (type == ActionType.Caching)
-            {
-                await caching(data.QueryString, stream, token, session);
-            }
-            else if (type == ActionType.Updates)
-            {
-                await updates(data.QueryString, stream, token, session);
-            }
-            else if (type == ActionType.Fortunes)
+            bool haveData = false;
+            while (_Requests.Count > 0)
             {
             {
-                await fortunes(stream, token, session);
+                haveData = true;
+                var data = _Requests.Dequeue();
+                ActionType type = data.Action.Value;
+                if (type == ActionType.Plaintext)
+                {
+                    Plaintext(stream);
+                }
+                else if (type == ActionType.Json)
+                {
+                    Json(stream);
+                }
+                else if (type == ActionType.Db)
+                {
+                    await db(stream);
+                }
+                else if (type == ActionType.Queries)
+                {
+                    await queries(data.QueryString, stream);
+                }
+                else if (type == ActionType.Caching)
+                {
+                    await caching(data.QueryString, stream);
+                }
+                else if (type == ActionType.Updates)
+                {
+                    await updates(data.QueryString, stream);
+                }
+                else if (type == ActionType.Fortunes)
+                {
+                    await fortunes(stream);
+                }
+                else
+                {
+                    await Default(stream);
+                }
             }
             }
-            else
+            if (haveData)
             {
             {
-                await Default(stream, token, session);
+                stream.Flush();
             }
             }
-
         }
         }
 
 
 
 
-        private void OnCompleted(PipeStream stream, ISession session, HttpToken token)
+
+
+        private Utf8JsonWriter GetJsonWriter(IStreamWriter stream)
         {
         {
-            var type = token.CurrentRequest.Action;
-            if (type != ActionType.Plaintext && type != ActionType.Json)
-            {
-                token.FullLength((stream.CacheLength - token.ContentPostion).ToString());
-            }
-            if (token.Requests.IsEmpty && stream.Length == 0)
-                session.Stream.Flush();
-            token.CurrentRequest = null;
+            Utf8JsonWriter utf8JsonWriter = _utf8JsonWriter ??= new Utf8JsonWriter((Stream)stream.WriteSequenceNetStream, new JsonWriterOptions { SkipValidation = true });
+            utf8JsonWriter.Reset((Stream)stream.WriteSequenceNetStream);
+            return utf8JsonWriter;
         }
         }
+        [ThreadStatic]
+        private static Utf8JsonWriter _utf8JsonWriter;
 
 
+        public static JsonWriterOptions _jsonWriterOptions = new JsonWriterOptions
+        {
+            SkipValidation = true
+        };
     }
     }
 }
 }

+ 23 - 11
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.db.cs

@@ -1,8 +1,7 @@
-using BeetleX;
-using BeetleX.Buffers;
-using SpanJson;
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -12,23 +11,36 @@ namespace PlatformBenchmarks
     {
     {
 
 
 
 
-        public async ValueTask db(PipeStream stream, HttpToken token, ISession session)
+        public async Task db(IStreamWriter stream)
         {
         {
+            ContentLengthMemory content = new ContentLengthMemory();
+
             try
             try
             {
             {
-                var data = await token.Db.LoadSingleQueryRow();
+                var data = await _db.LoadSingleQueryRow();
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
-                token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+                content.Data = GetContentLengthMemory(stream);
                 GMTDate.Default.Write(stream);
                 GMTDate.Default.Write(stream);
-                token.ContentPostion = stream.CacheLength;
-                System.Text.Json.JsonSerializer.Serialize<World>(GetUtf8JsonWriter(stream, token), data, SerializerOptions);
+                stream.WriteSequenceNetStream.StartWriteLength();
+                var jsonWriter = GetJsonWriter(stream);
+                using (var unflush = stream.UnFlush())
+                {
+                    jsonWriter.WriteStartObject();
+                    jsonWriter.WriteNumber("Id", data.Id);
+                    jsonWriter.WriteNumber("RandomNumber", data.RandomNumber);
+                    jsonWriter.WriteEndObject();
+                    System.Text.Json.JsonSerializer.Serialize<World>((Stream)stream.WriteSequenceNetStream, data);
+                }
+
             }
             }
             catch (Exception e_)
             catch (Exception e_)
             {
             {
-                HttpServer.ApiServer.Log(BeetleX.EventArgs.LogType.Error, null, $"db error {e_.Message}@{e_.StackTrace}");
-                stream.Write(e_.Message);
+                Context.GetLoger(BeetleX.Light.Logs.LogLevel.Error)?.WriteException(Context, "PlatformBenchmarks", "db", e_);
+                stream.WriteString(e_.Message);
             }
             }
-            OnCompleted(stream, session, token);
+            var len = stream.WriteSequenceNetStream.EndWriteLength();
+            content.Full(len);
+
         }
         }
     }
     }
 }
 }

+ 14 - 10
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.default.cs

@@ -1,6 +1,7 @@
-using BeetleX;
-using BeetleX.Buffers;
+
+using BeetleX.Light.Memory;
 using System;
 using System;
+using System.Buffers;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
@@ -15,16 +16,19 @@ namespace PlatformBenchmarks
                + _headerContentTypeJson.ToString()
                + _headerContentTypeJson.ToString()
                + _headerServer.ToString();
                + _headerServer.ToString();
 
 
-        public Task Default(PipeStream stream, HttpToken token, ISession session)
-        {
+        public ValueTask Default(IStreamWriter stream)
+        { 
+            
             stream.Write(_defaultPreamble.Data, 0, _defaultPreamble.Length);
             stream.Write(_defaultPreamble.Data, 0, _defaultPreamble.Length);
-            token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+            ContentLengthMemory contentLength = new ContentLengthMemory();
+            contentLength.Data = GetContentLengthMemory(stream);
             GMTDate.Default.Write(stream);
             GMTDate.Default.Write(stream);
-            token.ContentPostion = stream.CacheLength;
-            stream.Write("<b> beetlex server</b><hr/>");
-            stream.Write("path not found!");
-            OnCompleted(stream, session, token);
-            return Task.CompletedTask;
+            stream.WriteSequenceNetStream.StartWriteLength();
+            stream.WriteString("<b> beetlex server</b><hr/>");
+            stream.WriteString("path not found!");
+            var length = stream.WriteSequenceNetStream.EndWriteLength();
+            contentLength.Full(length);
+            return ValueTask.CompletedTask;
         }
         }
     }
     }
 }
 }

+ 27 - 58
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.fortunes.cs

@@ -1,5 +1,5 @@
-using BeetleX;
-using BeetleX.Buffers;
+
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Globalization;
@@ -13,87 +13,56 @@ namespace PlatformBenchmarks
     public partial class HttpHandler
     public partial class HttpHandler
     {
     {
 
 
+        static readonly HtmlEncoder htmlEncoder = CreateHtmlEncoder();
+        static HtmlEncoder CreateHtmlEncoder()
+        {
+            var settings = new TextEncoderSettings(UnicodeRanges.BasicLatin, UnicodeRanges.Katakana, UnicodeRanges.Hiragana);
+            settings.AllowCharacter('\u2014'); // allow EM DASH through
+            return HtmlEncoder.Create(settings);
+        }
+
         private readonly static AsciiString _fortunesTableStart = "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
         private readonly static AsciiString _fortunesTableStart = "<!DOCTYPE html><html><head><title>Fortunes</title></head><body><table><tr><th>id</th><th>message</th></tr>";
         private readonly static AsciiString _fortunesRowStart = "<tr><td>";
         private readonly static AsciiString _fortunesRowStart = "<tr><td>";
         private readonly static AsciiString _fortunesColumn = "</td><td>";
         private readonly static AsciiString _fortunesColumn = "</td><td>";
         private readonly static AsciiString _fortunesRowEnd = "</td></tr>";
         private readonly static AsciiString _fortunesRowEnd = "</td></tr>";
         private readonly static AsciiString _fortunesTableEnd = "</table></body></html>";
         private readonly static AsciiString _fortunesTableEnd = "</table></body></html>";
 
 
-        protected HtmlEncoder HtmlEncoder { get; } = CreateHtmlEncoder();
-
-        private static HtmlEncoder CreateHtmlEncoder()
-        {
-            var settings = new TextEncoderSettings(UnicodeRanges.BasicLatin, UnicodeRanges.Katakana, UnicodeRanges.Hiragana);
-            settings.AllowCharacter('\u2014');  // allow EM DASH through
-            return HtmlEncoder.Create(settings);
-        }
 
 
-        public async Task fortunes(PipeStream stream, HttpToken token, ISession session)
+        public async Task fortunes(IStreamWriter stream)
         {
         {
+            ContentLengthMemory content = new ContentLengthMemory();
             try
             try
             {
             {
 
 
-                var data = await token.Db.LoadFortunesRows();
+                var data = await this._db.LoadFortunesRows();
 
 
                 stream.Write(_HtmlResultPreamble.Data, 0, _HtmlResultPreamble.Length);
                 stream.Write(_HtmlResultPreamble.Data, 0, _HtmlResultPreamble.Length);
-                token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+                content.Data = GetContentLengthMemory(stream);
                 GMTDate.Default.Write(stream);
                 GMTDate.Default.Write(stream);
-                token.ContentPostion = stream.CacheLength;
 
 
-                var html = token.GetHtmlBufferWriter();
-                html.Reset();
-                html.Write(_fortunesTableStart.Data, 0, _fortunesTableStart.Length);
+                stream.WriteSequenceNetStream.StartWriteLength();
+                stream.Write(_fortunesTableStart.Data, 0, _fortunesTableStart.Length);
                 foreach (var item in data)
                 foreach (var item in data)
                 {
                 {
-                    html.Write(_fortunesRowStart.Data, 0, _fortunesRowStart.Length);
-                    WriteNumeric(html, (uint)item.Id);
-                    html.Write(_fortunesColumn.Data, 0, _fortunesColumn.Length);
-                    html.Write(HtmlEncoder.Encode(item.Message));
-                    html.Write(_fortunesRowEnd.Data, 0, _fortunesRowEnd.Length);
+                    stream.Write(_fortunesRowStart.Data, 0, _fortunesRowStart.Length);
+                    stream.WriteString(item.Id.ToString(CultureInfo.InvariantCulture));
+                    stream.Write(_fortunesColumn.Data, 0, _fortunesColumn.Length);
+                    stream.WriteString(htmlEncoder.Encode(item.Message));
+                    stream.Write(_fortunesRowEnd.Data, 0, _fortunesRowEnd.Length);
                 }
                 }
-                html.Write(_fortunesTableEnd.Data, 0, _fortunesTableEnd.Length);
-                stream.Write(html.Data, 0, html.Length);
-
+                stream.Write(_fortunesTableEnd.Data, 0, _fortunesTableEnd.Length);
             }
             }
             catch (Exception e_)
             catch (Exception e_)
             {
             {
-                HttpServer.ApiServer.Log(BeetleX.EventArgs.LogType.Error, null, $"fortunes error {e_.Message}@{e_.StackTrace}");
-                stream.Write(e_.Message);
-            }
-            OnCompleted(stream, session, token);
-        }
-
-        internal void WriteNumeric(HtmlBufferWriter writer, uint number)
-        {
-            const byte AsciiDigitStart = (byte)'0';
-
-            if (number < 10)
-            {
-                writer.Write((byte)(number + AsciiDigitStart));
-
+                Context.GetLoger(BeetleX.Light.Logs.LogLevel.Error)?.WriteException(Context, "PlatformBenchmarks", "fortunes", e_);
+                stream.WriteString(e_.Message);
             }
             }
-            else if (number < 100)
-            {
-                var tens = (byte)((number * 205u) >> 11); // div10, valid to 1028
-                var span = new byte[2];
-                span[0] = (byte)(tens + AsciiDigitStart);
-                span[1] = (byte)(number - (tens * 10) + AsciiDigitStart);
-                writer.Write(span, 0, 2);
+            var len = stream.WriteSequenceNetStream.EndWriteLength();
+            content.Full(len);
 
 
-            }
-            else if (number < 1000)
-            {
-                var digit0 = (byte)((number * 41u) >> 12); // div100, valid to 1098
-                var digits01 = (byte)((number * 205u) >> 11); // div10, valid to 1028
-                var span = new byte[3];
-                span[0] = (byte)(digit0 + AsciiDigitStart);
-                span[1] = (byte)(digits01 - (digit0 * 10) + AsciiDigitStart);
-                span[2] = (byte)(number - (digits01 * 10) + AsciiDigitStart);
-                writer.Write(span, 0, 3);
-            }
         }
         }
 
 
-        internal void WriteNumeric(PipeStream stream, uint number)
+        internal void WriteNumeric(IStreamWriter stream, uint number)
         {
         {
             const byte AsciiDigitStart = (byte)'0';
             const byte AsciiDigitStart = (byte)'0';
 
 

+ 14 - 20
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.json.cs

@@ -1,8 +1,10 @@
 using BeetleX;
 using BeetleX;
-using BeetleX.Buffers;
-using SpanJson;
+
+using BeetleX.Light.Memory;
+
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text;
 using System.Text.Json;
 using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -11,29 +13,21 @@ namespace PlatformBenchmarks
 {
 {
     public partial class HttpHandler
     public partial class HttpHandler
     {
     {
-        
 
 
-        private static readonly JsonSerializerOptions SerializerOptions = new JsonSerializerOptions();
 
 
-        private static Utf8JsonWriter GetUtf8JsonWriter(PipeStream stream, HttpToken token)
-        {
-            var buffer = stream.CreateBufferWriter();
-            if (token.Utf8JsonWriter == null)
-            {
-                token.Utf8JsonWriter = new Utf8JsonWriter(buffer, new JsonWriterOptions { SkipValidation = true });
-            }
-            var writer = token.Utf8JsonWriter;
-            writer.Reset(buffer);
-            return writer;
-        }
-
-        public ValueTask Json(PipeStream stream, HttpToken token, ISession session)
+        public void Json(IStreamWriter stream)
         {
         {
             stream.Write(_jsonPreamble.Data, 0, _jsonPreamble.Length);
             stream.Write(_jsonPreamble.Data, 0, _jsonPreamble.Length);
             GMTDate.Default.Write(stream);
             GMTDate.Default.Write(stream);
-            System.Text.Json.JsonSerializer.Serialize<JsonMessage>(GetUtf8JsonWriter(stream, token), new JsonMessage { message = "Hello, World!" }, SerializerOptions);
-            OnCompleted(stream, session, token);
-            return ValueTask.CompletedTask;
+            var jsonWriter = GetJsonWriter(stream);
+            using (var unflush = stream.UnFlush())
+            {
+                jsonWriter.WriteStartObject();
+                jsonWriter.WriteString("message", "Hello, World!");
+                jsonWriter.WriteEndObject();
+                jsonWriter.Flush();
+            }
+            
         }
         }
     }
     }
 }
 }

+ 3 - 5
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.plaintext.cs

@@ -1,5 +1,5 @@
-using BeetleX;
-using BeetleX.Buffers;
+
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Text;
 using System.Text;
@@ -11,13 +11,11 @@ namespace PlatformBenchmarks
     {
     {
       
       
 
 
-        public ValueTask Plaintext(PipeStream stream, HttpToken token, ISession session)
+        public void Plaintext(IStreamWriter stream)
         {
         {
             stream.Write(_plaintextPreamble.Data, 0, _plaintextPreamble.Length);
             stream.Write(_plaintextPreamble.Data, 0, _plaintextPreamble.Length);
             GMTDate.Default.Write(stream);
             GMTDate.Default.Write(stream);
             stream.Write(_result_plaintext.Data, 0, _result_plaintext.Length);
             stream.Write(_result_plaintext.Data, 0, _result_plaintext.Length);
-            OnCompleted(stream, session, token);
-            return ValueTask.CompletedTask;
         }
         }
     }
     }
 }
 }

+ 32 - 13
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.queries.cs

@@ -1,24 +1,24 @@
-using BeetleX;
-using BeetleX.Buffers;
-using SpanJson;
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
     public partial class  HttpHandler
     public partial class  HttpHandler
     {
     {
-        public async ValueTask queries(string queryString, PipeStream stream, HttpToken token, ISession session)
+        public async ValueTask queries(string queryString, IStreamWriter stream)
         {
         {
             int count = 1;
             int count = 1;
-            if(!string.IsNullOrEmpty(queryString))
+            if (!string.IsNullOrEmpty(queryString))
             {
             {
                 var values = queryString.Split('=');
                 var values = queryString.Split('=');
-                if(values.Length>1)
+                if (values.Length > 1)
                 {
                 {
-                    if(int.TryParse(values[1],out int size))
+                    if (int.TryParse(values[1], out int size))
                     {
                     {
                         count = size;
                         count = size;
                     }
                     }
@@ -28,20 +28,39 @@ namespace PlatformBenchmarks
                 count = 500;
                 count = 500;
             if (count < 1)
             if (count < 1)
                 count = 1;
                 count = 1;
+            ContentLengthMemory content = new ContentLengthMemory();
             try
             try
             {
             {
-                var data = await token.Db.LoadMultipleQueriesRows(count);
+                var data = await _db.LoadMultipleQueriesRows(count);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
-                token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+                content.Data = GetContentLengthMemory(stream);
                 GMTDate.Default.Write(stream);
                 GMTDate.Default.Write(stream);
-                token.ContentPostion = stream.CacheLength;
-                System.Text.Json.JsonSerializer.Serialize(GetUtf8JsonWriter(stream, token), data, SerializerOptions);
+
+                stream.WriteSequenceNetStream.StartWriteLength();
+
+                var jsonWriter = GetJsonWriter(stream);
+                using (var unflush = stream.UnFlush())
+                {
+                    jsonWriter.WriteStartArray();
+                    foreach (var item in data)
+                    {
+                        jsonWriter.WriteStartObject();
+                        jsonWriter.WriteNumber("Id", item.Id);
+                        jsonWriter.WriteNumber("RandomNumber", item.RandomNumber);
+                        jsonWriter.WriteEndObject();
+                    }
+                    jsonWriter.WriteEndArray();
+                    jsonWriter.Flush();
+
+                }
             }
             }
             catch (Exception e_)
             catch (Exception e_)
             {
             {
-                stream.Write(e_.Message);
+                Context.GetLoger(BeetleX.Light.Logs.LogLevel.Error)?.WriteException(Context, "PlatformBenchmarks", "queries", e_);
+                stream.WriteString(e_.Message);
             }
             }
-            OnCompleted(stream, session, token);
+            var len = stream.WriteSequenceNetStream.EndWriteLength();
+            content.Full(len);
         }
         }
     }
     }
 }
 }

+ 14 - 11
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpHandler.updates.cs

@@ -1,16 +1,17 @@
-using BeetleX;
-using BeetleX.Buffers;
-using SpanJson;
+
+using BeetleX.Light.Memory;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text;
+using System.Text.Json;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
     public partial class HttpHandler
     public partial class HttpHandler
     {
     {
-        public async ValueTask updates(string queryString, PipeStream stream, HttpToken token, ISession session)
+        public async ValueTask updates(string queryString, IStreamWriter stream)
         {
         {
             int count = 1;
             int count = 1;
             if (!string.IsNullOrEmpty(queryString))
             if (!string.IsNullOrEmpty(queryString))
@@ -28,22 +29,24 @@ namespace PlatformBenchmarks
                 count = 500;
                 count = 500;
             if (count < 1)
             if (count < 1)
                 count = 1;
                 count = 1;
+            ContentLengthMemory content = new ContentLengthMemory();
             try
             try
             {
             {
-                var data = await token.Db.LoadMultipleUpdatesRows(count);
+                var data = await _db.LoadMultipleUpdatesRows(count);
 
 
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
                 stream.Write(_jsonResultPreamble.Data, 0, _jsonResultPreamble.Length);
-                token.ContentLength = stream.Allocate(HttpHandler._LengthSize);
+                content.Data = GetContentLengthMemory(stream);
                 GMTDate.Default.Write(stream);
                 GMTDate.Default.Write(stream);
-                token.ContentPostion = stream.CacheLength;
-                System.Text.Json.JsonSerializer.Serialize<World[]>(GetUtf8JsonWriter(stream, token), data, SerializerOptions);
+                stream.WriteSequenceNetStream.StartWriteLength();
+                JsonSerializer.Serialize((Stream)stream.WriteSequenceNetStream, data);
             }
             }
             catch (Exception e_)
             catch (Exception e_)
             {
             {
-                HttpServer.ApiServer.Log(BeetleX.EventArgs.LogType.Error, null, $"updates error {e_.Message}@{e_.StackTrace}");
-                stream.Write(e_.Message);
+                Context.GetLoger(BeetleX.Light.Logs.LogLevel.Error)?.WriteException(Context, "PlatformBenchmarks", "updates", e_);
+                stream.WriteString(e_.Message);
             }
             }
-            OnCompleted(stream, session, token);
+            var len = stream.WriteSequenceNetStream.EndWriteLength();
+            content.Full(len);
         }
         }
     }
     }
 }
 }

+ 23 - 17
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpServer.cs

@@ -1,5 +1,5 @@
-using BeetleX;
-using BeetleX.EventArgs;
+using BeetleX.Light;
+using BeetleX.Light.Logs;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Hosting;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
@@ -11,38 +11,44 @@ namespace PlatformBenchmarks
 {
 {
     public class HttpServer : IHostedService
     public class HttpServer : IHostedService
     {
     {
-        public static IServer ApiServer;
+        private static NetServer<HttpNetApplication, HttpHandler> _apiServer;
 
 
         public virtual Task StartAsync(CancellationToken cancellationToken)
         public virtual Task StartAsync(CancellationToken cancellationToken)
         {
         {
+            ThreadPool.SetMinThreads(Environment.ProcessorCount * 2, Environment.ProcessorCount * 2);
+            Constants.MemorySegmentMinSize = 1024 * 8;
+            Constants.MemorySegmentMaxSize = 1024 * 8;
+            Constants.InitMemoryBlock();
             ArraySegment<byte> date = GMTDate.Default.DATE;
             ArraySegment<byte> date = GMTDate.Default.DATE;
-            ServerOptions serverOptions = new ServerOptions();
-            serverOptions.LogLevel = LogType.Error;
-            serverOptions.DefaultListen.Port = 8080;
-            serverOptions.Statistical = false;
-            serverOptions.BufferPoolMaxMemory = 1000;
-            serverOptions.BufferPoolSize = 1024 * 24;
-            ApiServer = SocketFactory.CreateTcpServer<HttpHandler>(serverOptions);
-            ApiServer.Open();
+            _apiServer = new NetServer<HttpNetApplication, HttpHandler>();
+            _apiServer.Options.LogLevel = BeetleX.Light.Logs.LogLevel.Error;
+            _apiServer.Options.AddLogOutputHandler<LogOutputToConsole>();
+            _apiServer.Options.SetDefaultListen(o =>
+            {
+                o.Port = 8080;
+            });
+            _apiServer.Start();
+
+
             if (!Program.UpDB)
             if (!Program.UpDB)
             {
             {
-               RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Delay Us=500;Write Coalescing Buffer Threshold Bytes=1000";
-               // RawDb._connectionString = "Server=192.168.2.19;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
+                RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
+                //RawDb._connectionString = "Server=127.0.0.1;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=256;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
             }
             }
             else
             else
             {
             {
 
 
-                RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3;Multiplexing=true;Write Coalescing Delay Us=500;Write Coalescing Buffer Threshold Bytes=1000";
-               // RawDb._connectionString = "Server=192.168.2.19;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
+                 RawDb._connectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000";
+                //RawDb._connectionString = "Server=127.0.0.1;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;Maximum Pool Size=64;NoResetOnClose=true;Enlist=false;Max Auto Prepare=3";
             }
             }
-           // ApiServer.Log(LogType.Info, null, $"Debug mode [{Program.Debug}]");
+            // ApiServer.Log(LogType.Info, null, $"Debug mode [{Program.Debug}]");
             return Task.CompletedTask;
             return Task.CompletedTask;
 
 
         }
         }
 
 
         public virtual Task StopAsync(CancellationToken cancellationToken)
         public virtual Task StopAsync(CancellationToken cancellationToken)
         {
         {
-            ApiServer.Dispose();
+
             return Task.CompletedTask;
             return Task.CompletedTask;
         }
         }
     }
     }

+ 57 - 57
frameworks/CSharp/beetlex/PlatformBenchmarks/HttpToken.cs

@@ -1,76 +1,76 @@
-using BeetleX;
-using BeetleX.Buffers;
-using BeetleX.Dispatchs;
-using System;
-using System.Collections.Concurrent;
-using System.Text;
-using System.Text.Json;
+//using BeetleX;
+//using BeetleX.Buffers;
+//using BeetleX.Dispatchs;
+//using System;
+//using System.Collections.Concurrent;
+//using System.Text;
+//using System.Text.Json;
 
 
-namespace PlatformBenchmarks
-{
-    public class HttpToken
-    {
-        private byte[] mLengthBuffer = new byte[10];
+//namespace PlatformBenchmarks
+//{
+//    public class HttpToken
+//    {
+//        private byte[] mLengthBuffer = new byte[10];
 
 
-        public RawDb Db { get; set; }
+//        public RawDb Db { get; set; }
 
 
-        public HttpToken()
-        {
+//        public HttpToken()
+//        {
 
 
-        }
+//        }
 
 
-        public SingleThreadDispatcher<HttpToken> ThreadDispatcher { get; set; }
+//        public SingleThreadDispatcher<HttpToken> ThreadDispatcher { get; set; }
 
 
-        public ConcurrentQueue<RequestData> Requests { get; set; } = new ConcurrentQueue<RequestData>();
+//        public ConcurrentQueue<RequestData> Requests { get; set; } = new ConcurrentQueue<RequestData>();
 
 
-        public Utf8JsonWriter Utf8JsonWriter { get; set; }
+//        public Utf8JsonWriter Utf8JsonWriter { get; set; }
 
 
-        public ISession Session { get; set; }
+//        public ISession Session { get; set; }
 
 
-        public RequestData CurrentRequest { get; set; }
+//        public RequestData CurrentRequest { get; set; }
 
 
-        private HtmlBufferWriter mHtmlBufferWriter = null;
+//        private HtmlBufferWriter mHtmlBufferWriter = null;
 
 
-        public HtmlBufferWriter GetHtmlBufferWriter()
-        {
-            if (mHtmlBufferWriter == null)
-                mHtmlBufferWriter = new HtmlBufferWriter(2048);
-            return mHtmlBufferWriter;
-        }
+//        public HtmlBufferWriter GetHtmlBufferWriter()
+//        {
+//            if (mHtmlBufferWriter == null)
+//                mHtmlBufferWriter = new HtmlBufferWriter(2048);
+//            return mHtmlBufferWriter;
+//        }
 
 
-        public byte[] GetLengthBuffer(string length)
-        {
-            Encoding.ASCII.GetBytes(length, 0, length.Length, mLengthBuffer, 0);
-            for (int i = length.Length; i < mLengthBuffer.Length; i++)
-            {
-                mLengthBuffer[i] = 32;
-            }
-            mLengthBuffer[6] = (byte)'\r';
-            mLengthBuffer[7] = (byte)'\n';
-            return mLengthBuffer;
-        }
+//        public byte[] GetLengthBuffer(string length)
+//        {
+//            Encoding.ASCII.GetBytes(length, 0, length.Length, mLengthBuffer, 0);
+//            for (int i = length.Length; i < mLengthBuffer.Length; i++)
+//            {
+//                mLengthBuffer[i] = 32;
+//            }
+//            mLengthBuffer[6] = (byte)'\r';
+//            mLengthBuffer[7] = (byte)'\n';
+//            return mLengthBuffer;
+//        }
 
 
-        public int ContentPostion { get; set; }
+//        public int ContentPostion { get; set; }
 
 
-        public MemoryBlockCollection ContentLength { get; set; }
+//        public MemoryBlockCollection ContentLength { get; set; }
 
 
-        public void FullLength(string length)
-        {
-            var item = GetLengthBuffer(length);
-            ContentLength.Full(item);
-        }
+//        public void FullLength(string length)
+//        {
+//            var item = GetLengthBuffer(length);
+//            ContentLength.Full(item);
+//        }
 
 
-        private int mProcessStatus = 0;
+//        private int mProcessStatus = 0;
 
 
-        public void CompletedProcess()
-        {
-            System.Threading.Interlocked.Exchange(ref mProcessStatus, 0);
-        }
+//        public void CompletedProcess()
+//        {
+//            System.Threading.Interlocked.Exchange(ref mProcessStatus, 0);
+//        }
 
 
-        public bool EnterProcess()
-        {
-            return System.Threading.Interlocked.CompareExchange(ref mProcessStatus, 1, 0) == 0;
-        }
+//        public bool EnterProcess()
+//        {
+//            return System.Threading.Interlocked.CompareExchange(ref mProcessStatus, 1, 0) == 0;
+//        }
 
 
-    }
-}
+//    }
+//}

+ 19 - 0
frameworks/CSharp/beetlex/PlatformBenchmarks/NetApplication.cs

@@ -0,0 +1,19 @@
+using BeetleX.Light;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PlatformBenchmarks
+{
+    public class HttpNetApplication : ApplicationBase
+    {
+        public override bool Connecting(Socket socket, ListenHandler handler)
+        {
+            socket.NoDelay = true;
+            return true;
+        }
+    }
+}

+ 6 - 6
frameworks/CSharp/beetlex/PlatformBenchmarks/PlatformBenchmarks.csproj

@@ -2,17 +2,17 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
-    <TargetFramework>net5.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ServerGarbageCollection>true</ServerGarbageCollection>
     <ServerGarbageCollection>true</ServerGarbageCollection>
    
    
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="BeetleX" Version="1.6.5.41" />
-    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
-    <PackageReference Include="Npgsql" Version="5.0.3" />
-    <PackageReference Include="SpanJson" Version="3.1.0" />
+    <PackageReference Include="BeetleX.Light" Version="0.10.24.607" />
+    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
+    <PackageReference Include="Npgsql" Version="8.0.3" />
+    <PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
   </ItemGroup>
   </ItemGroup>
 
 
 </Project>
 </Project>

+ 6 - 0
frameworks/CSharp/beetlex/PlatformBenchmarks/Program.cs

@@ -1,6 +1,7 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Hosting;
 using System;
 using System;
+using System.IO;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
@@ -14,7 +15,12 @@ namespace PlatformBenchmarks
         public static void Main(string[] args)
         public static void Main(string[] args)
         {
         {
             //Debug = (args != null && args.Length > 0 && args[0] == "debug");
             //Debug = (args != null && args.Length > 0 && args[0] == "debug");
+            var data = GMTDate.Default.DATE;
             UpDB = (args != null && args.Length > 0 && args[0] == "updb");
             UpDB = (args != null && args.Length > 0 && args[0] == "updb");
+            UpdateCommandsCached.Init();
+            //HttpServer server = new HttpServer();
+            //server.StartAsync(default);
+            //Console.ReadLine();
             new HostBuilder().ConfigureServices(delegate (HostBuilderContext hostContext, IServiceCollection services)
             new HostBuilder().ConfigureServices(delegate (HostBuilderContext hostContext, IServiceCollection services)
             {
             {
                 services.AddHostedService<HttpServer>();
                 services.AddHostedService<HttpServer>();

+ 3 - 14
frameworks/CSharp/beetlex/PlatformBenchmarks/RequestData.cs

@@ -1,4 +1,5 @@
 using System;
 using System;
+using System.Buffers;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
@@ -6,24 +7,12 @@ using System.Threading.Tasks;
 
 
 namespace PlatformBenchmarks
 namespace PlatformBenchmarks
 {
 {
-    public class RequestData : IDisposable
+    public class RequestData 
     {
     {
-        public ArraySegment<byte> Data { get; set; }
-
-        public ReadOnlySpan<byte> GetSpan()
-        {
-            return new ReadOnlySpan<byte>(Data.Array, Data.Offset, Data.Count);
-        }
-
-        public void Dispose()
-        {
-
-            //System.Buffers.ArrayPool<byte>.Shared.Return(Data.Array);
-        }
 
 
         public string QueryString { get; set; }
         public string QueryString { get; set; }
 
 
-        public ActionType Action { get; set; }
+        public ActionType? Action { get; set; }
 
 
 
 
     }
     }

+ 0 - 12
frameworks/CSharp/beetlex/beetlex-core-updb.dockerfile

@@ -1,12 +0,0 @@
-FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
-WORKDIR /app
-COPY PlatformBenchmarks .
-RUN dotnet publish -c Release -o out
-
-FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
-WORKDIR /app
-COPY --from=build /app/out ./
-
-EXPOSE 8080
-
-ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll","updb"]

+ 2 - 2
frameworks/CSharp/beetlex/beetlex-core.dockerfile

@@ -1,9 +1,9 @@
-FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
 WORKDIR /app
 WORKDIR /app
 COPY PlatformBenchmarks .
 COPY PlatformBenchmarks .
 RUN dotnet publish -c Release -o out
 RUN dotnet publish -c Release -o out
 
 
-FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
 WORKDIR /app
 WORKDIR /app
 COPY --from=build /app/out ./
 COPY --from=build /app/out ./
 
 

+ 2 - 2
frameworks/CSharp/beetlex/beetlex.dockerfile

@@ -1,9 +1,9 @@
-FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
 WORKDIR /app
 WORKDIR /app
 COPY Benchmarks .
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
 RUN dotnet publish -c Release -o out
 
 
-FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
 WORKDIR /app
 WORKDIR /app
 COPY --from=build /app/out ./
 COPY --from=build /app/out ./
 
 

+ 0 - 19
frameworks/CSharp/beetlex/benchmark_config.json

@@ -48,25 +48,6 @@
         "display_name": "beetlex-core",
         "display_name": "beetlex-core",
         "notes": "",
         "notes": "",
         "versus": "aspcore"
         "versus": "aspcore"
-      },
-      "core-updb": {
-        "update_url": "/updates?queries=",
-        "fortune_url": "/fortunes",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Platform",
-        "database": "Postgres",
-        "framework": "beetlex",
-        "language": "C#",
-        "orm": "Raw",
-        "platform": ".NET",
-        "flavor": "CoreCLR",
-        "webserver": "beetlex",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "beetlex-core-updb",
-        "notes": "",
-        "versus": "aspcore"
       }
       }
     }
     }
   ]
   ]

+ 0 - 12
frameworks/CSharp/beetlex/config.toml

@@ -36,15 +36,3 @@ platform = ".NET"
 webserver = "beetlex"
 webserver = "beetlex"
 versus = "aspcore"
 versus = "aspcore"
 
 
-[core-updb]
-urls.update = "/updates?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Platform"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = ".NET"
-webserver = "beetlex"
-versus = "aspcore"

+ 6 - 6
frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj

@@ -28,13 +28,13 @@
     
     
   <ItemGroup>
   <ItemGroup>
 	  
 	  
-    <PackageReference Include="GenHTTP.Core" Version="8.3.1" />
-    <PackageReference Include="GenHTTP.Modules.Razor" Version="8.3.0" />
-    <PackageReference Include="GenHTTP.Modules.Webservices" Version="8.3.0" />
+    <PackageReference Include="GenHTTP.Core" Version="8.5.2" />
+    <PackageReference Include="GenHTTP.Modules.Razor" Version="8.5.0" />
+    <PackageReference Include="GenHTTP.Modules.Webservices" Version="8.5.0" />
 	  
 	  
-    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
-    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
 	  
 	  
   </ItemGroup>
   </ItemGroup>
   
   
-</Project>
+</Project>

+ 1 - 1
frameworks/Crystal/grip/grip.cr

@@ -121,7 +121,7 @@ end
 
 
 class Application < Grip::Application
 class Application < Grip::Application
   def initialize
   def initialize
-    super(environment: "production", serve_static: false)
+    super(environment: "production")
 
 
     get "/json", Json
     get "/json", Json
     get "/plaintext", Plaintext
     get "/plaintext", Plaintext

+ 1 - 1
frameworks/Crystal/grip/grip.dockerfile

@@ -1,4 +1,4 @@
-FROM crystallang/crystal:1.0.0
+FROM crystallang/crystal:1.12.1
 
 
 WORKDIR /grip
 WORKDIR /grip
 COPY views views
 COPY views views

+ 2 - 2
frameworks/Crystal/grip/shard.yml

@@ -4,11 +4,11 @@ version: 0.2.0
 dependencies:
 dependencies:
   grip:
   grip:
     github: grip-framework/grip
     github: grip-framework/grip
-    version: 2.0.0
+    version: 3.0.0
 
 
   pg:
   pg:
     github: will/crystal-pg
     github: will/crystal-pg
-    version: 0.26.0
+    version: 0.28.0
 targets:
 targets:
   grip:
   grip:
     main: grip.cr
     main: grip.cr

+ 0 - 7
frameworks/Crystal/h2o.cr/README.md

@@ -1,7 +0,0 @@
-# h2o.cr
-
-Crystal bindings to h2o
-
-### notes
-
-h2o.cr currently only support plaintext and json requests

+ 0 - 26
frameworks/Crystal/h2o.cr/benchmark_config.json

@@ -1,26 +0,0 @@
-{
-  "framework": "h2o.cr",
-  "tests": [
-    {
-      "default": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "port": 7890,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "None",
-        "framework": "h2o.cr",
-        "language": "Crystal",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "None",
-        "webserver": "h2o",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "crystal-h2o",
-        "notes": "",
-        "versus": "None"
-      }
-    }
-  ]
-}

+ 0 - 15
frameworks/Crystal/h2o.cr/config.toml

@@ -1,15 +0,0 @@
-[framework]
-name = "h2o.cr"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-approach = "Realistic"
-classification = "Micro"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "None"
-webserver = "h2o"
-versus = "None"

+ 0 - 24
frameworks/Crystal/h2o.cr/h2o.cr.dockerfile

@@ -1,24 +0,0 @@
-FROM debian:sid
-
-RUN apt-get update \
-  && apt-get install -yqq libh2o-evloop-dev libwslay-dev libyaml-0-2 libevent-dev libpcre3-dev \
-    gcc wget git libssl-dev libuv1-dev ca-certificates --no-install-recommends
-
-RUN wget -q https://github.com/crystal-lang/crystal/releases/download/0.26.1/crystal-0.26.1-1-linux-x86_64.tar.gz \
-  && tar --strip-components=1 -xzf crystal-0.26.1-1-linux-x86_64.tar.gz -C /usr/ \
-  && rm -f *.tar.gz
-
-WORKDIR /crystal
-
-ENV GC_MARKERS 1
-
-COPY ./ ./
-
-RUN shards install
-RUN gcc -shared -O3 lib/h2o/src/ext/h2o.c -I/usr/include -fPIC -o h2o.o
-ENV CRYSTAL_PATH=lib:/usr/share/crystal/src
-RUN crystal build --prelude=empty --no-debug --release -Dgc_none -Dfiber_none -Dexcept_none -Dhash_none -Dtime_none -Dregex_none -Dextreme h2o_evloop_hello.cr --link-flags="-Wl,-s $PWD/h2o.o -DH2O_USE_LIBUV=0" -o server.out
-
-EXPOSE 7890
-
-CMD sh run.sh

+ 0 - 114
frameworks/Crystal/h2o.cr/h2o_evloop_hello.cr

@@ -1,114 +0,0 @@
-require "reset/prelude"
-require "reset/patches"
-require "reset/json"
-require "h2o/h2o_evloop"
-
-class H2oHello < H2o
-  @config = LibH2o::H2oGlobalconfT.new
-  @ctx = LibH2o::H2oContextT.new
-  @accept_ctx = LibH2o::H2oAcceptCtxT.new
-  @loop : LibH2o::H2oLoopT*
-
-  macro hello
-    Handler.new do |handler, req|
-      generator = uninitialized LibH2o::H2oGeneratorT[2]
-      body = h2o_iovec_init("Hello, World!")
-      req.value.res.status = 200
-      req.value.res.reason = "OK"
-      req.value.res.content_length = body.len
-
-      # require h2o.c extension
-      h2o_add_header(req, H2O_TOKEN_CONTENT_TYPE, "text/plain")
-      h2o_start_response(req, generator)
-      h2o_send(req, pointerof(body), 1, LibH2o::H2oSendState::H2OSendStateFinal)
-      0
-    end
-  end
-
-  macro json
-    Handler.new do |handler, req|
-      generator = uninitialized LibH2o::H2oGeneratorT[2]
-      alloc = uninitialized UInt8[32]
-      buf = StackBuffer.new(alloc.to_unsafe)
-
-      len = {message: "Hello, World!"}.to_json(buf)
-      body = LibH2o::H2oIovecT.new(base: buf, len: len)
-
-      req.value.res.status = 200
-      req.value.res.reason = "OK"
-      req.value.res.content_length = body.len
-
-      h2o_add_header(req, H2O_TOKEN_CONTENT_TYPE, "application/json")
-      h2o_start_response(req, generator)
-      h2o_send(req, pointerof(body), 1, LibH2o::H2oSendState::H2OSendStateFinal)
-      0
-    end
-  end
-
-  def on_accept(listener : LibH2o::H2oSocketT*, err : LibC::Char*) : Void
-    return if err
-    return unless s = h2o_evloop_socket_accept(listener)
-    h2o_accept(pointerof(@accept_ctx), s)
-  end
-
-  def create_listener : Int32
-    addr = uninitialized LibC::SockaddrIn
-
-    pointerof(addr).clear
-    addr.sin_family = LibC::AF_INET
-    addr.sin_addr.s_addr = 0 # 0x100007f # b32(0x7f000001)
-    addr.sin_port = 0xd21e   # b16(7890)
-
-    option = 1
-    if (fd = socket(LibC::AF_INET, LibC::SOCK_STREAM | LibC::O_NONBLOCK | LibC::O_CLOEXEC, 0)) == -1 ||
-       setsockopt(fd, LibC::SOL_SOCKET, LibC::SO_REUSEADDR, pointerof(option), 4) != 0 ||
-       setsockopt(fd, LibC::SOL_SOCKET, LibC::SO_REUSEPORT, pointerof(option), 4) != 0 ||
-       setsockopt(fd, LibC::IPPROTO_TCP, LibC::TCP_QUICKACK, pointerof(option), 4) != 0 ||
-       ((option = H2O_DEFAULT_HANDSHAKE_TIMEOUT_IN_SECS) &&
-       setsockopt(fd, LibC::IPPROTO_TCP, LibC::TCP_DEFER_ACCEPT, pointerof(option), 4) != 0) ||
-       ((option = DEFAULT_TCP_FASTOPEN_QUEUE_LEN) &&
-       setsockopt(fd, LibC::IPPROTO_TCP, LibC::TCP_FASTOPEN, pointerof(option), 4) != 0) ||
-       bind(fd, pointerof(addr).as(LibC::Sockaddr*), sizeof(LibC::SockaddrIn)) != 0 ||
-       listen(fd, LibC::SOMAXCONN) != 0
-      return -1
-    end
-
-    sock = h2o_evloop_socket_create(@ctx.loop, fd, H2O_SOCKET_FLAG_DONT_READ)
-    h2o_socket_read_start(sock, LibH2o::H2oSocketCb.new { |listener, err|
-      {{@type}}.instance.on_accept(listener, err)
-    })
-    0
-  end
-
-  def register_handler(hostconf : LibH2o::H2oHostconfT*, path : String, on_req : Handler) : Void
-    pathconf = h2o_config_register_path(hostconf, path, 0)
-    handler = h2o_create_handler(pathconf, sizeof(LibH2o::H2oHandlerT))
-    handler.value.on_req = on_req
-  end
-
-  def initialize
-    @loop = h2o_evloop_create()
-  end
-
-  def run : Void
-    h2o_config_init(pointerof(@config))
-    @config.server_name = h2o_iovec_init("h2o")
-
-    hostconf = h2o_config_register_host(pointerof(@config), h2o_iovec_init("default"), 65535)
-    register_handler(hostconf, "/plaintext", hello)
-    register_handler(hostconf, "/json", json)
-
-    h2o_context_init(pointerof(@ctx), @loop, pointerof(@config))
-
-    @accept_ctx.ctx = pointerof(@ctx)
-    @accept_ctx.hosts = @config.hosts
-
-    if create_listener != 0
-      return 1
-    end
-
-    while h2o_evloop_run(@ctx.loop, Int32::MAX) == 0; end
-  end
-end
-
-H2oHello.run

+ 0 - 7
frameworks/Crystal/h2o.cr/run.sh

@@ -1,7 +0,0 @@
-#!/bin/sh
-
-for i in $(seq 1 $(nproc --all)); do
-  ./server.out &
-done
-
-wait

+ 0 - 15
frameworks/Crystal/h2o.cr/shard.yml

@@ -1,15 +0,0 @@
-name: crystal-h2o
-version: 0.0.1
-
-license: MIT
-
-crystal: 0.26.1
-
-dependencies:
-  h2o:
-    github: s-you/h2o.cr
-  uv:
-    github: s-you/uv.cr
-  reset:
-    github: s-you/reset.cr
-    branch: h2o

+ 1 - 1
frameworks/Crystal/kemal/kemal-concurrent-queries.dockerfile

@@ -1,4 +1,4 @@
-FROM crystallang/crystal:0.32.1
+FROM crystallang/crystal:1.12.1
 
 
 WORKDIR /kemal
 WORKDIR /kemal
 COPY views views
 COPY views views

+ 1 - 1
frameworks/Crystal/kemal/kemal.dockerfile

@@ -1,4 +1,4 @@
-FROM crystallang/crystal:0.32.1
+FROM crystallang/crystal:1.12.1
 
 
 WORKDIR /kemal
 WORKDIR /kemal
 COPY views views
 COPY views views

+ 21 - 21
frameworks/Crystal/kemal/shard.lock

@@ -1,38 +1,38 @@
-version: 1.0
+version: 2.0
 shards:
 shards:
+  backtracer:
+    git: https://github.com/sija/backtracer.cr.git
+    version: 1.2.2
+
   commander:
   commander:
-    github: snluu/commander
-    commit: 9396efd427f06f0f6de5206f6e81d54fcd254abe
+    git: https://github.com/snluu/commander.git
+    version: 0.1.0+git.commit.9396efd427f06f0f6de5206f6e81d54fcd254abe
 
 
   db:
   db:
-    github: crystal-lang/crystal-db
-    version: 0.8.0
+    git: https://github.com/crystal-lang/crystal-db.git
+    version: 0.13.1
 
 
   exception_page:
   exception_page:
-    github: crystal-loot/exception_page
-    version: 0.1.2
+    git: https://github.com/crystal-loot/exception_page.git
+    version: 0.4.1
 
 
   kemal:
   kemal:
-    github: kemalcr/kemal
-    version: 0.26.1
-
-  kilt:
-    github: jeromegn/kilt
-    version: 0.4.0
+    git: https://github.com/kemalcr/kemal.git
+    version: 1.5.0
 
 
   pg:
   pg:
-    github: will/crystal-pg
-    version: 0.20.0
+    git: https://github.com/will/crystal-pg.git
+    version: 0.28.0
 
 
   pool:
   pool:
-    github: ysbaddaden/pool
-    version: 0.2.3
+    git: https://github.com/ysbaddaden/pool.git
+    version: 0.3.0
 
 
   radix:
   radix:
-    github: luislavena/radix
-    version: 0.3.9
+    git: https://github.com/luislavena/radix.git
+    version: 0.4.1
 
 
   redis:
   redis:
-    github: stefanwille/crystal-redis
-    version: 2.5.3
+    git: https://github.com/stefanwille/crystal-redis.git
+    version: 2.8.0
 
 

+ 3 - 3
frameworks/Crystal/kemal/shard.yml

@@ -6,12 +6,12 @@ license: MIT
 dependencies:
 dependencies:
   pg:
   pg:
     github: will/crystal-pg
     github: will/crystal-pg
-    version: 0.20.0
+    version: 0.28.0
   kemal:
   kemal:
     github: kemalcr/kemal
     github: kemalcr/kemal
-    version: 0.26.1
+    version: 1.5.0
   redis:
   redis:
     github: stefanwille/crystal-redis
     github: stefanwille/crystal-redis
-    version: 2.5.3
+    version: 2.8.0
   commander:
   commander:
     github: snluu/commander
     github: snluu/commander

+ 0 - 5
frameworks/Crystal/raze/README.md

@@ -1,5 +0,0 @@
-# Crystal-Raze
-
-This is the [Raze](https://github.com/samueleaton/raze) test of the Framework Benchmarks. Crystal is a new language that closely resembles Ruby with a goal of removing typed variables and parameters (instead inferencing), whilst maintaining top speed through bindings into C.
-
-Raze is a Modular, light web framework for Crystal https://razecr.com/

+ 0 - 28
frameworks/Crystal/raze/benchmark_config.json

@@ -1,28 +0,0 @@
-{
-  "framework": "raze",
-  "tests": [{
-    "default": {
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/updates?queries=",
-      "plaintext_url": "/plaintext",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "Postgres",
-      "framework": "raze",
-      "language": "Crystal",
-      "flavor": "None",
-      "orm": "micro",
-      "platform": "None",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "Raze (PostgreSQL)",
-      "notes": "",
-      "versus": "crystal"
-    }
-  }]
-}

+ 0 - 19
frameworks/Crystal/raze/config.toml

@@ -1,19 +0,0 @@
-[framework]
-name = "raze"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/updates?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "Postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "micro"
-platform = "None"
-webserver = "None"
-versus = "crystal"

+ 0 - 107
frameworks/Crystal/raze/raze.cr

@@ -1,107 +0,0 @@
-require "raze"
-require "pg"
-
-BENCH_DB = DB.open(ENV["DATABASE_URL"])
-
-class CONTENT
-  ID_MAX = 10_000
-  JSON  = "application/json"
-  PLAIN = "text/plain"
-  HTML  = "text/html; charset=UTF-8"
-end
-
-private def get_world
-  id = Random.rand(CONTENT::ID_MAX).succ
-  random_number = BENCH_DB.query_one("SELECT id, randomNumber FROM world WHERE id = $1", id, as: Int32)
-  { id: id, randomNumber: random_number }
-end
-
-private def set_world(world)
-  BENCH_DB.exec("UPDATE world SET randomNumber = $1 WHERE id = $2", world[:randomNumber], world[:id])
-  world
-end
-
-private def fortunes
-  data = Array(NamedTuple(id: Int32, message: String)).new
-
-  BENCH_DB.query_each("SELECT id, message FROM Fortune") do |rs|
-    data.push({id: rs.read(Int32), message: rs.read(String)})
-  end
-
-  data
-end
-
-private def sanitized_query_count(ctx)
-  queries = ctx.query["queries"].as(String)
-  queries = queries.to_i? || 1
-  queries.clamp(1..500)
-end
-
-# Test 1: JSON Serialization
-get "/json" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  { message: "Hello, World!" }.to_json
-end
-
-# Postgres Test 2: Single database query
-get "/db" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  get_world.to_json
-end
-
-# Postgres Test 3: Multiple database query
-get "/queries" do |ctx|
-  results = (1..sanitized_query_count(ctx)).map do
-    get_world
-  end
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  results.to_json
-end
-
-# Postgres Test 4: Fortunes
-get "/fortunes" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::HTML
-  data = fortunes
-  additional_fortune = {
-    id:      0,
-    message: "Additional fortune added at request time.",
-  }
-  data.push(additional_fortune)
-
-  data.sort_by! { |fortune| fortune[:message] }
-
-  render "views/fortunes.ecr"
-end
-
-# Postgres Test 5: Database Updates
-get "/updates" do |ctx|
-  updated = (1..sanitized_query_count(ctx)).map do
-    set_world({id: get_world[:id], randomNumber: Random.rand(CONTENT::ID_MAX).succ})
-  end
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::JSON
-  updated.to_json
-end
-
-# Test 6: Plaintext
-get "/plaintext" do |ctx|
-  ctx.response.headers["Server"] = "Raze"
-  ctx.response.headers["Date"] = HTTP.format_time(Time.now)
-  ctx.response.content_type = CONTENT::PLAIN
-  "Hello, World!"
-end
-
-Raze.config.logging = false
-Raze.config.port = 8080
-Raze.config.env = "production"
-Raze.config.reuse_port = true
-Raze.run

+ 0 - 17
frameworks/Crystal/raze/raze.dockerfile

@@ -1,17 +0,0 @@
-FROM crystallang/crystal:0.26.1
-
-WORKDIR /raze
-COPY views views
-COPY run.sh run.sh
-COPY raze.cr raze.cr
-COPY shard.lock shard.lock
-COPY shard.yml shard.yml
-
-ENV DATABASE_URL postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world?initial_pool_size=56&max_pool_size=56&max_idle_pool_size=56
-
-RUN shards install
-RUN crystal build --release --no-debug raze.cr
-
-EXPOSE 8080
-
-CMD bash run.sh

+ 0 - 7
frameworks/Crystal/raze/run.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-for i in $(seq 1 $(nproc --all)); do
-  ./raze -p 8080 &
-done
-
-wait

+ 0 - 22
frameworks/Crystal/raze/shard.lock

@@ -1,22 +0,0 @@
-version: 1.0
-shards:
-  db:
-    github: crystal-lang/crystal-db
-    version: 0.5.0
-
-  kilt:
-    github: jeromegn/kilt
-    version: 0.4.0
-
-  pg:
-    github: will/crystal-pg
-    version: 0.15.0
-
-  radix:
-    github: luislavena/radix
-    version: 0.3.8
-
-  raze:
-    github: samueleaton/raze
-    version: 0.3.0
-

+ 0 - 18
frameworks/Crystal/raze/shard.yml

@@ -1,18 +0,0 @@
-name: raze
-version: 0.1.0
-
-targets:
-  raze:
-    main: src/raze.cr
-
-crystal: 0.26.1
-
-license: MIT
-
-dependencies:
-  raze:
-    github: samueleaton/raze
-    version: 0.3.0
-  pg:
-    github: will/crystal-pg
-    version: 0.15.0

+ 0 - 20
frameworks/Crystal/raze/views/fortunes.ecr

@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-	<title>Fortunes</title>
-</head>
-<body>
-	<table>
-		<tr>
-		<th>id</th>
-		<th>message</th>
-		</tr>
-		<% data.each do |fortune| %>
-			<tr>
-			<td><%= fortune[:id] %></td>
-			<td><%= HTML.escape(fortune[:message]) %></td>
-			</tr>
-		<% end %>
-	</table>
-</body>
-</html>

+ 0 - 1
frameworks/FSharp/oxpecker/README.md

@@ -19,7 +19,6 @@ This includes tests for plaintext, json, and fortunes HTML serialization.
 
 
 * [Oxpecker](https://github.com/Lanayx/Oxpecker)
 * [Oxpecker](https://github.com/Lanayx/Oxpecker)
 * [Dapper](https://github.com/DapperLib/Dapper)
 * [Dapper](https://github.com/DapperLib/Dapper)
-* [SpanJson](https://github.com/Tornhoof/SpanJson)
 * ASP.NET Core
 * ASP.NET Core
 
 
 ## Paths & Source for Tests
 ## Paths & Source for Tests

+ 3 - 0
frameworks/FSharp/oxpecker/oxpecker.dockerfile

@@ -4,6 +4,9 @@ COPY src/App .
 RUN dotnet publish -c Release -o out
 RUN dotnet publish -c Release -o out
 
 
 FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
 FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+
+ENV DOTNET_ReadyToRun 0
+
 ENV URLS http://+:8080
 ENV URLS http://+:8080
 
 
 WORKDIR /app
 WORKDIR /app

+ 0 - 1
frameworks/FSharp/oxpecker/src/App/App.fsproj

@@ -14,6 +14,5 @@
     <PackageReference Include="Dapper" Version="2.1.44" />
     <PackageReference Include="Dapper" Version="2.1.44" />
     <PackageReference Include="Oxpecker" Version="0.10.1" />
     <PackageReference Include="Oxpecker" Version="0.10.1" />
     <PackageReference Include="Npgsql" Version="8.0.3" />
     <PackageReference Include="Npgsql" Version="8.0.3" />
-    <PackageReference Include="SpanJson" Version="4.0.1" />
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 49 - 64
frameworks/FSharp/oxpecker/src/App/Program.fs

@@ -2,18 +2,22 @@ namespace App
 
 
 open System
 open System
 open System.Collections.Generic
 open System.Collections.Generic
-open System.Threading.Tasks
 open Oxpecker
 open Oxpecker
 
 
 [<AutoOpen>]
 [<AutoOpen>]
 module Common =
 module Common =
 
 
+    [<Struct>]
     [<CLIMutable>]
     [<CLIMutable>]
-    type Fortune =
-        {
-            id      : int
-            message : string
-        }
+    type JsonMessage = {
+        message : string
+    }
+
+    [<CLIMutable>]
+    type Fortune = {
+        id: int
+        message: string
+    }
 
 
     [<Literal>]
     [<Literal>]
     let ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000"
     let ConnectionString = "Server=tfb-database;Database=hello_world;User Id=benchmarkdbuser;Password=benchmarkdbpass;SSL Mode=Disable;Maximum Pool Size=1024;NoResetOnClose=true;Enlist=false;Max Auto Prepare=4;Multiplexing=true;Write Coalescing Buffer Threshold Bytes=1000"
@@ -44,13 +48,13 @@ module HtmlViews =
             th() { raw "message" }
             th() { raw "message" }
         }
         }
 
 
-    let fortunes (fortunes: Fortune[]) =
+    let fortunes fortunesData =
         table() {
         table() {
             fortunesTableHeader
             fortunesTableHeader
-            for f in fortunes do
+            for fortune in fortunesData do
                 tr() {
                 tr() {
-                    td() { raw <| string f.id }
-                    td() { f.message }
+                    td() { raw <| string fortune.id }
+                    td() { fortune.message }
                 }
                 }
         } |> layout
         } |> layout
 
 
@@ -60,6 +64,7 @@ module HttpHandlers =
     open Npgsql
     open Npgsql
     open System.Text
     open System.Text
     open Microsoft.AspNetCore.Http
     open Microsoft.AspNetCore.Http
+    open System.Text.Json
 
 
     let private extra =
     let private extra =
         {
         {
@@ -67,13 +72,11 @@ module HttpHandlers =
             message = "Additional fortune added at request time."
             message = "Additional fortune added at request time."
         }
         }
 
 
-    let private renderFortunes (ctx: HttpContext) dbFortunes =
-        let augmentedData = [|
-            yield! dbFortunes
-            extra
-        |]
-        Array.Sort(augmentedData, FortuneComparer)
-        augmentedData |> HtmlViews.fortunes |> ctx.WriteHtmlView
+    let rec private renderFortunes (ctx: HttpContext) (dbFortunes: Fortune seq) =
+        let data = dbFortunes.AsList()
+        data.Add extra
+        data.Sort FortuneComparer
+        data |> HtmlViews.fortunes |> ctx.WriteHtmlView
 
 
     let private fortunes : EndpointHandler =
     let private fortunes : EndpointHandler =
         fun ctx ->
         fun ctx ->
@@ -85,11 +88,10 @@ module HttpHandlers =
 
 
     [<Struct>]
     [<Struct>]
     [<CLIMutable>]
     [<CLIMutable>]
-    type World =
-        {
-            id: int
-            randomnumber: int
-        }
+    type World = {
+        id: int
+        randomnumber: int
+    }
 
 
     let private readSingleRow (conn: NpgsqlConnection) =
     let private readSingleRow (conn: NpgsqlConnection) =
         conn.QueryFirstOrDefaultAsync<World>(
         conn.QueryFirstOrDefaultAsync<World>(
@@ -127,7 +129,7 @@ module HttpHandlers =
             }
             }
 
 
     let private maxBatch = 500
     let private maxBatch = 500
-    let mutable private queries = Array.zeroCreate (maxBatch + 1)
+    let private queries = Array.zeroCreate (maxBatch + 1)
 
 
     let private batchUpdateString batchSize =
     let private batchUpdateString batchSize =
         match queries[batchSize] with
         match queries[batchSize] with
@@ -141,7 +143,17 @@ module HttpHandlers =
             let result = sb.ToString()
             let result = sb.ToString()
             queries[batchSize] <- result
             queries[batchSize] <- result
             result
             result
-        | q -> q
+        | q ->
+            q
+
+    let private generateParameters (results: World[]) =
+        let parameters = Dictionary<string,obj>()
+        for i in 0..results.Length-1 do
+            let randomNumber = Random.Shared.Next(1, 10001)
+            parameters[$"@Rn_{i}"] <- randomNumber
+            parameters[$"@Id_{i}"] <- results[i].id
+            results[i] <- { results[i] with randomnumber = randomNumber }
+        parameters
 
 
     let private multipleUpdates : EndpointHandler =
     let private multipleUpdates : EndpointHandler =
         fun ctx ->
         fun ctx ->
@@ -153,12 +165,7 @@ module HttpHandlers =
                 for i in 0..results.Length-1 do
                 for i in 0..results.Length-1 do
                     let! result = readSingleRow conn
                     let! result = readSingleRow conn
                     results[i] <- result
                     results[i] <- result
-                let parameters = Dictionary<string,obj>()
-                for i in 0..results.Length-1 do
-                    let randomNumber = Random.Shared.Next(1, 10001)
-                    parameters[$"@Rn_{i}"] <- randomNumber
-                    parameters[$"@Id_{i}"] <- results[i].id
-                    results[i] <- { results[i] with randomnumber = randomNumber }
+                let parameters = generateParameters results
                 let! _ = conn.ExecuteAsync(batchUpdateString count, parameters)
                 let! _ = conn.ExecuteAsync(batchUpdateString count, parameters)
                 return! ctx.WriteJsonChunked results
                 return! ctx.WriteJsonChunked results
             }
             }
@@ -169,60 +176,38 @@ module HttpHandlers =
             ctx.SetContentType("text/plain")
             ctx.SetContentType("text/plain")
             ctx.WriteBytes(result)
             ctx.WriteBytes(result)
 
 
+    let jsonSimple value : EndpointHandler =
+        let options = JsonSerializerOptions(JsonSerializerDefaults.Web)
+        fun ctx ->
+            ctx.Response.WriteAsJsonAsync(value, options)
+
     let endpoints =
     let endpoints =
         [|
         [|
             route "/plaintext" <| utf8Const "Hello, World!"
             route "/plaintext" <| utf8Const "Hello, World!"
-            route "/json"<| jsonChunked {| message = "Hello, World!" |}
+            route "/json" <| jsonSimple { message = "Hello, World!" }
             route "/fortunes" fortunes
             route "/fortunes" fortunes
             route "/db" singleQuery
             route "/db" singleQuery
             route "/queries/{count?}" multipleQueries
             route "/queries/{count?}" multipleQueries
             route "/updates/{count?}" multipleUpdates
             route "/updates/{count?}" multipleUpdates
         |]
         |]
 
 
-
 module Main =
 module Main =
-    open SpanJson
-    open Microsoft.AspNetCore.Http
     open Microsoft.AspNetCore.Builder
     open Microsoft.AspNetCore.Builder
-    open Microsoft.AspNetCore.Hosting
     open Microsoft.Extensions.DependencyInjection
     open Microsoft.Extensions.DependencyInjection
     open Microsoft.Extensions.Hosting
     open Microsoft.Extensions.Hosting
     open Microsoft.Extensions.Logging
     open Microsoft.Extensions.Logging
-    open System.Buffers
-
-    type SpanJsonSerializer() =
-        interface Serializers.IJsonSerializer with
-            member this.Serialize(value, ctx, chunked) =
-                ctx.Response.ContentType <- "application/json"
-                if chunked then
-                    if ctx.Request.Method <> HttpMethods.Head then
-                        JsonSerializer.Generic.Utf8.SerializeAsync<_>(value, stream = ctx.Response.Body).AsTask()
-                    else
-                        Task.CompletedTask
-                else
-                    task {
-                        let buffer = JsonSerializer.Generic.Utf8.SerializeToArrayPool<_>(value)
-                        ctx.Response.Headers.ContentLength <- buffer.Count
-                        if ctx.Request.Method <> HttpMethods.Head then
-                            do! ctx.Response.Body.WriteAsync(buffer)
-                            ArrayPool<byte>.Shared.Return(buffer.Array)
-                        else
-                            return ()
-                    }
-            member this.Deserialize _ =
-                failwith "Not implemented"
 
 
     [<EntryPoint>]
     [<EntryPoint>]
     let main args =
     let main args =
         let builder = WebApplication.CreateBuilder(args)
         let builder = WebApplication.CreateBuilder(args)
         builder.Services
         builder.Services
             .AddRouting()
             .AddRouting()
-            .AddOxpecker()
-            .AddSingleton<Serializers.IJsonSerializer>(SpanJsonSerializer())
-        |> ignore
-        builder.Logging.ClearProviders() |> ignore
+            .AddOxpecker() |> ignore
+        builder.Logging
+            .ClearProviders() |> ignore
         let app = builder.Build()
         let app = builder.Build()
-        app.UseRouting()
-           .UseOxpecker HttpHandlers.endpoints |> ignore
+        app
+            .UseRouting()
+            .UseOxpecker(HttpHandlers.endpoints) |> ignore
         app.Run()
         app.Run()
         0
         0

+ 1 - 1
frameworks/Java/baratine/README.md

@@ -13,7 +13,7 @@ This is the Baratine portion of a [benchmarking test suite](../) comparing a var
 ## Software Versions
 ## Software Versions
 
 
 * [Java OpenJDK 1.8](http://openjdk.java.net/)
 * [Java OpenJDK 1.8](http://openjdk.java.net/)
-* [Baratine 0.11.0](http://baratine.io/)
+* [Baratine 0.11.0](https://github.com/baratine/baratine)
 
 
 ## Test URLs
 ## Test URLs
 
 

+ 0 - 39
frameworks/Java/comsat/README.md

@@ -1,39 +0,0 @@
-# Parallel Universe Comsat Benchmarking Test
-
-This is the [Parallel Universe Comsat](http://docs.paralleluniverse.co/comsat/#overview) version of a [benchmarking test suite](../) comparing a variety of web development platforms. It serves requests in lightweight [Quasar fibers](http://docs.paralleluniverse.co/quasar/#fibers) rather than heavyweight Java threads. There are two main flavors: Comsat Servlet and Comsat Web Actors.
-
-## Comsat Servlet
-
-[Parallel Universe Comsat Servlet](http://docs.paralleluniverse.co/comsat/#servlets) works with any servlet containers (tests are run against embedded Undertow and Jetty).
-
-### JSON Encoding and Plaintext Tests
-
-* [JSON test source](src/main/java/hello/servlet/JsonServlet.java)
-* [Plaintext test source](src/main/java/hello/servlet/PlaintextServlet.java)
-
-## Comsat Web Actors
-
-[Parallel Universe Comsat Web Actors](http://docs.paralleluniverse.co/comsat/#web-actors) runs as an Undertow or Netty handler.
-
-### JSON and Plaintest Encoding Tests
-
-* [JSON test source](src/main/java/hello/webactors/HelloWebActor.java)
-
-## Versions
-
-* Jackson JSON 2.7.4 (https://github.com/FasterXML/jackson)
-* Quasar 0.7.5 (http://docs.paralleluniverse.co/quasar)
-* Comsat 0.7.0 (http://docs.paralleluniverse.co/comsat)
-* Jetty 9.3.9.v20160517 (https://www.eclipse.org/jetty/)
-* Netty 4.0.36.Final (http://netty.io/)
-* Undertow 1.3.22-final (http://undertow.io)
-
-## Test URLs
-
-### JSON Encoding Test
-
-    http://localhost:8080/json
-
-### Plaintest
-
-    http://localhost:8080/plaintest

+ 0 - 83
frameworks/Java/comsat/benchmark_config.json

@@ -1,83 +0,0 @@
-{
-  "framework": "comsat",
-  "tests": [
-    {
-      "default": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Platform",
-        "database": "None",
-        "framework": "None",
-        "language": "Java",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "Servlet",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "comsat-servlet-jetty",
-        "notes": "Comsat servlet on embedded Jetty",
-        "versus": ""
-      },
-      "servlet-undertow": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Platform",
-        "database": "None",
-        "framework": "None",
-        "language": "Java",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "Servlet",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "Comsat",
-        "notes": "Comsat servlet on embedded Undertow",
-        "versus": "comsat"
-      },
-      "webactors-netty": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Platform",
-        "database": "None",
-        "framework": "None",
-        "language": "Java",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "Comsat",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "Comsat",
-        "notes": "Comsat Web Actors run as Netty handler",
-        "versus": ""
-      },
-      "webactors-undertow": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Platform",
-        "database": "None",
-        "framework": "None",
-        "language": "Java",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "Comsat",
-        "webserver": "None",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "Comsat",
-        "notes": "Comsat Web Actors run as Undertow handler",
-        "versus": "comsat-webactors-netty"
-      }
-    }
-  ]
-}

+ 0 - 100
frameworks/Java/comsat/build.gradle

@@ -1,100 +0,0 @@
-// Capsule plugin
-plugins {
-    id "us.kirchmeier.capsule" version "1.0.2"
-}
-
-apply plugin: 'java'
-
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
-
-version = '0.3'
-
-ext.jacksonVer  = '2.9.9'
-ext.quasarVer   = '0.7.5'
-ext.comsatVer   = '0.7.0'
-ext.capsuleVer  = '1.0.2'
-
-ext.jettyVer    = '9.3.9.v20160517'
-ext.undertowVer = '1.3.22.Final'
-ext.nettyVer    = '4.0.37.Final'
-
-ext.slf4jVer    = '1.7.21'
-
-[compileJava, compileTestJava]*.options*.encoding = "UTF-8"
-
-repositories {
-    mavenCentral()
-    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
-    // mavenLocal()
-}
-
-configurations {
-    quasar
-}
-
-configurations.all {
-    resolutionStrategy {
-        failOnVersionConflict()
-        force "org.eclipse.jetty:jetty-util:$jettyVer"
-        force "org.eclipse.jetty:jetty-io:$jettyVer"
-        force "org.eclipse.jetty:jetty-http:$jettyVer"
-        force "org.eclipse.jetty:jetty-server:$jettyVer"
-        force "org.eclipse.jetty:jetty-servlet:$jettyVer"
-        force "org.eclipse.jetty:jetty-webapp:$jettyVer"
-        force "org.eclipse.jetty:jetty-xml:$jettyVer"
-        force "org.eclipse.jetty.websocket:websocket-server:$jettyVer"
-        force "org.eclipse.jetty.websocket:websocket-servlet:$jettyVer"
-        force "org.eclipse.jetty.websocket:websocket-client:$jettyVer"
-        force "io.undertow:undertow-core:$undertowVer"
-        force "io.undertow:undertow-servlet:$undertowVer"
-        force "io.netty:netty-all:$nettyVer"
-        force "org.slf4j:slf4j-api:$slf4jVer"
-        force "co.paralleluniverse:quasar-actors:$quasarVer"
-    }
-}
-
-configurations.capsule.dependencies.clear()
-
-dependencies {
-    compile "co.paralleluniverse:quasar-core:$quasarVer:jdk8"
-    compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVer"
-    compile "co.paralleluniverse:comsat-servlet:$comsatVer"
-    compile "co.paralleluniverse:comsat-test-utils:$comsatVer"
-    compile "co.paralleluniverse:comsat-actors-api:$comsatVer"
-    compile "co.paralleluniverse:comsat-actors-netty:$comsatVer"
-    compile "co.paralleluniverse:comsat-actors-undertow:$comsatVer"
-    compile "co.paralleluniverse:comsat-test-utils:$comsatVer"
-
-    capsule "co.paralleluniverse:capsule:$capsuleVer"
-
-    quasar "co.paralleluniverse:quasar-core:$quasarVer:jdk8"
-}
-
-task capsule(type: FatCapsule) {
-    applicationClass "hello.World"
-
-    capsuleManifest {
-        javaAgents = [configurations.quasar.iterator().next().getName()]
-
-        mode('servlet-undertow') {
-            systemProperties['serverClass'] = 'hello.servlet.UndertowServer'
-        }
-
-        mode('servlet-jetty') {
-            systemProperties['serverClass'] = 'hello.servlet.JettyServer'
-        }
-        
-        mode('webactors-netty') {
-            systemProperties['serverClass'] = 'hello.webactors.NettyServer'
-        }
-
-        mode('webactors-undertow') {
-            systemProperties['serverClass'] = 'hello.webactors.UndertowServer'
-        }
-    }
-}
-
-task wrapper(type: Wrapper) {
-    gradleVersion = '2.14'
-}

+ 0 - 14
frameworks/Java/comsat/comsat-servlet-undertow.dockerfile

@@ -1,14 +0,0 @@
-FROM gradle:4.7.0-jdk8 as gradle
-USER root
-WORKDIR /comsat
-COPY build.gradle build.gradle
-COPY src src
-RUN gradle capsule -q
-
-FROM openjdk:8-jre-slim
-WORKDIR /comsat
-COPY --from=gradle /comsat/build/libs/comsat-0.3-capsule.jar app.jar
-
-EXPOSE 8080
-
-CMD ["java", "-Dcapsule.mode=servlet-undertow", "-jar", "app.jar"]

+ 0 - 14
frameworks/Java/comsat/comsat-webactors-netty.dockerfile

@@ -1,14 +0,0 @@
-FROM gradle:4.7.0-jdk8 as gradle
-USER root
-WORKDIR /comsat
-COPY build.gradle build.gradle
-COPY src src
-RUN gradle capsule -q
-
-FROM openjdk:8-jre-slim
-WORKDIR /comsat
-COPY --from=gradle /comsat/build/libs/comsat-0.3-capsule.jar app.jar
-
-EXPOSE 8080
-
-CMD ["java", "-Dcapsule.mode=webactors-netty", "-jar", "app.jar"]

+ 0 - 14
frameworks/Java/comsat/comsat-webactors-undertow.dockerfile

@@ -1,14 +0,0 @@
-FROM gradle:4.7.0-jdk8 as gradle
-USER root
-WORKDIR /comsat
-COPY build.gradle build.gradle
-COPY src src
-RUN gradle capsule -q
-
-FROM openjdk:8-jre-slim
-WORKDIR /comsat
-COPY --from=gradle /comsat/build/libs/comsat-0.3-capsule.jar app.jar
-
-EXPOSE 8080
-
-CMD ["java", "-Dcapsule.mode=webactors-undertow", "-jar", "app.jar"]

+ 0 - 14
frameworks/Java/comsat/comsat.dockerfile

@@ -1,14 +0,0 @@
-FROM gradle:4.7.0-jdk8 as gradle
-USER root
-WORKDIR /comsat
-COPY build.gradle build.gradle
-COPY src src
-RUN gradle capsule -q
-
-FROM openjdk:8-jre-slim
-WORKDIR /comsat
-COPY --from=gradle /comsat/build/libs/comsat-0.3-capsule.jar app.jar
-
-EXPOSE 8080
-
-CMD ["java", "-Dcapsule.mode=servlet-jetty", "-jar", "app.jar"]

+ 0 - 54
frameworks/Java/comsat/config.toml

@@ -1,54 +0,0 @@
-[framework]
-name = "comsat"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Servlet"
-webserver = "None"
-versus = ""
-
-[servlet-undertow]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Servlet"
-webserver = "None"
-versus = "comsat"
-
-[webactors-netty]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Comsat"
-webserver = "None"
-versus = ""
-
-[webactors-undertow]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-approach = "Realistic"
-classification = "Platform"
-database = "None"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "Comsat"
-webserver = "None"
-versus = "comsat-webactors-netty"

+ 0 - 6
frameworks/Java/comsat/src/main/java/hello/Server.java

@@ -1,6 +0,0 @@
-package hello;
-
-@FunctionalInterface
-public interface Server {
-    void run() throws Exception;
-}

+ 0 - 10
frameworks/Java/comsat/src/main/java/hello/World.java

@@ -1,10 +0,0 @@
-package hello;
-
-public final class World {
-    public static void main(String[] args) throws Exception {
-        final Server s = (Server) Class.forName(System.getProperty("serverClass", "hello.JettyServer")).newInstance();
-        s.run();
-    }
-
-    private World() {}
-}

+ 0 - 46
frameworks/Java/comsat/src/main/java/hello/servlet/JettyServer.java

@@ -1,46 +0,0 @@
-package hello.servlet;
-
-import hello.Server;
-import co.paralleluniverse.embedded.containers.AbstractEmbeddedServer;
-
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-
-/**
- * An implementation of the TechEmpower benchmark tests using Comsat servlets and the Jetty servlet container.
- */
-public final class JettyServer implements Server {
-    @Override
-    public final void run() throws Exception {
-        final org.eclipse.jetty.server.Server s = new org.eclipse.jetty.server.Server(new QueuedThreadPool(200, Runtime.getRuntime().availableProcessors()));
-
-        final ServerConnector http = new ServerConnector(s);
-        http.setReuseAddress(true);
-        http.setAcceptQueueSize(100000);
-        http.setPort(8080);
-        s.addConnector(http);
-
-        final ServletContextHandler context = new ServletContextHandler();
-        context.setContextPath("/");
-
-        final ServletHolder holder1 = new ServletHolder(new PlaintextServlet());
-        context.addServlet(holder1, "/plaintext");
-        holder1.setAsyncSupported(true);
-        final ServletHolder holder2 = new ServletHolder(new JsonServlet());
-        context.addServlet(holder2, "/json");
-        holder2.setAsyncSupported(true);
-
-        s.setHandler(context);
-
-        s.start();
-        System.err.println("Server is up.");
-
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/plaintext");
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/json");
-        System.err.println("Server test cases are instrumented and bootstrapped.");
-
-        s.join();
-    }
-}

+ 0 - 30
frameworks/Java/comsat/src/main/java/hello/servlet/JsonServlet.java

@@ -1,30 +0,0 @@
-package hello.servlet;
-
-import co.paralleluniverse.fibers.Suspendable;
-import co.paralleluniverse.fibers.servlet.FiberHttpServlet;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-
-@SuppressWarnings("serial")
-public final class JsonServlet extends FiberHttpServlet {
-    private static final class HelloWorldData {
-        @SuppressWarnings("unused")
-        public final String message = "Hello, World!";
-    }
-
-    private static final ObjectMapper mapper = new ObjectMapper();
-
-    @Override
-    @Suspendable
-    protected final void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
-        resp.setContentType("application/json");
-        resp.setHeader("Server", "comsat-servlet-undertow");
-        mapper.writeValue(resp.getOutputStream(), new HelloWorldData());
-    }
-}

+ 0 - 24
frameworks/Java/comsat/src/main/java/hello/servlet/PlaintextServlet.java

@@ -1,24 +0,0 @@
-package hello.servlet;
-
-import co.paralleluniverse.fibers.Suspendable;
-import co.paralleluniverse.fibers.servlet.FiberHttpServlet;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-
-@SuppressWarnings("serial")
-public final class PlaintextServlet extends FiberHttpServlet {
-    private static final byte[] helloWorld = "Hello, World!".getBytes(StandardCharsets.ISO_8859_1);
-
-    @Override
-    @Suspendable
-    protected final void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
-        resp.setContentType("text/plain");
-        resp.setHeader("Server", "comsat-servlet-undertow");
-        resp.getOutputStream().write(helloWorld);
-    }
-}

+ 0 - 101
frameworks/Java/comsat/src/main/java/hello/servlet/UndertowServer.java

@@ -1,101 +0,0 @@
-package hello.servlet;
-
-import co.paralleluniverse.embedded.containers.AbstractEmbeddedServer;
-import hello.Server;
-import io.undertow.Undertow;
-import io.undertow.UndertowOptions;
-import io.undertow.server.HttpHandler;
-import io.undertow.servlet.Servlets;
-import io.undertow.servlet.api.DeploymentInfo;
-import io.undertow.servlet.api.DeploymentManager;
-
-import org.xnio.Options;
-
-import java.io.IOException;
-
-/**
- * An implementation of the TechEmpower benchmark tests using Comsat servlets and the Undertow servlet container.
- */
-public final class UndertowServer implements Server {
-    @Override
-    public final void run() throws Exception {
-        final DeploymentInfo deployment = Servlets.deployment().setDeploymentName("")
-            .setClassLoader(ClassLoader.getSystemClassLoader())
-            .setContextPath("/");
-
-        deployment.addServlet(Servlets.servlet("plaintext", PlaintextServlet.class).addMapping("/plaintext").setAsyncSupported(true));
-        deployment.addServlet(Servlets.servlet("json", JsonServlet.class).addMapping("/json").setAsyncSupported(true));
-
-        final DeploymentManager servletsContainer = Servlets.defaultContainer().addDeployment(deployment);
-
-        servletsContainer.deploy();
-
-        final HttpHandler handler = servletsContainer.start();
-
-        //noinspection deprecation
-        final Undertow server = Undertow.builder()
-            .setHandler(handler)
-            .setDirectBuffers(true)
-
-            .setIoThreads(100)
-            .setWorkerThreads(100)
-
-            .setServerOption(Options.CONNECTION_HIGH_WATER, 100_000)
-            .setServerOption(Options.CONNECTION_LOW_WATER, 100_000)
-
-            .setBufferSize(1024)
-            .setBuffersPerRegion(100)
-
-            // .setSocketOption(Options.ALLOW_BLOCKING, true)
-            .setSocketOption(Options.REUSE_ADDRESSES, true)
-            // .setSocketOption(Options.CORK, true)
-            // .setSocketOption(Options.USE_DIRECT_BUFFERS, true)
-            .setSocketOption(Options.BACKLOG, 100000)
-            .setSocketOption(Options.TCP_NODELAY, true)
-            // .setSocketOption(Options.RECEIVE_BUFFER, 2048)
-            // .setSocketOption(Options.SEND_BUFFER, 2048)
-            // .setSocketOption(Options.CONNECTION_HIGH_WATER, Integer.MAX_VALUE)
-            // .setSocketOption(Options.CONNECTION_LOW_WATER, Integer.MAX_VALUE)
-            // .setSocketOption(Options.READ_TIMEOUT, Integer.MAX_VALUE)
-            // .setSocketOption(Options.WRITE_TIMEOUT, Integer.MAX_VALUE)
-            // .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
-
-            // .setServerOption(UndertowOptions.ALWAYS_SET_DATE, true)
-            .setServerOption(UndertowOptions.ENABLE_CONNECTOR_STATISTICS, false)
-            .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, false)
-
-            .addHttpListener(8080, "0.0.0.0")
-            .build();
-
-        server.start();
-
-        System.err.println("Server is up.");
-
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public final void run() {
-                try {
-                    server.stop();
-
-                    System.err.println("Server is down.");
-                } catch (final Exception e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        });
-
-        new Thread() {
-            @Override
-            public final void run() {
-                try {
-                    AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/plaintext");
-                    AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/json");
-
-                    System.err.println("Server test cases are instrumented and bootstrapped.");
-                } catch (final InterruptedException | IOException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }.start();
-    }
-}

+ 0 - 68
frameworks/Java/comsat/src/main/java/hello/webactors/NettyServer.java

@@ -1,68 +0,0 @@
-package hello.webactors;
-
-import co.paralleluniverse.comsat.webactors.netty.AutoWebActorHandler;
-import co.paralleluniverse.embedded.containers.AbstractEmbeddedServer;
-import hello.Server;
-import io.netty.bootstrap.ServerBootstrap;
-import io.netty.buffer.PooledByteBufAllocator;
-import io.netty.channel.*;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.channel.socket.nio.NioServerSocketChannel;
-import io.netty.handler.codec.http.HttpObjectAggregator;
-import io.netty.handler.codec.http.HttpRequestDecoder;
-import io.netty.handler.codec.http.HttpResponseEncoder;
-
-import java.util.Map;
-import java.util.concurrent.Callable;
-
-public final class NettyServer implements Server {
-    @Override
-    public final void run() throws Exception {
-        WebActor.SERVER = "comsat-webactors-netty";
-        final ServerBootstrap b = new ServerBootstrap();
-
-        b.option(ChannelOption.SO_BACKLOG, 100000);
-        b.childOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 0);
-        b.childOption(ChannelOption.TCP_NODELAY, true);
-        b.childOption(ChannelOption.SO_REUSEADDR, true);
-        b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
-
-        final ChannelInitializer<SocketChannel> childHandler = new SocketChannelChannelInitializer(() -> new AutoWebActorHandler() {
-            @Override
-            protected AutoContextProvider newContextProvider(ClassLoader userClassLoader, Map<Class<?>, Object[]> actorParams) {
-                return new AutoContextProvider(userClassLoader, actorParams, 1_000_000L /* ms */);
-            }
-        });
-        final NioEventLoopGroup group = new NioEventLoopGroup(200);
-        b.group(group)
-            .channel(NioServerSocketChannel.class)
-            .childHandler(childHandler);
-
-        final ChannelFuture cf = b.bind(8080);
-        cf.sync();
-
-        System.err.println("Server is up.");
-
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/plaintext");
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/json");
-        System.err.println("Server test cases are instrumented and bootstrapped.");
-    }
-
-    private static final class SocketChannelChannelInitializer extends ChannelInitializer<SocketChannel> {
-        private final Callable<SimpleChannelInboundHandler<Object>> handlerProvider;
-
-        public SocketChannelChannelInitializer(Callable<SimpleChannelInboundHandler<Object>> handlerProvider) {
-            this.handlerProvider = handlerProvider;
-        }
-
-        @Override
-        public final void initChannel(SocketChannel ch) throws Exception {
-            final ChannelPipeline pipeline = ch.pipeline();
-            pipeline.addLast(new HttpRequestDecoder());
-            pipeline.addLast(new HttpResponseEncoder());
-            pipeline.addLast(new HttpObjectAggregator(65536));
-            pipeline.addLast(handlerProvider.call());
-        }
-    }
-}

+ 0 - 57
frameworks/Java/comsat/src/main/java/hello/webactors/UndertowServer.java

@@ -1,57 +0,0 @@
-package hello.webactors;
-
-import co.paralleluniverse.comsat.webactors.undertow.AutoWebActorHandler;
-import co.paralleluniverse.embedded.containers.AbstractEmbeddedServer;
-import hello.Server;
-import io.undertow.Undertow;
-import io.undertow.UndertowOptions;
-
-import org.xnio.Options;
-
-public final class UndertowServer implements Server {
-    @Override
-    public final void run() throws Exception {
-        WebActor.SERVER = "comsat-webactors-undertow";
-        //noinspection deprecation
-        final Undertow u = io.undertow.Undertow.builder()
-            .setHandler(new AutoWebActorHandler())
-
-            .setIoThreads(100)
-            .setWorkerThreads(100)
-            .setServerOption(Options.CONNECTION_HIGH_WATER, 100_000)
-            .setServerOption(Options.CONNECTION_LOW_WATER, 100_000)
-
-            .setDirectBuffers(true)
-            .setBufferSize(1024)
-            .setBuffersPerRegion(100)
-
-            // .setSocketOption(Options.ALLOW_BLOCKING, true)
-            .setSocketOption(Options.REUSE_ADDRESSES, true)
-            // .setSocketOption(Options.CORK, true)
-            // .setSocketOption(Options.USE_DIRECT_BUFFERS, true)
-            .setSocketOption(Options.BACKLOG, 100000)
-            .setSocketOption(Options.TCP_NODELAY, true)
-            // .setSocketOption(Options.RECEIVE_BUFFER, 2048)
-            // .setSocketOption(Options.SEND_BUFFER, 2048)
-            // .setSocketOption(Options.CONNECTION_HIGH_WATER, Integer.MAX_VALUE)
-            // .setSocketOption(Options.CONNECTION_LOW_WATER, Integer.MAX_VALUE)
-            // .setSocketOption(Options.READ_TIMEOUT, Integer.MAX_VALUE)
-            // .setSocketOption(Options.WRITE_TIMEOUT, Integer.MAX_VALUE)
-            // .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) //don't send a keep-alive header for HTTP/1.1 requests, as it is not required
-
-            // .setServerOption(UndertowOptions.ALWAYS_SET_DATE, true)
-            .setServerOption(UndertowOptions.ENABLE_CONNECTOR_STATISTICS, false)
-            .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, false)
-
-            .addHttpListener(8080, "0.0.0.0")
-            .build();
-
-        new Thread(u::start).start();
-
-        System.err.println("Server is up.");
-
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/plaintext");
-        AbstractEmbeddedServer.waitUrlAvailable("http://localhost:8080/json");
-        System.err.println("Server test cases are instrumented and bootstrapped.");
-    }
-}

+ 0 - 57
frameworks/Java/comsat/src/main/java/hello/webactors/WebActor.java

@@ -1,57 +0,0 @@
-package hello.webactors;
-
-import co.paralleluniverse.actors.BasicActor;
-import co.paralleluniverse.comsat.webactors.HttpRequest;
-import co.paralleluniverse.comsat.webactors.HttpResponse;
-
-import co.paralleluniverse.fibers.SuspendExecution;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import java.nio.ByteBuffer;
-
-import static co.paralleluniverse.comsat.webactors.HttpResponse.error;
-import static co.paralleluniverse.comsat.webactors.HttpResponse.ok;
-
[email protected](httpUrlPatterns = {"/*"})
-public final class WebActor extends BasicActor<Object, Void> {
-    static String SERVER = "comsat-webactors";
-
-    private static final String HELLO_WORLD = "Hello, World!";
-    private static final byte[] HELLO_WORLD_A = HELLO_WORLD.getBytes();
-
-    private static final class HelloWorldData {
-        @SuppressWarnings("unused")
-        public final String message = HELLO_WORLD;
-    }
-
-    private static final ObjectMapper mapper = new ObjectMapper();
-
-    @Override
-    protected final Void doRun() throws InterruptedException, SuspendExecution {
-        final Object message = receive();
-        if (message instanceof HttpRequest) {
-            final HttpRequest req = (HttpRequest) message;
-            HttpResponse.Builder res;
-            final String s = req.getRequestURI();
-            if ("/plaintext".equals(s)) {
-                final ByteBuffer b = ByteBuffer.wrap(HELLO_WORLD_A);
-                res = ok(self(), req, b).setContentType("text/plain");
-            } else if ("/json".equals(s)) {
-                try {
-                    res = ok(self(), req, mapper.writeValueAsString(new HelloWorldData())).setContentType("application/json");
-                } catch (final JsonProcessingException e) {
-                    throw new RuntimeException(e);
-                }
-            } else {
-                res = error(self(), req, 404, "Not found");
-            }
-            req.getFrom().send (
-                res
-                    .addHeader("Server", SERVER)
-                    .build()
-            );
-        }
-        return null;
-    }
-}

+ 1 - 1
frameworks/Java/micronaut/gradle.properties

@@ -1 +1 @@
-micronautVersion=4.4.3
+micronautVersion=4.5.0

+ 1 - 1
frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile

@@ -2,7 +2,7 @@ FROM ghcr.io/graalvm/native-image-community:21-ol9 as build
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 COPY . /home/gradle/src
 COPY . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN ./gradlew micronaut-data-jdbc:nativeCompile -x test --no-daemon
+RUN ./gradlew micronaut-data-jdbc:nativeCompile -x test -x internalStartTestResourcesService --no-daemon
 
 
 FROM cgr.dev/chainguard/wolfi-base:latest
 FROM cgr.dev/chainguard/wolfi-base:latest
 WORKDIR /micronaut
 WORKDIR /micronaut

+ 3 - 3
frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile

@@ -1,9 +1,9 @@
-FROM gradle:8.7.0-jdk21 as build
+FROM gradle:8.7.0-jdk17 as build
 COPY --chown=gradle:gradle . /home/gradle/src
 COPY --chown=gradle:gradle . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN gradle micronaut-data-jdbc:build -x test --no-daemon
+RUN gradle micronaut-data-jdbc:build -x test -x internalStartTestResourcesService --no-daemon
 
 
-FROM openjdk:22
+FROM openjdk:21
 WORKDIR /micronaut
 WORKDIR /micronaut
 COPY --from=build /home/gradle/src/micronaut-data-jdbc/build/libs/micronaut-data-jdbc-all.jar micronaut.jar
 COPY --from=build /home/gradle/src/micronaut-data-jdbc/build/libs/micronaut-data-jdbc-all.jar micronaut.jar
 COPY run_benchmark.sh run_benchmark.sh
 COPY run_benchmark.sh run_benchmark.sh

+ 1 - 1
frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile

@@ -2,7 +2,7 @@ FROM ghcr.io/graalvm/native-image-community:21-ol9 as build
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 COPY . /home/gradle/src
 COPY . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN ./gradlew micronaut-data-mongodb:nativeCompile -x test --no-daemon
+RUN ./gradlew micronaut-data-mongodb:nativeCompile -x test -x internalStartTestResourcesService --no-daemon
 
 
 FROM cgr.dev/chainguard/wolfi-base:latest
 FROM cgr.dev/chainguard/wolfi-base:latest
 WORKDIR /micronaut
 WORKDIR /micronaut

+ 3 - 3
frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile

@@ -1,9 +1,9 @@
-FROM gradle:8.7.0-jdk21 as build
+FROM gradle:8.7.0-jdk17 as build
 COPY --chown=gradle:gradle . /home/gradle/src
 COPY --chown=gradle:gradle . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN gradle micronaut-data-mongodb:build -x test --no-daemon
+RUN gradle micronaut-data-mongodb:build -x test -x internalStartTestResourcesService --no-daemon
 
 
-FROM openjdk:22
+FROM openjdk:21
 WORKDIR /micronaut
 WORKDIR /micronaut
 COPY --from=build /home/gradle/src/micronaut-data-mongodb/build/libs/micronaut-data-mongodb-all.jar micronaut.jar
 COPY --from=build /home/gradle/src/micronaut-data-mongodb/build/libs/micronaut-data-mongodb-all.jar micronaut.jar
 COPY run_benchmark.sh run_benchmark.sh
 COPY run_benchmark.sh run_benchmark.sh

+ 1 - 1
frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile

@@ -2,7 +2,7 @@ FROM ghcr.io/graalvm/native-image-community:21-ol9 as build
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 COPY . /home/gradle/src
 COPY . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN ./gradlew micronaut-data-r2dbc:nativeCompile -x test --no-daemon
+RUN ./gradlew micronaut-data-r2dbc:nativeCompile -x test -x internalStartTestResourcesService --no-daemon
 
 
 FROM cgr.dev/chainguard/wolfi-base:latest
 FROM cgr.dev/chainguard/wolfi-base:latest
 WORKDIR /micronaut
 WORKDIR /micronaut

+ 3 - 3
frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile

@@ -1,9 +1,9 @@
-FROM gradle:8.7.0-jdk21 as build
+FROM gradle:8.7.0-jdk17 as build
 COPY --chown=gradle:gradle . /home/gradle/src
 COPY --chown=gradle:gradle . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN gradle micronaut-data-r2dbc:build -x test --no-daemon
+RUN gradle micronaut-data-r2dbc:build -x test -x internalStartTestResourcesService --no-daemon
 
 
-FROM openjdk:22
+FROM openjdk:21
 WORKDIR /micronaut
 WORKDIR /micronaut
 COPY --from=build /home/gradle/src/micronaut-data-r2dbc/build/libs/micronaut-data-r2dbc-all.jar micronaut.jar
 COPY --from=build /home/gradle/src/micronaut-data-r2dbc/build/libs/micronaut-data-r2dbc-all.jar micronaut.jar
 COPY run_benchmark.sh run_benchmark.sh
 COPY run_benchmark.sh run_benchmark.sh

+ 1 - 1
frameworks/Java/micronaut/micronaut-graalvm.dockerfile

@@ -2,7 +2,7 @@ FROM ghcr.io/graalvm/native-image-community:21-ol9 as build
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 RUN microdnf install findutils # Gradle 8.7 requires xargs
 COPY . /home/gradle/src
 COPY . /home/gradle/src
 WORKDIR /home/gradle/src
 WORKDIR /home/gradle/src
-RUN ./gradlew micronaut-vertx-pg-client:nativeCompile -x test --no-daemon
+RUN ./gradlew micronaut-vertx-pg-client:nativeCompile -x test -x internalStartTestResourcesService --no-daemon
 
 
 FROM cgr.dev/chainguard/wolfi-base:latest
 FROM cgr.dev/chainguard/wolfi-base:latest
 RUN apk --no-cache update && apk add libstdc++
 RUN apk --no-cache update && apk add libstdc++

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