diff --git a/Dockerfile b/Dockerfile index b0a94b7b504..e5df65ea716 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive # WARNING: DON'T PUT A SPACE AFTER ANY BACKSLASH OR APT WILL BREAK @@ -20,22 +20,21 @@ RUN apt-get -yqq update && \ python3 \ python3-dev \ python3-pip \ + python3-psutil \ + python3-psycopg2 \ + python3-requests \ siege \ - software-properties-common - -RUN pip3 install \ + software-properties-common && \ + # Ubuntu's equivalent packages are too old and/or broken. + pip3 install \ + --break-system-packages \ colorama==0.3.1 \ - docker==4.0.2 \ - mysqlclient \ - psutil \ - psycopg2-binary \ - pymongo==3.13.0 \ - # urllib3 incompatibility: - # https://github.com/docker/docker-py/issues/3113#issuecomment-1525500104 - requests==2.28.1 + docker==7.0.0 \ + mysqlclient==2.2.4 \ + pymongo==4.7.2 # Collect resource usage statistics -ARG DOOL_VERSION=v1.2.0 +ARG DOOL_VERSION=v1.3.1 WORKDIR /tmp RUN curl -LSs "https://github.com/scottchiefbaker/dool/archive/${DOOL_VERSION}.tar.gz" | \ diff --git a/frameworks/C++/drogon/drogon-core.dockerfile b/frameworks/C++/drogon/drogon-core.dockerfile index 7d02dc6637f..0149f1fb228 100644 --- a/frameworks/C++/drogon/drogon-core.dockerfile +++ b/frameworks/C++/drogon/drogon-core.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 COPY ./ ./ @@ -11,7 +11,7 @@ RUN apt-get update -yqq && \ zlib1g-dev && \ add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ apt-get update -yqq && \ - apt-get install -yqq gcc-10 g++-10 + apt-get install -yqq gcc g++ RUN locale-gen en_US.UTF-8 @@ -19,10 +19,10 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV CC=gcc-10 -ENV CXX=g++-10 -ENV AR=gcc-ar-10 -ENV RANLIB=gcc-ranlib-10 +ENV CC=gcc +ENV CXX=g++ +ENV AR=gcc-ar +ENV RANLIB=gcc-ranlib ENV IROOT=/install ENV DROGON_ROOT=$IROOT/drogon @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon WORKDIR $DROGON_ROOT -RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092 +RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc RUN git submodule update --init RUN mkdir build diff --git a/frameworks/C++/drogon/drogon.dockerfile b/frameworks/C++/drogon/drogon.dockerfile index c94d2f43525..104219222f0 100644 --- a/frameworks/C++/drogon/drogon.dockerfile +++ b/frameworks/C++/drogon/drogon.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 COPY ./ ./ @@ -11,7 +11,7 @@ RUN apt-get update -yqq && \ zlib1g-dev && \ add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ apt-get update -yqq && \ - apt-get install -yqq gcc-10 g++-10 + apt-get install -yqq gcc g++ RUN locale-gen en_US.UTF-8 @@ -19,10 +19,10 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV CC=gcc-10 -ENV CXX=g++-10 -ENV AR=gcc-ar-10 -ENV RANLIB=gcc-ranlib-10 +ENV CC=gcc +ENV CXX=g++ +ENV AR=gcc-ar +ENV RANLIB=gcc-ranlib ENV IROOT=/install ENV DROGON_ROOT=$IROOT/drogon @@ -41,7 +41,7 @@ RUN git clone https://github.com/an-tao/drogon WORKDIR $DROGON_ROOT -RUN git checkout ebf87d69d7bb45dfa478ba364ef9374d9be25092 +RUN git checkout 96919df488e0ebaa0ed304bbd76bba33508df3cc RUN git submodule update --init RUN mkdir build diff --git a/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.cc b/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.cc index 143c7a4ec63..0e21a547ff6 100644 --- a/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.cc +++ b/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.cc @@ -22,8 +22,8 @@ void FortuneCtrlRaw::asyncHandleHttpRequest( rows.reserve(r.size() + 1); for (auto const &row : r) { - rows.emplace_back(row[0ul].as(), // id - row[1ul].as()); // message + rows.emplace_back(row[0ul].as(), // id + row[1ul].as()); // message } rows.emplace_back("0", "Additional fortune added at request time."); std::sort(rows.begin(), diff --git a/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.h b/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.h index ec0217bcd88..82f3c0ebcd1 100644 --- a/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.h +++ b/frameworks/C++/drogon/drogon_benchmark/controllers/FortuneCtrlRaw.h @@ -1,17 +1,18 @@ #pragma once #include #include +#include using namespace drogon; struct Fortune { - Fortune(string_view &&id, string_view &&message) + Fortune(std::string_view &&id, std::string_view &&message) : id_(std::move(id)), message_(std::move(message)) { } Fortune() = default; - string_view id_; - string_view message_; + std::string_view id_; + std::string_view message_; }; class FortuneCtrlRaw : public drogon::HttpSimpleController { diff --git a/frameworks/C++/drogon/drogon_benchmark/controllers/UpdatesCtrlRaw.cc b/frameworks/C++/drogon/drogon_benchmark/controllers/UpdatesCtrlRaw.cc index 71c19bcf2f7..065362eee85 100644 --- a/frameworks/C++/drogon/drogon_benchmark/controllers/UpdatesCtrlRaw.cc +++ b/frameworks/C++/drogon/drogon_benchmark/controllers/UpdatesCtrlRaw.cc @@ -43,7 +43,7 @@ void UpdatesCtrlRaw::update( const DbClientPtr &client) { auto const &sql = getSQL(results->size()); - auto sqlBinder = *client << string_view(sql.data(), sql.length()); + auto sqlBinder = *client << std::string_view(sql.data(), sql.length()); Json::Value json; json.resize(0); for (auto const &w : *results) diff --git a/frameworks/C++/paozhu/README.md b/frameworks/C++/paozhu/README.md new file mode 100755 index 00000000000..089e3030ca3 --- /dev/null +++ b/frameworks/C++/paozhu/README.md @@ -0,0 +1,40 @@ +# paozhu Benchmarking Test + +This is the [Paozhu](https://github.com/hggq/paozhu) + +This Benchmarking Test code from https://github.com/hggq/paozhu/releases/tag/v1.5.8 + +### Test Type Implementation Source Code + +* [Benchmark code](controller/src/techempower.cpp) +* [ORM config](conf/orm.conf) +* [Server config](conf/server.conf) + +## Test URLs +### JSON + +http://localhost:8888/json + +### PLAINTEXT + +http://localhost:8888/plaintext + + +### Single Database Query + +http://localhost:8888/db + +### Fortune + +http://localhost:8888/fortunes + +### Multiple Database Queries + +http://localhost:8888/queries?queries=10 + +### Database Updates + +http://localhost:8888/updates?queries=10 + +### Cache +http://localhost:8888/cached-queries?count=20 \ No newline at end of file diff --git a/frameworks/C++/paozhu/benchmark_config.json b/frameworks/C++/paozhu/benchmark_config.json new file mode 100755 index 00000000000..e50ee5ece64 --- /dev/null +++ b/frameworks/C++/paozhu/benchmark_config.json @@ -0,0 +1,31 @@ +{ + "framework": "paozhu", + "tests": [ + { + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "fortune_url": "/fortunes", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "cached_query_url": "/cached-queries?count=", + "port": 8888, + "approach": "Realistic", + "classification": "Fullstack", + "database": "MySQL", + "framework": "paozhu", + "language": "C++", + "flavor": "None", + "orm": "Micro", + "platform": "None", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "paozhu", + "notes": "", + "versus": "None" + } + } + ] +} \ No newline at end of file diff --git a/frameworks/C++/paozhu/config.toml b/frameworks/C++/paozhu/config.toml new file mode 100644 index 00000000000..dab3170664a --- /dev/null +++ b/frameworks/C++/paozhu/config.toml @@ -0,0 +1,22 @@ +[framework] +name = "paozhu" +authors = ["Huang ziquan "] +github = "https://github.com/hggq/paozhu" + +[main] +urls.plaintext = "/plaintext" +urls.json = "/json" +urls.db = "/db" +urls.query = "/queries?queries=" +urls.update = "/updates?queries=" +urls.fortune = "/fortunes" +urls.cached_query = "/cached-queries?count=" +approach = "Realistic" +classification = "Fullstack" +database = "MySQL" +database_os = "Linux" +os = "Linux" +orm = "Micro" +platform = "None" +webserver = "None" +versus = "None" diff --git a/frameworks/C++/paozhu/paozhu.dockerfile b/frameworks/C++/paozhu/paozhu.dockerfile new file mode 100644 index 00000000000..8086f6eafe6 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu.dockerfile @@ -0,0 +1,54 @@ +FROM ubuntu:22.04 +RUN apt-get update -yqq && apt-get install -yqq apt-utils software-properties-common wget unzip cmake git +RUN apt-get install -yqq gcc g++ openssl libssl-dev zlib1g-dev build-essential locales + +RUN apt-get -y install brotli libbrotli-dev +RUN apt-get -y install libreadline-dev +RUN apt-get -y install mysql-client +RUN apt-get -y install libmysqlclient-dev + +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +COPY ./ ./ +WORKDIR / + +# RUN wget https://github.com/hggq/paozhu/releases/download/v1.5.8/benchmark.zip +RUN git clone https://github.com/hggq/paozhu +# RUN unzip benchmark.zip +RUN rm -Rf ./paozhu/controller +RUN rm -Rf ./paozhu/libs +RUN mkdir ./paozhu/libs +RUN mkdir ./paozhu/libs/types + +RUN mkdir ./paozhu/controller +RUN mkdir ./paozhu/controller/include +RUN mkdir ./paozhu/controller/src + +COPY ./paozhu_benchmark/controller/include/techempower.h ./paozhu/controller/include/ +COPY ./paozhu_benchmark/controller/src/techempower.cpp ./paozhu/controller/src/ + +COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/ +COPY ./paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp ./paozhu/libs/types/ + +COPY ./paozhu_benchmark/common/autocontrolmethod.hpp ./paozhu/common/ +COPY ./paozhu_benchmark/common/reghttpmethod_pre.hpp ./paozhu/common/ +COPY ./paozhu_benchmark/common/reghttpmethod.hpp ./paozhu/common/ +COPY ./paozhu_benchmark/common/json_reflect_headers.h ./paozhu/common/ + +COPY ./paozhu_benchmark/conf/server.conf ./paozhu/conf/server.conf +COPY ./paozhu_benchmark/conf/orm.conf ./paozhu/conf/orm.conf +COPY ./paozhu_benchmark/CMakeLists.txt ./paozhu/CMakeLists.txt + +WORKDIR /paozhu +RUN unzip asio.zip + +RUN cmake . -B build -DCMAKE_BUILD_TYPE=Release +RUN cmake --build build + + +EXPOSE 8888 + +CMD ./bin/paozhu diff --git a/frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt b/frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt new file mode 100755 index 00000000000..b8bf972dbc2 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/CMakeLists.txt @@ -0,0 +1,508 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.20) + +cmake_policy(SET CMP0048 NEW) + +set(ENABLE_VCPKG OFF CACHE BOOL "choose ON to enable") +set(ENABLE_BOOST OFF CACHE BOOL "choose ON to enable") +set(ENABLE_GD OFF CACHE BOOL "choose ON to enable") +set(ENABLE_WIN_VCPKG OFF CACHE BOOL "choose ON to enable") + +if (ENABLE_GD STREQUAL "ON") + list(FIND VCPKG_MANIFEST_FEATURES "gd" index) + if (index EQUAL -1) + message(STATUS "Auto append features: gd") + list(APPEND VCPKG_MANIFEST_FEATURES "gd") + endif () +endif () + +if (ENABLE_BOOST STREQUAL "ON") + list(FIND VCPKG_MANIFEST_FEATURES "boost" index) + if (index EQUAL -1) + message(STATUS "Auto append features: boost") + list(APPEND VCPKG_MANIFEST_FEATURES "boost") + endif () +endif () + +PROJECT(Paozhu_web_framework) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(mode "CMAKE_BUILD_TYPE") + +set(BOOST_OPEN " ") +set(GD_OPEN " ") + +if(ENABLE_BOOST STREQUAL "ON") + message("ENABLE_BOOST") + set(BOOST_OPEN " -DENABLE_BOOST ") +endif() + +if(ENABLE_GD STREQUAL "ON") + message("ENABLE_GD") + set(GD_OPEN " -DENABLE_GD ") +endif() + +set(sys_so_path "/usr/lib64") + +if (IS_DIRECTORY "/usr/lib/x86_64-linux-gnu") + set(sys_so_path "/usr/lib/x86_64-linux-gnu") +endif() + +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0601") +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /EHsc") +endif () + +if(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Debug")) + + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_STANDALONE -DDEBUG ${BOOST_OPEN} ${GD_OPEN}") + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g") + endif () + else() + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include -I/usr/include -I/usr/include/mysql " ) + endif () + message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}") + +elseif(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release")) + + if (CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -O3") + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread") + endif () + else () + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -O3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -DASIO_STANDALONE ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include -I/usr/include -I/usr/include/mysql " ) + file(MAKE_DIRECTORY /usr/local/etc/paozhu) + file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/conf/ DESTINATION /usr/local/etc/paozhu/) + endif () + message("Release mode:${CMAKE_CXX_FLAGS_RELEASE}") + +else() + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra") + message("Debug mode:${CMAKE_CXX_FLAGS_DEBUG}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pthread -g -fsanitize=address -DASIO_STANDALONE -DDEBUG ${BOOST_OPEN} ${GD_OPEN} -I/usr/local/include -I/usr/local/mysql/include -I/usr/include -I/usr/include/mysql " ) + + if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif () +endif() + + + +file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/temp) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/log) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set(USE_STANDALONE_ASIO ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +message(STATUS "SOURCE dir ${CMAKE_CURRENT_SOURCE_DIR}") + + +set(CMAKE_BUILD_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build) +set(CMAKE_CACHEFILE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build) +set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/controller) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/include) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/websockets/include) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty) + file(REMOVE_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty) +endif () +#EXECUTE_PROCESS(COMMAND rm ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty) +set(PAOZHU_PRE paozhu_pre) +add_executable(${PAOZHU_PRE} ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/autopickmethod.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/src/md5.cpp) +add_executable(paozhu_empty ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/autoemptymethod.cpp) + + + +file(GLOB_RECURSE orm_list ${CMAKE_CURRENT_SOURCE_DIR}/orm/*.cpp) +file(GLOB_RECURSE source_list ${CMAKE_CURRENT_SOURCE_DIR}/models/*.cpp) +file(GLOB_RECURSE FRAMEWORK_CPP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver/*.cpp) +file(GLOB_RECURSE common_list ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp) +file(GLOB_RECURSE controller_list ${CMAKE_CURRENT_SOURCE_DIR}/controller/src/*.cpp) +file(GLOB_RECURSE viewsrc_list ${CMAKE_CURRENT_SOURCE_DIR}/viewsrc/view/*.cpp) +file(GLOB_RECURSE reflect_list ${CMAKE_CURRENT_SOURCE_DIR}/libs/*.cpp) +file(GLOB_RECURSE src_list ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) + +foreach(cppfile IN LISTS controller_list) + string(REGEX REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/controller/src/" "" cppfilename ${cppfile}) + string(REGEX REPLACE ".cpp" "" cppbasename ${cppfilename}) +# message(${cppbasename}) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/controller/include/${cppbasename}.h") + else() + file(TOUCH "${CMAKE_CURRENT_SOURCE_DIR}/controller/include/${cppbasename}.h") + endif() +endforeach() + +function(include_sub_directories_recursively root_dir) + if (IS_DIRECTORY ${root_dir}) # 当前路径是一个目录吗,是的话就加入到包含目录 + # if (${root_dir} MATCHES "include") + message("include dir: " ${root_dir}) + include_directories(${root_dir}) + # endif() + endif() + + file(GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir}/*) # 获得当前目录下的所有文件,让如ALL_SUB列表中 + + foreach(sub ${ALL_SUB}) + if (IS_DIRECTORY ${root_dir}/${sub}) + include_sub_directories_recursively(${root_dir}/${sub}) # 对子目录递归调用,包含 + endif() + endforeach() +endfunction() + +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpserver) +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/orm) +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/models) +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/controller/include) +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/libs) +include_sub_directories_recursively(${CMAKE_CURRENT_SOURCE_DIR}/include) + +add_executable(paozhu_cli ${CMAKE_CURRENT_SOURCE_DIR}/vendor/httpcli/http_cli.cpp) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) + + +if(${mode} AND (CMAKE_BUILD_TYPE STREQUAL "Release")) + add_executable(paozhu ${CMAKE_CURRENT_SOURCE_DIR}/test/testbenchmark.cpp ${common_list} ${viewsrc_list} ${FRAMEWORK_CPP_PATH} ${orm_list} ${reflect_list} ${src_list} ${source_list} ${controller_list}) +else() + add_executable(paozhu ${CMAKE_CURRENT_SOURCE_DIR}/test/test.cpp ${common_list} ${viewsrc_list} ${FRAMEWORK_CPP_PATH} ${orm_list} ${reflect_list} ${src_list} ${source_list} ${controller_list}) +endif() + +if (ENABLE_WIN_VCPKG STREQUAL "ON") +else () +add_custom_command( + TARGET paozhu_empty paozhu + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_pre + PRE_BUILD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + COMMAND echo "-- controls method --" + COMMAND ${PAOZHU_PRE} ${CMAKE_CURRENT_SOURCE_DIR}/ + COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/bin/paozhu_empty + ) +endif() + +if (ENABLE_VCPKG) + add_compile_definitions(ENABLE_VCPKG) + find_package(asio CONFIG REQUIRED) + target_link_libraries(paozhu asio::asio) + + if (ENABLE_BOOST) + add_compile_definitions(ENABLE_BOOST) + set(Boost_NO_WARN_NEW_VERSIONS ON) + find_package(Boost REQUIRED COMPONENTS filesystem coroutine) + target_link_libraries(paozhu Boost::boost Boost::filesystem Boost::coroutine) + endif () + + find_package(OpenSSL REQUIRED) + target_link_libraries(paozhu OpenSSL::Crypto OpenSSL::SSL) + + find_package(ZLIB REQUIRED) + target_link_libraries(paozhu ZLIB::ZLIB) + + # find_package(libmysql REQUIRED) + find_package(unofficial-libmariadb CONFIG REQUIRED) + find_path(MYSQL_ROOT_DIR mysql) + # target_link_libraries(paozhu ${MYSQL_LIBRARIES}) + # target_link_libraries(paozhu_cli ${MYSQL_LIBRARIES}) + target_link_libraries(paozhu unofficial::libmariadb) + target_link_libraries(paozhu_cli unofficial::libmariadb) + target_include_directories(paozhu PUBLIC ${MYSQL_ROOT_DIR}/mysql) + target_include_directories(paozhu_cli PUBLIC ${MYSQL_ROOT_DIR}/mysql) + + if (ENABLE_GD STREQUAL "ON") + find_package(PkgConfig) + pkg_check_modules(LIBGD REQUIRED IMPORTED_TARGET gdlib) + target_link_libraries(paozhu PkgConfig::LIBGD) + + find_path(QRENCODE_INCLUDE_DIR NAMES qrencode.h) + find_library(QRENCODE_LIBRARY_RELEASE qrencode) + # find_library(QRENCODE_LIBRARY_DEBUG qrencoded) + # set(QRENCODE_LIBRARIES optimized ${QRENCODE_LIBRARY_RELEASE} debug ${QRENCODE_LIBRARY_DEBUG}) + target_include_directories(paozhu PRIVATE ${QRENCODE_INCLUDE_DIR}) + target_link_libraries(paozhu ${QRENCODE_LIBRARY_RELEASE}) + # MESSAGE(STATUS ${QRENCODE_LIBRARY_RELEASE}) + + # warning: Fixed an issue where ports/libqrencode would not automatically + # copy dll files to the bin directory + if (CMAKE_SYSTEM_NAME MATCHES "Windows") + set(PATH_TO_QRENCODE_DLL "") + if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(PATH_TO_QRENCODE_DLL "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/qrencode.dll") + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(PATH_TO_QRENCODE_DLL "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libqrencode.dll") + endif () + message(STATUS "Selected libqrencode.dll: ${PATH_TO_QRENCODE_DLL}") + + add_custom_command( + TARGET paozhu POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PATH_TO_QRENCODE_DLL} ${CMAKE_CURRENT_SOURCE_DIR}/bin/ + ) + endif () + + find_package(PNG REQUIRED) + target_link_libraries(paozhu PNG::PNG) + + find_package(Freetype REQUIRED) + target_link_libraries(paozhu Freetype::Freetype) + endif () + + find_package(unofficial-brotli CONFIG REQUIRED) + target_link_libraries(paozhu unofficial::brotli::brotlidec unofficial::brotli::brotlienc) +else () + +if(USE_STANDALONE_ASIO) +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") +set(ASIO_PATH "/usr/local/opt/asio/include" "/usr/local/include") +else() +set(ASIO_PATH ${CMAKE_CURRENT_SOURCE_DIR}/asio "/usr/include") +endif() + + target_compile_definitions(paozhu INTERFACE ASIO_STANDALONE) + find_path(ASIO_PATH asio.hpp) + message(state " Standalone Asio found: " ${ASIO_PATH}) + if(NOT ASIO_PATH) + message(FATAL_ERROR "Standalone Asio not found") + else() + target_include_directories(paozhu INTERFACE ${ASIO_PATH}) + endif() + + include_directories(${ASIO_PATH}) + +endif() + + +if(ENABLE_BOOST STREQUAL "ON") +message("---ENABLE_BOOST-----") +find_package(Boost REQUIRED + COMPONENTS system filesystem) +if(Boost_FOUND) + add_compile_definitions(ENABLE_BOOST) + include_directories("${Boost_INCLUDE_DIRS}/boost") + + MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}") + MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARY_DIRS}") + MESSAGE( STATUS "Boost_LIB_VERSION = ${Boost_LIB_VERSION}") + link_directories(${Boost_LIBRARY_DIRS}) + target_link_libraries (paozhu ${Boost_LIBRARIES}) +endif() + +endif() + + +find_package(OpenSSL REQUIRED) + +if(OPENSSL_FOUND) + + message(STATUS "OPENSSL_VERSION = ${OPENSSL_VERSION}") + message(STATUS "OPENSSL_SSL_LIBRARY = ${OPENSSL_SSL_LIBRARY}") + message(STATUS "OPENSSL_CRYPTO_LIBRARY = ${OPENSSL_CRYPTO_LIBRARY}") + message(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") + INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}") + target_link_libraries (paozhu ${OPENSSL_SSL_LIBRARY}) + target_link_libraries (paozhu ${OPENSSL_CRYPTO_LIBRARY}) +endif() + + +find_package(ZLIB REQUIRED) +if(ZLIB_FOUND) + message(STATUS "Zlib Found! ${ZLIB_LIBRARIES}") + include_directories(${ZLIB_INCLUDE_DIR}) + set(zlib_library ${ZLIB_LIBRARIES}) + target_link_libraries(paozhu z) +endif() + +find_path(MYSQL_ROOT_DIR mysql) +MESSAGE( STATUS "MYSQL_ROOT_DIR = ${MYSQL_ROOT_DIR} ") +find_package_handle_standard_args(mysql REQUIRED_VARS MYSQL_ROOT_DIR) + +FIND_PATH(MYSQL_INCLUDE_DIR mysql.h + /usr/local/include/mysql + /usr/include/mysql + /usr/local/mysql/include +) +SET(MYSQL_NAMES mysqlclient) +FIND_LIBRARY(MYSQL_LIBRARY + NAMES ${MYSQL_NAMES} + PATHS /usr/lib /usr/local/lib /usr/local/mysql/lib + PATH_SUFFIXES mysql +) + +IF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY) + SET(MYSQL_FOUND TRUE) + SET( MYSQL_LIBRARIES ${MYSQL_LIBRARY} ) +ELSE (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY) + SET(MYSQL_FOUND FALSE) + SET( MYSQL_LIBRARIES ) +ENDIF (MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY) + +IF (MYSQL_FOUND) + IF (NOT MYSQL_FIND_QUIETLY) + MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARY}") + ENDIF (NOT MYSQL_FIND_QUIETLY) +ELSE (MYSQL_FOUND) + IF (MYSQL_FIND_REQUIRED) + MESSAGE(STATUS "Looked for MySQL libraries named ${MYSQL_NAMES}.") + MESSAGE(FATAL_ERROR "Could NOT find MySQL library") + ENDIF (MYSQL_FIND_REQUIRED) +ENDIF (MYSQL_FOUND) + +target_include_directories(paozhu PUBLIC ${MYSQL_INCLUDE_DIR}) +target_link_libraries(paozhu ${MYSQL_LIBRARY}) + +target_include_directories(paozhu_cli PUBLIC ${MYSQL_INCLUDE_DIR}) +target_link_libraries(paozhu_cli ${MYSQL_LIBRARY}) + + + +if(ENABLE_GD STREQUAL "ON") +message("---ENABLE_GD-----") + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(GD_ROOT_DIR "/usr/local/opt/gd/lib") +else() + set(GD_ROOT_DIR "${sys_so_path}") +endif() + +set(find_gdname gd) + +find_library(GD_LIB_DIR + NAMES ${find_gdname} + PATHS "${GD_ROOT_DIR}" + NO_DEFAULT_PATH +) + +if(NOT GD_LIB_DIR) +message(FATAL_ERROR +"GD Graphics Library NOT FOUND! please install . " +) +endif() + +message(STATUS "GD Graphics Library at: ${GD_LIB_DIR}") + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") +set(QR_ROOT_DIR "/usr/local/opt/qrencode/lib") +else() +set(QR_ROOT_DIR "${sys_so_path}") +endif() + +set(find_qrname qrencode) + +find_library(QR_LIB_DIR + NAMES ${find_qrname} + PATHS "${QR_ROOT_DIR}" + NO_DEFAULT_PATH +) + +if(NOT QR_LIB_DIR) +message(FATAL_ERROR +"qrencode Library NOT FOUND! please install . " +) +endif() + +message(STATUS "qrencode at: ${QR_LIB_DIR}") + +INCLUDE_DIRECTORIES("${GD_ROOT_DIR}/include") +INCLUDE_DIRECTORIES("${QR_ROOT_DIR}/include") +link_directories("${QR_ROOT_DIR}/lib") +link_directories("${GD_ROOT_DIR}/lib") +target_link_libraries(paozhu ${GD_LIB_DIR}) +target_link_libraries(paozhu ${QR_LIB_DIR}) + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") +set(PNG_ROOT_DIR "/usr/local/opt/libpng/lib") +else() +set(PNG_ROOT_DIR "${sys_so_path}") +endif() + +find_library(PNG_LIB_DIR + NAMES png + PATHS "${PNG_ROOT_DIR}" + NO_DEFAULT_PATH +) +target_link_libraries(paozhu ${PNG_LIB_DIR}) + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(FREETYPE_ROOT_DIR "/usr/local/opt/freetype/lib") +else() + set(FREETYPE_ROOT_DIR "${sys_so_path}") +endif() + +find_library(FREETYPE_LIB_DIR + NAMES freetype + PATHS "${FREETYPE_ROOT_DIR}" + NO_DEFAULT_PATH +) +target_link_libraries(paozhu ${FREETYPE_LIB_DIR}) +#end ENABLE_GD +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(BROTLI_ROOT_DIR "/usr/local/opt/brotli/lib") +else() + set(BROTLI_ROOT_DIR "${sys_so_path}") +endif() + + + +#find_package(Brotli COMPONENTS encoder decoder common REQUIRED) + +message(STATUS "Brotli at: ${BROTLI_ROOT_DIR}") + +set(find_brname brotlienc) +set(find_brdename brotlidec) +find_library(BR_LIB_DIR + NAMES ${find_brname} + PATHS "${BROTLI_ROOT_DIR}" + NO_DEFAULT_PATH +) +find_library(BRDEC_LIB_DIR + NAMES ${find_brdename} + PATHS "${BROTLI_ROOT_DIR}" + NO_DEFAULT_PATH +) +INCLUDE_DIRECTORIES("${BROTLI_ROOT_DIR}/include") +link_directories("${BROTLI_ROOT_DIR}/lib") + +if(NOT BR_LIB_DIR) +message(FATAL_ERROR +"Brotli Library NOT FOUND! please install . " +) +endif() + +message(STATUS "Brotli at: ${BR_LIB_DIR}") +target_link_libraries(paozhu ${BR_LIB_DIR}) + + +if(NOT BRDEC_LIB_DIR) +message(FATAL_ERROR +"Brotli Library NOT FOUND! please install . " +) +endif() + +message(STATUS "Brotli at: ${BRDEC_LIB_DIR}") +target_link_libraries(paozhu ${BRDEC_LIB_DIR}) + + +message("Compile framework mode") + +target_link_libraries(paozhu m dl) + +endif () + +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + target_link_libraries(paozhu ws2_32) + target_link_libraries(paozhu_cli ws2_32) +endif () \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/common/autocontrolmethod.hpp b/frameworks/C++/paozhu/paozhu_benchmark/common/autocontrolmethod.hpp new file mode 100755 index 00000000000..faddf242daa --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/common/autocontrolmethod.hpp @@ -0,0 +1,51 @@ + +#ifndef __HTTP_AUTO_REG_CONTROL_HTTPMETHOD_HPP +#define __HTTP_AUTO_REG_CONTROL_HTTPMETHOD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "httppeer.h" + +#include "techempower.h" + + +namespace http +{ + void _initauto_control_httpmethodregto(std::map &methodcallback) + { + struct regmethold_t temp; + + temp.pre = nullptr; + temp.regfun = techempowerplaintext; + methodcallback.emplace("plaintext",temp); + temp.pre = nullptr; + temp.regfun = techempowerjson; + methodcallback.emplace("json",temp); + temp.pre = nullptr; + temp.regfun = techempowerdb; + methodcallback.emplace("db",temp); + temp.pre = nullptr; + temp.regfun = techempowerqueries; + methodcallback.emplace("queries",temp); + temp.pre = nullptr; + temp.regfun = techempowerfortunes; + methodcallback.emplace("fortunes",temp); + temp.pre = nullptr; + temp.regfun = techempowerupdates; + methodcallback.emplace("updates",temp); + temp.pre = nullptr; + temp.regfun = techempowercached_queries; + methodcallback.emplace("cached-queries",temp); + temp.pre = nullptr; + temp.regfun = techempowercached_db; + methodcallback.emplace("cached-db",temp); + + + } +} + +#endif + + \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/common/json_reflect_headers.h b/frameworks/C++/paozhu/paozhu_benchmark/common/json_reflect_headers.h new file mode 100644 index 00000000000..176500bf383 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/common/json_reflect_headers.h @@ -0,0 +1,32 @@ +#pragma once +#include +#include +#include +#include + +#include "types/techempower_json.h" +#include "unicode.h" + +template +std::string json_encode([[maybe_unused]] const JSON_REF_OBJ_TEMP &json_reflectobj) { return ""; } + +template +std::string json_encode([[maybe_unused]] const std::vector &json_reflectobj) { return ""; } + +template +unsigned int json_decode([[maybe_unused]] JSON_REF_OBJ_TEMP &json_reflectobj, [[maybe_unused]] const std::string &_json_data, [[maybe_unused]] unsigned int _offset) { return 0; } + +template +unsigned int json_decode([[maybe_unused]] std::vector &json_reflectobj, [[maybe_unused]] const std::string &_json_data, [[maybe_unused]] unsigned int _offset) { return 0; } + +namespace http +{ + +std::string json_encode(const techempower_outjson_t &json_reflectobj); + +std::string json_encode(const std::vector &json_reflectobj); + +unsigned int json_decode(techempower_outjson_t &json_reflectobj, const std::string &_json_data, unsigned int _offset = 0); + +unsigned int json_decode(std::vector &json_reflectobj, const std::string &_json_data, unsigned int _offset = 0); +}// namespace http diff --git a/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod.hpp b/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod.hpp new file mode 100755 index 00000000000..3333ed08bf0 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod.hpp @@ -0,0 +1,16 @@ +#ifndef __HTTP_REGHTTPMETHOD_HPP +#define __HTTP_REGHTTPMETHOD_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma once +#endif// defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "httppeer.h" +namespace http +{ +void _inithttpmethodregto(std::map &methodcallback) +{ +} + +}// namespace http +#endif \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod_pre.hpp b/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod_pre.hpp new file mode 100755 index 00000000000..bf2d5407381 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/common/reghttpmethod_pre.hpp @@ -0,0 +1,20 @@ +#ifndef __HTTP_REGHTTPMETHOD_PRE_HPP +#define __HTTP_REGHTTPMETHOD_PRE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma once +#endif// defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include "httppeer.h" +namespace http +{ +void _inithttpmethodregto_pre(std::map &methodcallback) +{ + struct regmethold_t temp; + //temp.pre = adminlogin; + //temp.regfun = adminmar; + //methodcallback.emplace("adminmar", temp); +} + +}// namespace http +#endif \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/conf/orm.conf b/frameworks/C++/paozhu/paozhu_benchmark/conf/orm.conf new file mode 100644 index 00000000000..1700d25a66e --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/conf/orm.conf @@ -0,0 +1,20 @@ +[default] +type=main +host=tfb-database +port=3306 +dbname=hello_world +user=benchmarkdbuser +password=benchmarkdbpass +pretable= +maxpool=5 +dbtype=mysql + +type=second +host=tfb-database +port=3306 +dbname=hello_world +user=benchmarkdbuser +password=benchmarkdbpass +pretable= +maxpool=20 +dbtype=mysql diff --git a/frameworks/C++/paozhu/paozhu_benchmark/conf/server.conf b/frameworks/C++/paozhu/paozhu_benchmark/conf/server.conf new file mode 100755 index 00000000000..e76a18093e9 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/conf/server.conf @@ -0,0 +1,42 @@ +[default] +threadmax=1024 +threadmin=5 +httpport=8888 +httpsport=4430 +cothreadnum=8 ;Coroutines run on thread num + +http2_enable=0 +debug_enable=1 +deamon_enable=0 +mainhost=localhost +certificate_chain_file=localhost.pem +private_key_file=localhost.key +tmp_dh_file=dh4096.pem +reboot_password=e10adc3949ba59abbe56e057f20f883e ;md5(md5("123456")+"rand_char"+md5("123456")) +session_type=1 ;session save type 0.file 1.memory 2.redis 3.memcache 4.reserve +static_file_compress_cache=1 ;1 enable, Cache static file compress(gzip,br) content to cache directory +modelspath=/root/benchmark/models +serverpath=/root/benchmark +viewpath=/root/benchmark/view +viewsopath=/root/benchmark/module/view + +controlpath=/root/benchmark/controller +controlsopath=/root/benchmark/module/controller + +temppath=/root/benchmark/temp +logpath=/root/benchmark/log +wwwpath=/root/benchmark/www/default +pluginspath=/root/benchmark/plugins +libspath=/root/benchmark/libs +directorylist=0 +index=index.html +;usehtmlcache=1 +;usehtmlcachetime=3600 +rewrite_404=0 ;1 file 2 action url path +rewrite_404_action=index.html +method_pre= +method_after= +show_visitinfo=0 +upload_max_size=16777216 + + diff --git a/frameworks/C++/paozhu/paozhu_benchmark/controller/include/techempower.h b/frameworks/C++/paozhu/paozhu_benchmark/controller/include/techempower.h new file mode 100755 index 00000000000..f1697f616b9 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/controller/include/techempower.h @@ -0,0 +1,19 @@ + +#pragma once +#include +#include +#include "httppeer.h" + +namespace http +{ + + + std::string techempowerplaintext(std::shared_ptr peer); + std::string techempowerjson(std::shared_ptr peer); + std::string techempowerdb(std::shared_ptr peer); + std::string techempowerqueries(std::shared_ptr peer); + std::string techempowerfortunes(std::shared_ptr peer); + std::string techempowerupdates(std::shared_ptr peer); + std::string techempowercached_queries(std::shared_ptr peer); + std::string techempowercached_db(std::shared_ptr peer); +} diff --git a/frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp b/frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp new file mode 100755 index 00000000000..f8dfe230acd --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/controller/src/techempower.cpp @@ -0,0 +1,241 @@ +#include "orm.h" +#include +#include +#include +#include +#include +#include "httppeer.h" +#include "techempower.h" +#include "datetime.h" +#include "func.h" +#include "pzcache.h" +#include "json_reflect_headers.h" +#include "techempower_json.h" +namespace http +{ + //@urlpath(null,plaintext) + std::string techempowerplaintext(std::shared_ptr peer) + { + peer->type("text/plain; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + peer->output = "Hello, World!"; + return ""; + } + + //@urlpath(null,json) + std::string techempowerjson(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + struct techempower_outjson_t a; + a.message = "Hello, World!"; + peer->output = json_encode(a); + return ""; + } + + //@urlpath(null,db) + std::string techempowerdb(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + auto myworld = orm::World(); + unsigned int rd_num = rand_range(1, 10000); + myworld.get_one(rd_num); + + peer->output = myworld.data_tojson(); + return ""; + } + + //@urlpath(null,queries) + std::string techempowerqueries(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + + unsigned int get_num = peer->get["queries"].to_int(); + if (get_num == 0) + { + get_num = 1; + } + else if (get_num > 500) + { + get_num = 500; + } + auto myworld = orm::World(); + myworld.record.reserve(get_num); + for (unsigned int i = 0; i < get_num; i++) + { + myworld.wheresql.clear(); + unsigned int rd_num = rand_range(1, 10000); + myworld.where("id", rd_num).fetch_append(); + } + + peer->output = myworld.to_json(); + return ""; + } + + //@urlpath(null,fortunes) + std::string techempowerfortunes(std::shared_ptr peer) + { + peer->type("text/html; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + + auto myfortune = orm::Fortune(); + myfortune.fetch(); + myfortune.data.id = 0; + myfortune.data.message = "Additional fortune added at request time."; + myfortune.record.push_back(myfortune.data); + + std::sort(myfortune.record.begin(), myfortune.record.end(), [](const auto &lhs, const auto &rhs) + { return lhs.message < rhs.message; }); + peer->val["list"].set_array(); + OBJ_ARRAY item; + for (unsigned int i = 0; i < myfortune.record.size(); i++) + { + item["id"] = myfortune.record[i].id; + item["message"] = html_encode(myfortune.record[i].message); + peer->val["list"].push(item); + } + + peer->view("techempower/fortunes"); + return ""; + } + + //@urlpath(null,updates) + std::string techempowerupdates(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + unsigned int get_num = peer->get["queries"].to_int(); + + if (get_num == 0) + { + get_num = 1; + } + else if (get_num > 500) + { + get_num = 500; + } + auto myworld = orm::World(); + myworld.record.clear(); + myworld.record.reserve(get_num); + for (unsigned int i = 0; i < get_num; i++) + { + myworld.wheresql.clear(); + myworld.where("id", rand_range(1, 10000)).fetch_append(); + if (myworld.effect() > 0) + { + unsigned int j = myworld.record.size() - 1; + myworld.data.randomnumber = rand_range(1, 10000); + myworld.record[j].randomnumber = myworld.data.randomnumber; + myworld.update("randomnumber"); + } + } + peer->output = myworld.to_json(); + return ""; + } + + //@urlpath(null,cached-queries) + std::string techempowercached_queries(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + + unsigned int get_num = peer->get["count"].to_int(); + if (get_num == 0) + { + get_num = 1; + } + else if (get_num > 500) + { + get_num = 500; + } + auto myworld = orm::World(); + std::string mycacheid = "alldatacache"; + + pzcache> &temp_cache = pzcache>::conn(); + + std::vector allcachedata_array; + allcachedata_array.reserve(10000); + // create rand data to cache + if (temp_cache.check(mycacheid) > -1) + { + allcachedata_array = temp_cache.get(mycacheid); + } + else + { + allcachedata_array.resize(10000); + for (unsigned int i = 0; i < 10000; i++) + { + allcachedata_array[i].id = i + 1; + allcachedata_array[i].randomnumber = rand_range(1, 10000); + } + temp_cache.save(mycacheid, allcachedata_array, 120); + } + // get rand data from cache + mycacheid = "my" + std::to_string(get_num); + myworld.record.reserve(get_num); + if (temp_cache.check(mycacheid) > -1) + { + myworld.record = temp_cache.get(mycacheid); + } + else + { + if (allcachedata_array.size() == 10000) + { + for (unsigned int i = 0; i < get_num; i++) + { + unsigned int temp_rid = rand_range(0, 9999); + myworld.record.push_back(allcachedata_array[temp_rid]); + } + } + temp_cache.save(mycacheid, myworld.record, 120); + } + + peer->output = myworld.to_json(); + return ""; + } + + //@urlpath(null,cached-db) + std::string techempowercached_db(std::shared_ptr peer) + { + peer->type("application/json; charset=UTF-8"); + peer->set_header("Date", get_gmttime()); + // this test from database to cache + unsigned int get_num = peer->get["count"].to_int(); + if (get_num == 0) + { + get_num = 1; + } + else if (get_num > 500) + { + get_num = 500; + } + auto myworld = orm::World(); + std::string mycacheid = "my" + std::to_string(get_num); + + pzcache> &temp_cache = pzcache>::conn(); + + myworld.record.reserve(get_num); + if (temp_cache.check(mycacheid) > -1) + { + myworld.record = temp_cache.get(mycacheid); + } + else + { + std::vector cacheid; + for (unsigned int i = 0; i < get_num; i++) + { + cacheid.push_back(rand_range(1, 10000)); + } + + std::string sqlstr = array_to_sql(cacheid); + myworld.whereIn("id", sqlstr).fetch(); + temp_cache.save(mycacheid, myworld.record, 120); + } + + peer->output = myworld.to_json(); + return ""; + } + +} // namespace http \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json.h b/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json.h new file mode 100755 index 00000000000..364c06bb2cf --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json.h @@ -0,0 +1,15 @@ +#ifndef LIBS_TYPES_TECHEMPOWER_TYPE_H +#define LIBS_TYPES_TECHEMPOWER_TYPE_H +#include +#include + +namespace http +{ +//@reflect json to_json from_json +struct techempower_outjson_t +{ + std::string message; +}; + +}// namespace http +#endif diff --git a/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp b/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp new file mode 100755 index 00000000000..8ff68cdbae2 --- /dev/null +++ b/frameworks/C++/paozhu/paozhu_benchmark/libs/types/techempower_json_jsonreflect.cpp @@ -0,0 +1,291 @@ +#include +#include +#include +#include +#include "types/techempower_json.h" +#include "json_reflect_headers.h" +#include "unicode.h" +#include "func.h" +//This file is automatically created, do not edit it + +namespace http +{ + + +std::string json_encode(const techempower_outjson_t &json_reflectobj) + { + + std::stringstream _stream; + _stream << "{"; + _stream << "\"message\":\"" << http::utf8_to_jsonstring(json_reflectobj.message)<< "\""; + + _stream << "}"; + + return _stream.str(); + + } + + +std::string json_encode(const std::vector &json_reflectobj) + { + std::stringstream _stream; + _stream << "["; + + for(unsigned int i=0;i0) + { + _stream <<","; + } + _stream < + //递归代码 + + _offset++; + for ( ; _offset < _json_data.size(); _offset++) + { + if (_json_data[_offset] == '}') + { + //offset++; + break; + } + if (_json_data[_offset] == '"') + { + _offset++; + for ( ; _offset < _json_data.size(); _offset++) + { + if (_json_data[_offset] == '"'&&_json_data[_offset-1]!=0x5C) + { + break; + } + } + } + } + + + if(_offset < _json_data.size() && (_json_data[_offset]==']'||_json_data[_offset]=='}')) + { + _offset-=1; + } + //直接下一个,不用处理键值 + continue; + } + else if(_json_data[_offset]=='[') + { //表示有数组 + ////////////////////////////////////////////////////////////////////// + //begin level1 [] + //vector vector> vector> + //如果是非内置类型 直接使用json_decode<> + + //递归代码 + + + _offset++; + for ( ; _offset < _json_data.size(); _offset++) + { + if (_json_data[_offset] == ']') + { + //offset++; + break; + } + if (_json_data[_offset] == '"') + { + _offset++; + for ( ; _offset < _json_data.size(); _offset++) + { + if (_json_data[_offset] == '"'&&_json_data[_offset-1]!=0x5C) + { + break; + } + } + } + } + + //直接下一个,不用处理键值 + if(_offset < _json_data.size() && (_json_data[_offset]==']'||_json_data[_offset]=='}')) + { + _offset-=1; + } + continue; + //end level1[] + //////////////////////////////////////////////////////////////////// + } + else if(_json_data[_offset]==0x22) + { + //如果键值也是字符串 + temp_offset=_offset; + _json_value_name=http::jsonstring_to_utf8(&_json_data[_offset],_json_data.size()-_offset,temp_offset); + _offset=temp_offset; + if(_json_data[_offset]==0x22) + { + if((_offset+1)<_json_data.size()) + { + if(_json_data[_offset+1]!=']'&&_json_data[_offset+1]!='}') + { + _offset+=1; + } + } + } + } + else + { + //表示是数字 bool NULL + for(;_offset<_json_data.size();_offset++) + { + //结束条件 + if(_json_data[_offset]==','||_json_data[_offset]==']'||_json_data[_offset]=='}'||_json_data[_offset]==0x20||_json_data[_offset]==0x0A||_json_data[_offset]==0x0D||_json_data[_offset]=='\t') + { + break; + } + _json_value_name.push_back(_json_data[_offset]); + } + //让前面循环退出或返回 + if(_offset < _json_data.size() && _json_data[_offset]=='}') + { + _offset-=1; + } + } + //////////////////////////////////////////////////////// + // level1 + //处理对象赋值 + if (http::str_casecmp(_json_key_name, "message")) + { + + json_reflectobj.message=_json_value_name; + } + + //////////////////////////////////////////////////////// + //继续循环下一个键值 + continue; + } + } + } + return _offset; + } + +unsigned int json_decode(std::vector &json_reflectobj,const std::string &_json_data,unsigned int _offset) + { + bool _isarray=false; + for(;_offset<_json_data.size();_offset++) + { + if(_json_data[_offset]=='{') + { + break; + } + if(_json_data[_offset]=='[') + { + _isarray=true; + break; + } + } + + if(_isarray) + { + if(_json_data[_offset]=='[') + { + _offset+=1; + } + for(;_offset<_json_data.size();_offset++) + { + _offset=http::json_string_trim(_json_data,_offset); + //直接返回,这样可以防插入空的对象 + if(_json_data[_offset]==0x5D) + { + return _offset; + }else if(_json_data[_offset]=='{') + { + techempower_outjson_t temp; + _offset=json_decode(temp,_json_data,_offset); + json_reflectobj.push_back(temp); + } + + } + + } + else + { + techempower_outjson_t temp; + _offset=json_decode(temp,_json_data,_offset); + json_reflectobj.push_back(temp); + + } + + return _offset; + } + +} diff --git a/frameworks/C++/userver/userver_configs/static_config.yaml b/frameworks/C++/userver/userver_configs/static_config.yaml index b34b772237b..2bdcf1fbce5 100644 --- a/frameworks/C++/userver/userver_configs/static_config.yaml +++ b/frameworks/C++/userver/userver_configs/static_config.yaml @@ -1,7 +1,7 @@ # yaml components_manager: event_thread_pool: - threads: 5 + threads: 9 dedicated_timer_threads: 1 coro_pool: initial_size: 10000 # Preallocate 10000 coroutines at startup. @@ -12,7 +12,7 @@ components_manager: main-task-processor: # Make a task processor for CPU-bound couroutine tasks. thread_name: main-worker # OS will show the threads of this task processor with 'main-worker' prefix. - worker_threads: 23 + worker_threads: 46 guess-cpu-limit: true fs-task-processor: # Make a separate task processor for filesystem bound tasks. diff --git a/frameworks/C/h2o/h2o.dockerfile b/frameworks/C/h2o/h2o.dockerfile index 86ae416dd77..cfabc77bb3b 100644 --- a/frameworks/C/h2o/h2o.dockerfile +++ b/frameworks/C/h2o/h2o.dockerfile @@ -1,4 +1,4 @@ -ARG UBUNTU_VERSION=22.04 +ARG UBUNTU_VERSION=24.04 ARG H2O_APP_PREFIX=/opt/h2o_app @@ -25,6 +25,7 @@ RUN apt-get -yqq update && \ libwslay-dev \ libyajl-dev \ libz-dev \ + llvm-dev \ make \ ninja-build \ pkg-config \ @@ -46,8 +47,7 @@ RUN curl -LSs "https://github.com/h2o/h2o/archive/${H2O_VERSION}.tar.gz" | \ -G Ninja \ -S . && \ cmake --build build -j && \ - cmake --install build && \ - cp -a deps/picotls/include/picotls* deps/quicly/include/quicly* /usr/local/include + cmake --install build ARG MUSTACHE_C_REVISION=7fe52392879d0188c172d94bb4fde7c513d6b929 diff --git a/frameworks/C/h2o/src/database.c b/frameworks/C/h2o/src/database.c index 59042b1dec3..9736cb9f2f0 100644 --- a/frameworks/C/h2o/src/database.c +++ b/frameworks/C/h2o/src/database.c @@ -75,7 +75,7 @@ static void on_database_write_ready(h2o_socket_t *sock, const char *err); static void on_process_queries(void *arg); static void poll_database_connection(h2o_socket_t *sock, const char *err); static void prepare_statements(db_conn_t *conn); -static void process_queries(db_conn_t *conn, bool removed); +static void process_queries(db_conn_pool_t *pool); static void remove_connection(db_conn_t *conn); static void start_database_connect(db_conn_pool_t *pool, db_conn_t *conn); @@ -237,7 +237,10 @@ static void on_database_connect_read_ready(h2o_socket_t *sock, const char *err) h2o_timer_unlink(&conn->timer); h2o_socket_read_stop(conn->sock); h2o_socket_read_start(conn->sock, on_database_read_ready); - process_queries(conn, true); + *conn->pool->conn.tail = &conn->l; + conn->pool->conn.tail = &conn->l.next; + conn->l.next = NULL; + process_queries(conn->pool); return; default: LIBRARY_ERROR("PQresultStatus", PQresultErrorMessage(result)); @@ -370,7 +373,13 @@ static void on_database_read_ready(h2o_socket_t *sock, const char *err) for (PGnotify *notify = PQnotifies(conn->conn); notify; notify = PQnotifies(conn->conn)) PQfreemem(notify); - process_queries(conn, removed); + if (removed && conn->query_num) { + *conn->pool->conn.tail = &conn->l; + conn->pool->conn.tail = &conn->l.next; + conn->l.next = NULL; + } + + process_queries(conn->pool); } static void on_database_timeout(h2o_timer_t *timer) @@ -405,20 +414,83 @@ static void on_database_write_ready(h2o_socket_t *sock, const char *err) static void on_process_queries(void *arg) { + list_t *iter = NULL; db_conn_pool_t * const pool = arg; + size_t query_num = 0; - while (pool->queries.head && pool->conn) { - db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, pool->conn); + while (pool->queries.head && pool->conn.head) { + db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, pool->conn.head); + db_query_param_t * const param = H2O_STRUCT_FROM_MEMBER(db_query_param_t, + l, + conn->pool->queries.head); - pool->conn = conn->l.next; assert(conn->query_num); - process_queries(conn, true); + assert(pool->query_num < pool->config->max_query_num); + pool->conn.head = conn->l.next; + pool->queries.head = param->l.next; + + if (!pool->conn.head) { + assert(pool->conn.tail == &conn->l.next); + pool->conn.tail = &pool->conn.head; + } + + if (++pool->query_num == pool->config->max_query_num) { + assert(!pool->queries.head); + assert(pool->queries.tail == ¶m->l.next); + pool->queries.tail = &pool->queries.head; + } + + if (do_execute_query(conn, param)) { + param->on_error(param, DB_ERROR); + on_database_error(conn, DB_ERROR); + } + else { + query_num++; + + if (conn->query_num) { + *pool->conn.tail = &conn->l; + pool->conn.tail = &conn->l.next; + conn->l.next = NULL; + } + else { + conn->l.next = iter; + iter = &conn->l; + } + } } - if (pool->queries.head && pool->conn_num) - start_database_connect(pool, NULL); + if (iter) + do { + db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, iter); + + iter = conn->l.next; + + if (flush_connection(on_database_write_ready, conn)) + on_database_error(conn, DB_ERROR); + } while (iter); + pool->conn.tail = &pool->conn.head; pool->process_queries = false; + query_num += pool->config->max_query_num - pool->query_num; + + for (iter = pool->conn.head; iter;) { + db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, iter); + + iter = conn->l.next; + + if (flush_connection(on_database_write_ready, conn)) { + *pool->conn.tail = iter; + on_database_error(conn, DB_ERROR); + } + else + pool->conn.tail = &conn->l.next; + } + + const size_t conn_num = pool->config->max_db_conn_num - pool->conn_num; + + if (query_num > conn_num) + for (query_num -= conn_num; pool->conn_num && query_num; query_num--) + start_database_connect(pool, NULL); } static void poll_database_connection(h2o_socket_t *sock, const char *err) @@ -536,54 +608,44 @@ static void prepare_statements(db_conn_t *conn) } else { h2o_socket_read_start(conn->sock, on_database_read_ready); - process_queries(conn, true); + *conn->pool->conn.tail = &conn->l; + conn->pool->conn.tail = &conn->l.next; + conn->l.next = NULL; + process_queries(conn->pool); } } -static void process_queries(db_conn_t *conn, bool removed) +static void process_queries(db_conn_pool_t *pool) { - const bool flush = conn->query_num && conn->pool->queries.head; - - while (conn->query_num && conn->pool->queries.head) { - db_query_param_t * const param = H2O_STRUCT_FROM_MEMBER(db_query_param_t, - l, - conn->pool->queries.head); - - if (++conn->pool->query_num == conn->pool->config->max_query_num) { - assert(conn->pool->queries.tail == ¶m->l.next); - conn->pool->queries.tail = &conn->pool->queries.head; - } - - conn->pool->queries.head = param->l.next; - - if (do_execute_query(conn, param)) { - param->on_error(param, DB_ERROR); - on_database_error(conn, DB_ERROR); - return; - } - } - - if (flush && flush_connection(on_database_write_ready, conn)) - on_database_error(conn, DB_ERROR); - else if (conn->query_num && removed) { - conn->l.next = conn->pool->conn; - conn->pool->conn = &conn->l; + if (!pool->process_queries && pool->queries.head) { + task_message_t * const msg = h2o_mem_alloc(sizeof(*msg)); + + assert(pool->query_num < pool->config->max_query_num); + memset(msg, 0, sizeof(*msg)); + msg->arg = pool; + msg->super.type = TASK; + msg->task = on_process_queries; + pool->process_queries = true; + send_local_message(&msg->super, pool->local_messages); } - else if (!conn->query_num && !removed) - // This call should not be problematic, assuming a relatively low number of connections. - remove_connection(conn); } static void remove_connection(db_conn_t *conn) { - list_t *iter = conn->pool->conn; - list_t **prev = &conn->pool->conn; + list_t *iter = conn->pool->conn.head; + list_t **prev = &conn->pool->conn.head; for (; iter && iter != &conn->l; iter = iter->next) prev = &iter->next; - if (iter) + if (iter) { *prev = iter->next; + + if (!conn->pool->conn.head) { + assert(conn->pool->conn.tail == &iter->next); + conn->pool->conn.tail = &conn->pool->conn.head; + } + } } static void start_database_connect(db_conn_pool_t *pool, db_conn_t *conn) @@ -661,37 +723,15 @@ int execute_database_query(db_conn_pool_t *pool, db_query_param_t *param) int ret = 1; if (pool->query_num) { - if (pool->conn) { - // Delay sending the database queries to the server, so that if there is a rapid - // succession of calls to this function, all resultant queries would be inserted - // into a command pipeline with a smaller number of system calls. - if (!pool->process_queries) { - task_message_t * const msg = h2o_mem_alloc(sizeof(*msg)); - - memset(msg, 0, sizeof(*msg)); - msg->arg = pool; - msg->super.type = TASK; - msg->task = on_process_queries; - send_local_message(&msg->super, pool->local_messages); - pool->process_queries = true; - } - - ret = 0; - } - else { - if (pool->conn_num) - start_database_connect(pool, NULL); - - if (pool->conn_num < pool->config->max_db_conn_num && pool->query_num) - ret = 0; - } - - if (!ret) { - param->l.next = NULL; - *pool->queries.tail = ¶m->l; - pool->queries.tail = ¶m->l.next; - pool->query_num--; - } + // Delay sending the database queries to the server, so that if there is a rapid + // succession of calls to this function, all resultant queries would be inserted + // into a command pipeline with a smaller number of system calls. + param->l.next = NULL; + *pool->queries.tail = ¶m->l; + pool->queries.tail = ¶m->l.next; + pool->query_num--; + process_queries(pool); + ret = 0; } return ret; @@ -704,9 +744,9 @@ void free_database_connection_pool(db_conn_pool_t *pool) size_t num = 0; - if (pool->conn) + if (pool->conn.head) do { - db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, pool->conn); + db_conn_t * const conn = H2O_STRUCT_FROM_MEMBER(db_conn_t, l, pool->conn.head); assert(!conn->queries.head); assert(conn->query_num == pool->config->max_pipeline_query_num); @@ -715,10 +755,10 @@ void free_database_connection_pool(db_conn_pool_t *pool) h2o_socket_read_stop(conn->sock); h2o_socket_close(conn->sock); PQfinish(conn->conn); - pool->conn = pool->conn->next; - free(conn); + pool->conn.head = conn->l.next; num++; - } while (pool->conn); + free(conn); + } while (pool->conn.head); assert(num + pool->conn_num == pool->config->max_db_conn_num); } @@ -732,6 +772,7 @@ void initialize_database_connection_pool(const char *conninfo, { memset(pool, 0, sizeof(*pool)); pool->config = config; + pool->conn.tail = &pool->conn.head; pool->conninfo = conninfo ? conninfo : ""; pool->local_messages = local_messages; pool->loop = loop; diff --git a/frameworks/C/h2o/src/database.h b/frameworks/C/h2o/src/database.h index b35d3805c3f..c0c0ca05eda 100644 --- a/frameworks/C/h2o/src/database.h +++ b/frameworks/C/h2o/src/database.h @@ -60,7 +60,7 @@ typedef struct db_query_param_t { typedef struct { const struct config_t *config; - list_t *conn; + queue_t conn; const char *conninfo; h2o_linklist_t *local_messages; h2o_loop_t *loop; diff --git a/frameworks/C/h2o/src/handlers/world.c b/frameworks/C/h2o/src/handlers/world.c index 5528ddb75c4..0ee0b29d497 100644 --- a/frameworks/C/h2o/src/handlers/world.c +++ b/frameworks/C/h2o/src/handlers/world.c @@ -416,7 +416,7 @@ static void fetch_from_cache(uint64_t now, h2o_cache_ref_t * const r = h2o_cache_fetch(data->world_cache, now, key, 0); if (r) { - const uint32_t * const table = (const uint32_t *) r->value.base; + const uint16_t * const table = (const uint16_t *) r->value.base; for (size_t i = 0; i < query_ctx->num_query; i++) { const uint32_t id = query_ctx->res[i].id; @@ -440,7 +440,7 @@ static void fetch_from_cache(uint64_t now, memset(ctx, 0, sizeof(*ctx)); ctx->data = data; ctx->loop = query_ctx->ctx->event_loop.h2o_ctx.loop; - ctx->table.len = (MAX_ID + 1) * sizeof(uint32_t); + ctx->table.len = (MAX_ID + 1) * sizeof(uint16_t); ctx->table.base = h2o_mem_alloc(ctx->table.len); memset(ctx->table.base, 0, ctx->table.len); ctx->param.command = POPULATE_CACHE_QUERY; @@ -605,10 +605,11 @@ static result_return_t on_populate_cache_result(db_query_param_t *param, PGresul param, param); query_result_t r = {.id = 0}; - uint32_t * const table = (uint32_t *) query_ctx->table.base; + uint16_t * const table = (uint16_t *) query_ctx->table.base; for (size_t i = 0; i < num_rows; i++) { process_result(result, i, &r); + assert(r.random_number <= UINT16_MAX); table[r.id] = r.random_number; } diff --git a/frameworks/CSharp/appmpower/src/Data/DbConnection.cs b/frameworks/CSharp/appmpower/src/Data/DbConnection.cs index 31dc5a783dc..916e251a9c8 100644 --- a/frameworks/CSharp/appmpower/src/Data/DbConnection.cs +++ b/frameworks/CSharp/appmpower/src/Data/DbConnection.cs @@ -142,10 +142,7 @@ public void Dispose() public async Task OpenAsync() { -#if ADO && SQLSERVER - _internalConnection = new(); - _internalConnection.DbConnection = new System.Data.SqlClient.SqlConnection(_connectionString); -#elif ADO && POSTGRESQL +#if ADO && POSTGRESQL _internalConnection = new(); _internalConnection.DbConnection = new Npgsql.NpgsqlConnection(_connectionString); #else diff --git a/frameworks/CSharp/appmpower/src/Data/DbConnections.cs b/frameworks/CSharp/appmpower/src/Data/DbConnections.cs index d7658b41ebe..0b513a3d47f 100644 --- a/frameworks/CSharp/appmpower/src/Data/DbConnections.cs +++ b/frameworks/CSharp/appmpower/src/Data/DbConnections.cs @@ -7,7 +7,7 @@ public static class DbConnections { private static bool _connectionsCreated = false; private static short _createdConnections = 0; - private static short _maxConnections = 250; + private static short _maxConnections = 500; private static ConcurrentStack _stack = new(); private static ConcurrentQueue> _waitingQueue = new(); diff --git a/frameworks/CSharp/appmpower/src/HttpApplication.cs b/frameworks/CSharp/appmpower/src/HttpApplication.cs index b7d8048692f..1eac250ede5 100644 --- a/frameworks/CSharp/appmpower/src/HttpApplication.cs +++ b/frameworks/CSharp/appmpower/src/HttpApplication.cs @@ -35,7 +35,8 @@ public async Task ProcessRequestAsync(IFeatureCollection featureCollection) if (pathStringLength == 10 && pathStringStart == "p") { - await PlainText.RenderAsync(httpResponse.Headers, httpResponseBody.Writer, _plainText); + //await PlainText.RenderAsync(httpResponse.Headers, httpResponseBody.Writer, _plainText); + PlainText.Render(httpResponse.Headers, httpResponseBody, _plainText); return; } else if (pathStringLength == 5 && pathStringStart == "j") diff --git a/frameworks/CSharp/appmpower/src/Kestrel/PlainText.cs b/frameworks/CSharp/appmpower/src/Kestrel/PlainText.cs index cff1d028b23..e7ead33aa2e 100644 --- a/frameworks/CSharp/appmpower/src/Kestrel/PlainText.cs +++ b/frameworks/CSharp/appmpower/src/Kestrel/PlainText.cs @@ -4,6 +4,7 @@ using System.IO.Pipelines; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; +using Microsoft.AspNetCore.Http.Features; namespace appMpower.Kestrel { @@ -23,5 +24,15 @@ public static async Task RenderAsync(IHeaderDictionary headerDictionary, PipeWri await pipeWriter.WriteAsync(utf8String); pipeWriter.Complete(); } + + public static void Render(IHeaderDictionary headerDictionary, IHttpResponseBodyFeature httpResponseBodyFeature, byte[] utf8String) + { + headerDictionary.Add(_headerServer); + headerDictionary.Add(_headerContentType); + int length = utf8String.Length; + headerDictionary.Add(new KeyValuePair("Content-Length", length.ToString())); + + httpResponseBodyFeature.Stream.Write(utf8String, 0, length); + } } } \ No newline at end of file diff --git a/frameworks/CSharp/appmpower/src/Program.cs b/frameworks/CSharp/appmpower/src/Program.cs index 5647ac9b787..6e748b08497 100644 --- a/frameworks/CSharp/appmpower/src/Program.cs +++ b/frameworks/CSharp/appmpower/src/Program.cs @@ -19,6 +19,7 @@ static async Task Main(string[] args) var kestrelServerOptions = new KestrelServerOptions(); kestrelServerOptions.Listen(IPAddress.Any, 8080); + kestrelServerOptions.AllowSynchronousIO = true; kestrelServerOptions.AddServerHeader = false; using var kestrelServer = new KestrelServer(Options.Create(kestrelServerOptions), socketTransportFactory, NullLoggerFactory.Instance); diff --git a/frameworks/CSharp/appmpower/src/appMpower.csproj b/frameworks/CSharp/appmpower/src/appMpower.csproj index 14258de5d67..579c54883b5 100644 --- a/frameworks/CSharp/appmpower/src/appMpower.csproj +++ b/frameworks/CSharp/appmpower/src/appMpower.csproj @@ -43,7 +43,7 @@ - + diff --git a/frameworks/CSharp/aspnetcore-mono/Benchmarks/Benchmarks.csproj b/frameworks/CSharp/aspnetcore-mono/Benchmarks/Benchmarks.csproj index 3ccea1c3707..1a1e7ee6d9a 100644 --- a/frameworks/CSharp/aspnetcore-mono/Benchmarks/Benchmarks.csproj +++ b/frameworks/CSharp/aspnetcore-mono/Benchmarks/Benchmarks.csproj @@ -25,6 +25,7 @@ + diff --git a/frameworks/CSharp/aspnetcore-mono/PlatformBenchmarks/PlatformBenchmarks.csproj b/frameworks/CSharp/aspnetcore-mono/PlatformBenchmarks/PlatformBenchmarks.csproj index db72cd753ec..325b9acb8cc 100644 --- a/frameworks/CSharp/aspnetcore-mono/PlatformBenchmarks/PlatformBenchmarks.csproj +++ b/frameworks/CSharp/aspnetcore-mono/PlatformBenchmarks/PlatformBenchmarks.csproj @@ -23,7 +23,7 @@ - + diff --git a/frameworks/CSharp/aspnetcore/src/Minimal/Minimal.csproj b/frameworks/CSharp/aspnetcore/src/Minimal/Minimal.csproj index 5ee139c7d58..783ec88ff32 100644 --- a/frameworks/CSharp/aspnetcore/src/Minimal/Minimal.csproj +++ b/frameworks/CSharp/aspnetcore/src/Minimal/Minimal.csproj @@ -9,7 +9,7 @@ - + diff --git a/frameworks/CSharp/aspnetcore/src/Mvc/Mvc.csproj b/frameworks/CSharp/aspnetcore/src/Mvc/Mvc.csproj index 8da7f631b80..5bffd479c0f 100644 --- a/frameworks/CSharp/aspnetcore/src/Mvc/Mvc.csproj +++ b/frameworks/CSharp/aspnetcore/src/Mvc/Mvc.csproj @@ -9,7 +9,7 @@ - + diff --git a/frameworks/CSharp/aspnetcore/src/Platform/Platform.csproj b/frameworks/CSharp/aspnetcore/src/Platform/Platform.csproj index fb4d0bf7014..548e446ee0a 100644 --- a/frameworks/CSharp/aspnetcore/src/Platform/Platform.csproj +++ b/frameworks/CSharp/aspnetcore/src/Platform/Platform.csproj @@ -19,7 +19,7 @@ - + diff --git a/frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj b/frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj index 4df8fb3e39a..b00a3994898 100644 --- a/frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj +++ b/frameworks/CSharp/genhttp/Benchmarks/Benchmarks.csproj @@ -28,12 +28,12 @@ - - - + + + - - + + diff --git a/frameworks/CSharp/sisk/sisk/sisk.csproj b/frameworks/CSharp/sisk/sisk/sisk.csproj index 624dd50d4a3..1b95479eb01 100644 --- a/frameworks/CSharp/sisk/sisk/sisk.csproj +++ b/frameworks/CSharp/sisk/sisk/sisk.csproj @@ -9,7 +9,7 @@ - + diff --git a/frameworks/Crystal/crystal/crystal-radix.dockerfile b/frameworks/Crystal/crystal/crystal-radix.dockerfile index aaef65c87d9..deda5e21148 100644 --- a/frameworks/Crystal/crystal/crystal-radix.dockerfile +++ b/frameworks/Crystal/crystal/crystal-radix.dockerfile @@ -1,4 +1,4 @@ -FROM crystallang/crystal:1.0.0 +FROM crystallang/crystal:1.12.1 WORKDIR /crystal COPY shard.yml shard.yml diff --git a/frameworks/Crystal/crystal/crystal.dockerfile b/frameworks/Crystal/crystal/crystal.dockerfile index ab51249b129..678dd214cd4 100644 --- a/frameworks/Crystal/crystal/crystal.dockerfile +++ b/frameworks/Crystal/crystal/crystal.dockerfile @@ -1,4 +1,4 @@ -FROM crystallang/crystal:1.0.0 +FROM crystallang/crystal:1.12.1 WORKDIR /crystal COPY shard.yml shard.yml diff --git a/frameworks/Crystal/crystal/shard.yml b/frameworks/Crystal/crystal/shard.yml index 6bea5905b84..dc20f8e0679 100644 --- a/frameworks/Crystal/crystal/shard.yml +++ b/frameworks/Crystal/crystal/shard.yml @@ -7,7 +7,7 @@ crystal: "~> 1.0" dependencies: pg: github: will/crystal-pg - version: ~> 0.23.2 + version: ~> 0.28.0 radix: github: luislavena/radix version: ~> 0.4.1 diff --git a/frameworks/Crystal/lucky/lucky.dockerfile b/frameworks/Crystal/lucky/lucky.dockerfile index 6e849625ca8..8309958ace4 100644 --- a/frameworks/Crystal/lucky/lucky.dockerfile +++ b/frameworks/Crystal/lucky/lucky.dockerfile @@ -1,4 +1,4 @@ -FROM crystallang/crystal:1.1.0 +FROM crystallang/crystal:1.12.1 WORKDIR /lucky COPY shard.lock shard.lock diff --git a/frameworks/Crystal/lucky/shard.lock b/frameworks/Crystal/lucky/shard.lock index ec0cee06660..86720033909 100644 --- a/frameworks/Crystal/lucky/shard.lock +++ b/frameworks/Crystal/lucky/shard.lock @@ -2,11 +2,15 @@ version: 2.0 shards: avram: git: https://github.com/luckyframework/avram.git - version: 0.21.0 + version: 1.2.0 backtracer: git: https://github.com/sija/backtracer.cr.git - version: 1.2.1 + version: 1.2.2 + + cadmium_transliterator: + git: https://github.com/cadmiumcr/transliterator.git + version: 0.1.0+git.commit.46c4c14594057dbcfaf27e7e7c8c164d3f0ce3f1 cry: git: https://github.com/luckyframework/cry.git @@ -14,53 +18,57 @@ shards: db: git: https://github.com/crystal-lang/crystal-db.git - version: 0.10.1 + version: 0.13.1 dexter: git: https://github.com/luckyframework/dexter.git - version: 0.3.3 + version: 0.3.4 exception_page: git: https://github.com/crystal-loot/exception_page.git - version: 0.2.0 - - future: - git: https://github.com/crystal-community/future.cr.git - version: 1.0.0+git.commit.9fe168418c6884cb3552c13b004763eb4815ceb9 + version: 0.4.1 habitat: git: https://github.com/luckyframework/habitat.git - version: 0.4.7 + version: 0.4.8 lucky: git: https://github.com/luckyframework/lucky.git - version: 0.28.0 + version: 1.2.0 + + lucky_cache: + git: https://github.com/luckyframework/lucky_cache.git + version: 0.1.1 lucky_router: git: https://github.com/luckyframework/lucky_router.git - version: 0.5.0 + version: 0.5.2 lucky_task: git: https://github.com/luckyframework/lucky_task.git - version: 0.1.0 + version: 0.3.0 + + lucky_template: + git: https://github.com/luckyframework/lucky_template.git + version: 0.2.0 pg: git: https://github.com/will/crystal-pg.git - version: 0.24.0 + version: 0.28.0 pulsar: git: https://github.com/luckyframework/pulsar.git - version: 0.2.2 + version: 0.2.3 shell-table: git: https://github.com/luckyframework/shell-table.cr.git - version: 0.9.3+git.commit.fefbc8b19d18630660b2653de755217597808b1b + version: 0.9.3 - teeplate: - git: https://github.com/luckyframework/teeplate.git - version: 0.8.3 + splay_tree_map: + git: https://github.com/wyhaines/splay_tree_map.cr.git + version: 0.2.2 wordsmith: git: https://github.com/luckyframework/wordsmith.git - version: 0.3.0 + version: 0.4.0 diff --git a/frameworks/Crystal/lucky/shard.yml b/frameworks/Crystal/lucky/shard.yml index dd33a9517fe..c5afbdd49fd 100644 --- a/frameworks/Crystal/lucky/shard.yml +++ b/frameworks/Crystal/lucky/shard.yml @@ -8,9 +8,11 @@ targets: bench: main: src/bench.cr -crystal: ">= 1.0.0" +crystal: ">= 1.12.1" dependencies: + avram: + github: luckyframework/avram lucky: github: luckyframework/lucky - version: ~> 0.28.0 + version: ~> 1.2.0 diff --git a/frameworks/Crystal/lucky/src/actions/mixins/add_required_headers.cr b/frameworks/Crystal/lucky/src/actions/mixins/add_required_headers.cr index 32d0d957f2c..8c076dcb84e 100644 --- a/frameworks/Crystal/lucky/src/actions/mixins/add_required_headers.cr +++ b/frameworks/Crystal/lucky/src/actions/mixins/add_required_headers.cr @@ -5,7 +5,6 @@ module AddRequiredHeaders def add_required_headers response.headers["Server"] = "Lucky" - response.headers["Date"] = HTTP.format_time(Time.local) continue end end diff --git a/frameworks/Crystal/toro/shard.yml b/frameworks/Crystal/toro/shard.yml index 1c84495533e..9a8953d4d04 100644 --- a/frameworks/Crystal/toro/shard.yml +++ b/frameworks/Crystal/toro/shard.yml @@ -4,13 +4,13 @@ version: 0.1.0 dependencies: toro: github: soveran/toro - version: 0.4.1 + version: 0.5.1 pg: github: will/crystal-pg - version: 0.20.0 + version: 0.28.0 targets: toro: main: toro.cr -crystal: 0.34.0 \ No newline at end of file +crystal: 1.12.1 diff --git a/frameworks/Crystal/toro/toro.cr b/frameworks/Crystal/toro/toro.cr index db1c3cef3ba..7ff01b5a7c7 100644 --- a/frameworks/Crystal/toro/toro.cr +++ b/frameworks/Crystal/toro/toro.cr @@ -129,6 +129,6 @@ class App < Toro::Router end # Start the app on port 8080. -App.run(8080) do |server| +App.run do |server| server.listen("0.0.0.0", 8080, reuse_port: true) end diff --git a/frameworks/Crystal/toro/toro.dockerfile b/frameworks/Crystal/toro/toro.dockerfile index b4f0677f11c..ce47dad0746 100644 --- a/frameworks/Crystal/toro/toro.dockerfile +++ b/frameworks/Crystal/toro/toro.dockerfile @@ -1,4 +1,4 @@ -FROM crystallang/crystal:0.34.0 +FROM crystallang/crystal:1.12.1 WORKDIR /toro COPY views views diff --git a/frameworks/FSharp/falco/src/App/App.fsproj b/frameworks/FSharp/falco/src/App/App.fsproj index 00e8bf8f22c..437c5ae6329 100644 --- a/frameworks/FSharp/falco/src/App/App.fsproj +++ b/frameworks/FSharp/falco/src/App/App.fsproj @@ -21,7 +21,7 @@ - + diff --git a/frameworks/FSharp/frank/src/App/App.fsproj b/frameworks/FSharp/frank/src/App/App.fsproj index ac861c86488..6d5658a653d 100644 --- a/frameworks/FSharp/frank/src/App/App.fsproj +++ b/frameworks/FSharp/frank/src/App/App.fsproj @@ -16,7 +16,7 @@ - + diff --git a/frameworks/FSharp/giraffe/README.md b/frameworks/FSharp/giraffe/README.md index fa4751bbda2..bdc107b6bcc 100644 --- a/frameworks/FSharp/giraffe/README.md +++ b/frameworks/FSharp/giraffe/README.md @@ -1,9 +1,8 @@ # Giraffe Benchmarks on Linux -This application tests Giraffe in 3 modes: +This application tests Giraffe in 2 modes: - Default: Using Giraffe's Endpoint Routing APIs with the `System.Text.Json` serializer -- Utf8Json: Testing the JSON endpoint with the `Utf8Json` serializer - Newtonsoft: Testing the JSON endpoint with the `NewtonsoftJson` serializer ## Infrastructure Software Versions diff --git a/frameworks/FSharp/giraffe/giraffe-newtonsoft.dockerfile b/frameworks/FSharp/giraffe/giraffe-newtonsoft.dockerfile index b22de354452..da172b8140e 100644 --- a/frameworks/FSharp/giraffe/giraffe-newtonsoft.dockerfile +++ b/frameworks/FSharp/giraffe/giraffe-newtonsoft.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build WORKDIR /app COPY src/App . RUN dotnet publish -c Release -o out diff --git a/frameworks/FSharp/giraffe/giraffe.dockerfile b/frameworks/FSharp/giraffe/giraffe.dockerfile index b63044e65c2..c980686ee14 100644 --- a/frameworks/FSharp/giraffe/giraffe.dockerfile +++ b/frameworks/FSharp/giraffe/giraffe.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build WORKDIR /app COPY src/App . RUN dotnet publish -c Release -o out diff --git a/frameworks/FSharp/giraffe/src/App/App.fsproj b/frameworks/FSharp/giraffe/src/App/App.fsproj index bbdd52ee3af..9faae3fe0a1 100644 --- a/frameworks/FSharp/giraffe/src/App/App.fsproj +++ b/frameworks/FSharp/giraffe/src/App/App.fsproj @@ -1,19 +1,19 @@ - - - - net8.0 - false - - - - - - - - - - - - - - + + + + net8.0 + false + + + + + + + + + + + + + + diff --git a/frameworks/FSharp/oxpecker/.gitignore b/frameworks/FSharp/oxpecker/.gitignore new file mode 100644 index 00000000000..2ad42ca00cf --- /dev/null +++ b/frameworks/FSharp/oxpecker/.gitignore @@ -0,0 +1,360 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/frameworks/FSharp/oxpecker/README.md b/frameworks/FSharp/oxpecker/README.md new file mode 100644 index 00000000000..4f686292d12 --- /dev/null +++ b/frameworks/FSharp/oxpecker/README.md @@ -0,0 +1,27 @@ +# Oxpecker Tests on Linux +This includes tests for plaintext, json, and fortunes HTML serialization. + +## Infrastructure Software Versions + +**Language** + +* F# 8.0 + +**Platforms** + +* .NET Core (Windows and Linux) + +**Web Servers** + +* [Kestrel](https://github.com/dotnet/aspnetcore/tree/main/src/Servers/Kestrel) + +**Web Stack** + +* [Oxpecker](https://github.com/Lanayx/Oxpecker) +* [Dapper](https://github.com/DapperLib/Dapper) +* [SpanJson](https://github.com/Tornhoof/SpanJson) +* ASP.NET Core + +## Paths & Source for Tests + +All source code is inside `Program.fs`. diff --git a/frameworks/FSharp/oxpecker/benchmark_config.json b/frameworks/FSharp/oxpecker/benchmark_config.json new file mode 100644 index 00000000000..c0df28d86a3 --- /dev/null +++ b/frameworks/FSharp/oxpecker/benchmark_config.json @@ -0,0 +1,30 @@ +{ + "framework": "oxpecker", + "tests": [ + { + "default": { + "plaintext_url": "/plaintext", + "json_url": "/json", + "fortune_url": "/fortunes", + "db_url": "/db", + "query_url": "/queries/", + "update_url": "/updates/", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "Oxpecker", + "language": "F#", + "orm": "Micro", + "platform": ".NET", + "flavor": "CoreCLR", + "webserver": "Kestrel", + "os": "Linux", + "database_os": "Linux", + "display_name": "Oxpecker", + "notes": "", + "versus": "aspcore" + } + } + ] +} diff --git a/frameworks/FSharp/oxpecker/config.toml b/frameworks/FSharp/oxpecker/config.toml new file mode 100644 index 00000000000..dd5e34c8b96 --- /dev/null +++ b/frameworks/FSharp/oxpecker/config.toml @@ -0,0 +1,19 @@ +[framework] +name = "oxpecker" + +[main] +urls.plaintext = "/plaintext" +urls.json = "/json" +urls.fortune = "/fortunes" +urls.db = "/db" +urls.query = "/queries/" +urls.update = "/updates/" +approach = "Realistic" +classification = "fullstack" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "micro" +platform = ".NET" +webserver = "Kestrel" +versus = "aspcore" \ No newline at end of file diff --git a/frameworks/FSharp/oxpecker/oxpecker.dockerfile b/frameworks/FSharp/oxpecker/oxpecker.dockerfile new file mode 100644 index 00000000000..c65349e32cd --- /dev/null +++ b/frameworks/FSharp/oxpecker/oxpecker.dockerfile @@ -0,0 +1,14 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /app +COPY src/App . +RUN dotnet publish -c Release -o out + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime +ENV URLS http://+:8080 + +WORKDIR /app +COPY --from=build /app/out ./ + +EXPOSE 8080 + +ENTRYPOINT ["dotnet", "App.dll"] \ No newline at end of file diff --git a/frameworks/FSharp/oxpecker/src/App/App.fsproj b/frameworks/FSharp/oxpecker/src/App/App.fsproj new file mode 100644 index 00000000000..8dca02be01a --- /dev/null +++ b/frameworks/FSharp/oxpecker/src/App/App.fsproj @@ -0,0 +1,19 @@ + + + + net8.0 + false + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frameworks/FSharp/oxpecker/src/App/Program.fs b/frameworks/FSharp/oxpecker/src/App/Program.fs new file mode 100644 index 00000000000..e0c3f361286 --- /dev/null +++ b/frameworks/FSharp/oxpecker/src/App/Program.fs @@ -0,0 +1,228 @@ +namespace App + +open System +open System.Collections.Generic +open System.Threading.Tasks +open Oxpecker + +[] +module Common = + + [] + type Fortune = + { + id : int + message : string + } + + [] + 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 FortuneComparer = { + new IComparer with + member self.Compare(a,b) = String.CompareOrdinal(a.message, b.message) + } + +[] +module HtmlViews = + open Oxpecker.ViewEngine + + let private fortunesHead = + head() { + title() { raw "Fortunes" } + } + + let private layout (content: HtmlElement) = + html() { + fortunesHead + body() { content } + } + + let private fortunesTableHeader = + tr() { + th() { raw "id" } + th() { raw "message" } + } + + let fortunes (fortunes: Fortune[]) = + table() { + fortunesTableHeader + for f in fortunes do + tr() { + td() { raw <| string f.id } + td() { f.message } + } + } |> layout + +[] +module HttpHandlers = + open Dapper + open Npgsql + open System.Text + open Microsoft.AspNetCore.Http + + let private extra = + { + id = 0 + 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 private fortunes : EndpointHandler = + fun ctx -> + task { + use conn = new NpgsqlConnection(ConnectionString) + let! dbFortunes = conn.QueryAsync("SELECT id, message FROM fortune") + return! renderFortunes ctx dbFortunes + } + + [] + [] + type World = + { + id: int + randomnumber: int + } + + let private readSingleRow (conn: NpgsqlConnection) = + conn.QueryFirstOrDefaultAsync( + "SELECT id, randomnumber FROM world WHERE id = @Id", + {| Id = Random.Shared.Next(1, 10001) |} + ) + + let private parseQueries (ctx: HttpContext) = + match ctx.TryGetRouteValue("count") with + | Some q -> + match Int32.TryParse q with + | true, q when q > 1 -> if q < 500 then q else 500 + | _, _ -> 1 + | _ -> 1 + + let private singleQuery : EndpointHandler = + fun ctx -> + task { + use conn = new NpgsqlConnection(ConnectionString) + let! result = readSingleRow conn + return! ctx.WriteJsonChunked result + } + + let private multipleQueries : EndpointHandler = + fun ctx -> + let count = parseQueries ctx + let results = Array.zeroCreate count + task { + use conn = new NpgsqlConnection(ConnectionString) + do! conn.OpenAsync() + for i in 0..results.Length-1 do + let! result = readSingleRow conn + results[i] <- result + return! ctx.WriteJsonChunked results + } + + let private maxBatch = 500 + let mutable private queries = Array.zeroCreate (maxBatch + 1) + + let private batchUpdateString batchSize = + match queries[batchSize] with + | null -> + let lastIndex = batchSize - 1 + let sb = StringBuilder() + sb.Append("UPDATE world SET randomNumber = temp.randomNumber FROM (VALUES ") |> ignore + for i in 0..lastIndex-1 do + sb.AppendFormat("(@Id_{0}, @Rn_{0}), ", i) |> ignore + sb.AppendFormat("(@Id_{0}, @Rn_{0}) ORDER BY 1) AS temp(id, randomNumber) WHERE temp.id = world.id", lastIndex) |> ignore + let result = sb.ToString() + queries[batchSize] <- result + result + | q -> q + + let private multipleUpdates : EndpointHandler = + fun ctx -> + let count = parseQueries ctx + let results = Array.zeroCreate count + task { + use conn = new NpgsqlConnection(ConnectionString) + do! conn.OpenAsync() + for i in 0..results.Length-1 do + let! result = readSingleRow conn + results[i] <- result + let parameters = Dictionary() + 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! _ = conn.ExecuteAsync(batchUpdateString count, parameters) + return! ctx.WriteJsonChunked results + } + + let utf8Const (s: string): EndpointHandler = + let result = s |> Encoding.UTF8.GetBytes + fun ctx -> + ctx.SetContentType("text/plain") + ctx.WriteBytes(result) + + let endpoints = + [| + route "/plaintext" <| utf8Const "Hello, World!" + route "/json"<| jsonChunked {| message = "Hello, World!" |} + route "/fortunes" fortunes + route "/db" singleQuery + route "/queries/{count?}" multipleQueries + route "/updates/{count?}" multipleUpdates + |] + + +module Main = + open SpanJson + open Microsoft.AspNetCore.Http + open Microsoft.AspNetCore.Builder + open Microsoft.AspNetCore.Hosting + open Microsoft.Extensions.DependencyInjection + open Microsoft.Extensions.Hosting + 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.Shared.Return(buffer.Array) + else + return () + } + member this.Deserialize _ = + failwith "Not implemented" + + [] + let main args = + let builder = WebApplication.CreateBuilder(args) + builder.Services + .AddRouting() + .AddOxpecker() + .AddSingleton(SpanJsonSerializer()) + |> ignore + builder.Logging.ClearProviders() |> ignore + let app = builder.Build() + app.UseRouting() + .UseOxpecker HttpHandlers.endpoints |> ignore + app.Run() + 0 \ No newline at end of file diff --git a/frameworks/FSharp/zebra/src/App/App.fsproj b/frameworks/FSharp/zebra/src/App/App.fsproj index 87f9f551340..84fb27f39d0 100644 --- a/frameworks/FSharp/zebra/src/App/App.fsproj +++ b/frameworks/FSharp/zebra/src/App/App.fsproj @@ -9,10 +9,10 @@ - - + + - + diff --git a/frameworks/FSharp/zebra/zebra-simple.dockerfile b/frameworks/FSharp/zebra/zebra-simple.dockerfile index b02a6c8977f..b36a831dd89 100644 --- a/frameworks/FSharp/zebra/zebra-simple.dockerfile +++ b/frameworks/FSharp/zebra/zebra-simple.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build WORKDIR /app COPY src/App . RUN dotnet publish -c Release -o out diff --git a/frameworks/FSharp/zebra/zebra.dockerfile b/frameworks/FSharp/zebra/zebra.dockerfile index a43c8eb1c5c..42fd7f53ee9 100644 --- a/frameworks/FSharp/zebra/zebra.dockerfile +++ b/frameworks/FSharp/zebra/zebra.dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0.100 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0.204 AS build WORKDIR /app COPY src/App . RUN dotnet publish -c Release -o out diff --git a/frameworks/Go/aah/src/benchmark/go.mod b/frameworks/Go/aah/src/benchmark/go.mod index 99e5799799d..09e57fa883b 100644 --- a/frameworks/Go/aah/src/benchmark/go.mod +++ b/frameworks/Go/aah/src/benchmark/go.mod @@ -22,10 +22,10 @@ require ( github.com/satori/go.uuid v1.2.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/urfave/cli v1.20.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect diff --git a/frameworks/Go/aah/src/benchmark/go.sum b/frameworks/Go/aah/src/benchmark/go.sum index 060b93b6321..b946b8eccff 100644 --- a/frameworks/Go/aah/src/benchmark/go.sum +++ b/frameworks/Go/aah/src/benchmark/go.sum @@ -42,17 +42,17 @@ github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= golang.org/x/crypto v0.0.0-20181012144002-a92615f3c490/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced h1:4oqSq7eft7MdPKBGQK11X9WYUxmj6ZLgGTqYIbY1kyw= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= diff --git a/frameworks/Go/echo/src/go.mod b/frameworks/Go/echo/src/go.mod index 35307bb0fec..63fe7fd1cef 100644 --- a/frameworks/Go/echo/src/go.mod +++ b/frameworks/Go/echo/src/go.mod @@ -13,8 +13,8 @@ require ( github.com/mattn/go-isatty v0.0.16 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.1 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/frameworks/Go/echo/src/go.sum b/frameworks/Go/echo/src/go.sum index c7d3f25fbcf..8732c64400d 100644 --- a/frameworks/Go/echo/src/go.sum +++ b/frameworks/Go/echo/src/go.sum @@ -22,16 +22,16 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/frameworks/Go/gin/gin-gorm/go.mod b/frameworks/Go/gin/gin-gorm/go.mod index cb57b57d80a..f2e364dcfef 100644 --- a/frameworks/Go/gin/gin-gorm/go.mod +++ b/frameworks/Go/gin/gin-gorm/go.mod @@ -42,9 +42,9 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.20.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/frameworks/Go/gin/gin-gorm/go.sum b/frameworks/Go/gin/gin-gorm/go.sum index a347b479b9d..dd864315456 100644 --- a/frameworks/Go/gin/gin-gorm/go.sum +++ b/frameworks/Go/gin/gin-gorm/go.sum @@ -194,8 +194,8 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= -golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -205,8 +205,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -223,8 +223,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/frameworks/Go/gin/gin-src/go.mod b/frameworks/Go/gin/gin-src/go.mod index 46b9a94832b..1ab84a0a5b2 100644 --- a/frameworks/Go/gin/gin-src/go.mod +++ b/frameworks/Go/gin/gin-src/go.mod @@ -26,9 +26,9 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/frameworks/Go/gin/gin-src/go.sum b/frameworks/Go/gin/gin-src/go.sum index 7b727e54dc3..8c28f90b980 100644 --- a/frameworks/Go/gin/gin-src/go.sum +++ b/frameworks/Go/gin/gin-src/go.sum @@ -62,14 +62,14 @@ github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZ golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/frameworks/Go/gin/gin-std/go.mod b/frameworks/Go/gin/gin-std/go.mod index 9c0fbb13ce8..06097ea951c 100644 --- a/frameworks/Go/gin/gin-std/go.mod +++ b/frameworks/Go/gin/gin-std/go.mod @@ -27,9 +27,9 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/frameworks/Go/gin/gin-std/go.sum b/frameworks/Go/gin/gin-std/go.sum index 4a4e2132598..0549623560d 100644 --- a/frameworks/Go/gin/gin-std/go.sum +++ b/frameworks/Go/gin/gin-std/go.sum @@ -63,14 +63,14 @@ github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZ golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= diff --git a/frameworks/Go/goframe/src/go.mod b/frameworks/Go/goframe/src/go.mod index 81cd961b3a6..6a931c78b4c 100644 --- a/frameworks/Go/goframe/src/go.mod +++ b/frameworks/Go/goframe/src/go.mod @@ -42,9 +42,9 @@ require ( go.opentelemetry.io/otel/sdk v1.7.0 // indirect go.opentelemetry.io/otel/trace v1.7.0 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.20.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/frameworks/Go/goframe/src/go.sum b/frameworks/Go/goframe/src/go.sum index 3b2bb947b83..12dd4e52b19 100644 --- a/frameworks/Go/goframe/src/go.sum +++ b/frameworks/Go/goframe/src/go.sum @@ -248,8 +248,8 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= -golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -267,8 +267,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -300,8 +300,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/frameworks/Go/kami/src/go.mod b/frameworks/Go/kami/src/go.mod index 70f73076e82..3297e41f3f6 100644 --- a/frameworks/Go/kami/src/go.mod +++ b/frameworks/Go/kami/src/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/go-sql-driver/mysql v1.6.0 github.com/guregu/kami v2.2.1+incompatible - golang.org/x/net v0.17.0 + golang.org/x/net v0.23.0 ) require ( diff --git a/frameworks/Go/kami/src/go.sum b/frameworks/Go/kami/src/go.sum index 90b928c95f5..e49331ae883 100644 --- a/frameworks/Go/kami/src/go.sum +++ b/frameworks/Go/kami/src/go.sum @@ -10,8 +10,8 @@ github.com/zenazn/goji v1.0.1 h1:4lbD8Mx2h7IvloP7r2C0D6ltZP6Ufip8Hn0wmSK5LR8= github.com/zenazn/goji v1.0.1/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/frameworks/Go/ronykit/src/go.mod b/frameworks/Go/ronykit/src/go.mod index 85b07b234d8..068e9493033 100644 --- a/frameworks/Go/ronykit/src/go.mod +++ b/frameworks/Go/ronykit/src/go.mod @@ -27,7 +27,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/frameworks/Go/ronykit/src/go.sum b/frameworks/Go/ronykit/src/go.sum index a63639eebcd..95adb04bb84 100644 --- a/frameworks/Go/ronykit/src/go.sum +++ b/frameworks/Go/ronykit/src/go.sum @@ -62,13 +62,13 @@ github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/frameworks/Java/helidon/helidon-nima.dockerfile b/frameworks/Java/helidon/helidon-nima.dockerfile index 94f67c40ffb..bfe655e52c0 100644 --- a/frameworks/Java/helidon/helidon-nima.dockerfile +++ b/frameworks/Java/helidon/helidon-nima.dockerfile @@ -1,17 +1,16 @@ -FROM docker.io/maven:3.9.2-eclipse-temurin-20 as maven +FROM docker.io/maven:3.9.6-eclipse-temurin-21 as maven WORKDIR /helidon COPY nima/src src COPY nima/pom.xml pom.xml RUN mvn package -q -FROM openjdk:20-jdk-slim +FROM openjdk:22-rc-jdk-slim WORKDIR /helidon COPY --from=maven /helidon/target/libs libs COPY --from=maven /helidon/target/benchmark-nima.jar app.jar EXPOSE 8080 -CMD java --enable-preview \ - -XX:+UseNUMA \ +CMD java -XX:+UseNUMA \ -XX:+UseParallelGC \ -jar app.jar diff --git a/frameworks/Java/helidon/nima/pom.xml b/frameworks/Java/helidon/nima/pom.xml index b08de529ffc..c884659a0a0 100644 --- a/frameworks/Java/helidon/nima/pom.xml +++ b/frameworks/Java/helidon/nima/pom.xml @@ -21,7 +21,7 @@ io.helidon.applications helidon-se - 4.0.0-ALPHA6 + 4.0.3 @@ -33,25 +33,25 @@ io.helidon.benchmark.nima.Main - 20 + 21 3.11.0 1.3.0 - 4.4.2 + 4.5.3 0.9.23 - io.helidon.nima.webserver - helidon-nima-webserver + io.helidon.webserver + helidon-webserver io.helidon.config helidon-config-yaml - io.helidon.nima.http.media - helidon-nima-http-media-jsonp + io.helidon.http.media + helidon-http-media-jsonp io.helidon.common @@ -83,8 +83,8 @@ ${rocker.version} - io.helidon.nima.testing.junit5 - helidon-nima-testing-junit5-webserver + io.helidon.common.testing + helidon-common-testing-junit5 test @@ -113,7 +113,6 @@ -Xlint:unchecked -Xpkginfo:always - --enable-preview diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/Main.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/Main.java index 6572acf9b27..92896867246 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/Main.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/Main.java @@ -29,18 +29,17 @@ import io.helidon.benchmark.nima.models.PgClientRepository; import io.helidon.benchmark.nima.services.DbService; import io.helidon.benchmark.nima.services.FortuneHandler; -import io.helidon.common.http.Http; -import io.helidon.common.http.Http.Header; -import io.helidon.common.http.Http.HeaderValue; -import io.helidon.common.http.Http.HeaderValues; +import io.helidon.http.Header; +import io.helidon.http.HeaderNames; +import io.helidon.http.HeaderValues; import io.helidon.config.Config; import io.helidon.config.ConfigException; import io.helidon.logging.common.LogConfig; -import io.helidon.nima.webserver.WebServer; -import io.helidon.nima.webserver.http.Handler; -import io.helidon.nima.webserver.http.HttpRules; -import io.helidon.nima.webserver.http.ServerRequest; -import io.helidon.nima.webserver.http.ServerResponse; +import io.helidon.webserver.WebServer; +import io.helidon.webserver.http.Handler; +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; /** * Main class of the benchmark. @@ -50,9 +49,9 @@ public final class Main { private static final Logger LOGGER = Logger.getLogger(Main.class.getName()); - public static final Http.HeaderValue CONTENT_TYPE_HTML = - Http.Header.createCached(Http.Header.CONTENT_TYPE, "text/html; charset=UTF-8"); - public static final Http.HeaderValue SERVER = Http.Header.createCached(Http.Header.SERVER, "Nima"); + public static final Header CONTENT_TYPE_HTML = + HeaderValues.createCached(HeaderNames.CONTENT_TYPE, "text/html; charset=UTF-8"); + public static final Header SERVER = HeaderValues.createCached(HeaderNames.SERVER, "Nima"); private Main() { } @@ -67,11 +66,14 @@ public static void main(String[] args) { LogConfig.configureRuntime(); WebServer.builder() + .config(Config.create().get("server")) .routing(Main::routing) + .build() .start(); } // exposed for tests + @SuppressWarnings("unchecked") static void routing(HttpRules rules) { Config config = Config.create(); @@ -107,9 +109,9 @@ private static byte[] serializeMsg(Message obj) { } static class PlaintextHandler implements Handler { - static final HeaderValue CONTENT_TYPE = Header.createCached(Header.CONTENT_TYPE, + static final Header CONTENT_TYPE = HeaderValues.createCached(HeaderNames.CONTENT_TYPE, "text/plain; charset=UTF-8"); - static final HeaderValue CONTENT_LENGTH = Header.createCached(Header.CONTENT_LENGTH, "13"); + static final Header CONTENT_LENGTH = HeaderValues.createCached(HeaderNames.CONTENT_LENGTH, "13"); private static final byte[] RESPONSE_BYTES = "Hello, World!".getBytes(StandardCharsets.UTF_8); @@ -125,7 +127,7 @@ public void handle(ServerRequest req, ServerResponse res) { static class JsonHandler implements Handler { private static final String MESSAGE = "Hello, World!"; private static final int JSON_LENGTH = serializeMsg(new Message(MESSAGE)).length; - static final HeaderValue CONTENT_LENGTH = Header.createCached(Header.CONTENT_LENGTH, + static final Header CONTENT_LENGTH = HeaderValues.createCached(HeaderNames.CONTENT_LENGTH, String.valueOf(JSON_LENGTH)); @Override @@ -142,13 +144,13 @@ private static Message newMsg() { } static class JsonKHandler implements Handler { - private final HeaderValue contentLength; + private final Header contentLength; private final String message; JsonKHandler(int kilobytes) { this.message = "a".repeat(1024 * kilobytes); int length = serializeMsg(new Message(message)).length; - this.contentLength = Header.createCached(Header.CONTENT_LENGTH, + this.contentLength = HeaderValues.createCached(HeaderNames.CONTENT_LENGTH, String.valueOf(length)); } diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java index 02a768add6c..7775a177537 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientRepository.java @@ -110,29 +110,34 @@ public List getWorlds(int count) { @Override public World updateWorld(World world) { - try { - updateWorlds(List.of(world), 0, updatePool); - return world; - } catch (Exception e) { - throw new RuntimeException(e); - } + return Single.create(queryPool.preparedQuery("UPDATE world SET randomnumber = $1 WHERE id = $2") + .execute(Tuple.of(world.id, world.id)) + .toCompletionStage() + .thenApply(rows -> world)).await(); } @Override public List updateWorlds(int count) { List worlds = getWorlds(count); - for (World w : worlds) { - w.randomNumber = randomWorldNumber(); - } - if (count <= batchSize) { - LOGGER.finest(() -> "Updating single batch of size " + count); - updateWorldsRetry(worlds, 0, 0); - } else { - int batches = count / batchSize + (count % batchSize == 0 ? 0 : 1); - for (int i = 0; i < batches; i++) { - final int from = i * batchSize; - LOGGER.finest(() -> "Updating batch from " + from + " to " + (from + batchSize)); - updateWorldsRetry(worlds, from, 0); + if (batchSize > 1) { // batching updates + for (World w : worlds) { + w.randomNumber = randomWorldNumber(); + } + if (count <= batchSize) { + LOGGER.finest(() -> "Updating single batch of size " + count); + updateWorldsRetry(worlds, 0, 0); + } else { + int batches = count / batchSize + (count % batchSize == 0 ? 0 : 1); + for (int i = 0; i < batches; i++) { + final int from = i * batchSize; + LOGGER.finest(() -> "Updating batch from " + from + " to " + (from + batchSize)); + updateWorldsRetry(worlds, from, 0); + } + } + } else { // no batching for size 1 + for (World w : worlds) { + w.randomNumber = randomWorldNumber(); + updateWorld(w); } } return worlds; diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/DbService.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/DbService.java index 086c620f0c5..46c244d96f5 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/DbService.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/DbService.java @@ -7,10 +7,10 @@ import io.helidon.benchmark.nima.models.DbRepository; import io.helidon.benchmark.nima.models.World; import io.helidon.common.parameters.Parameters; -import io.helidon.nima.webserver.http.HttpRules; -import io.helidon.nima.webserver.http.HttpService; -import io.helidon.nima.webserver.http.ServerRequest; -import io.helidon.nima.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.HttpService; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; import jakarta.json.Json; import jakarta.json.JsonArrayBuilder; diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/FortuneHandler.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/FortuneHandler.java index 38eb950fcc1..8847b7d0bc1 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/FortuneHandler.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/services/FortuneHandler.java @@ -7,9 +7,9 @@ import com.fizzed.rocker.runtime.ArrayOfByteArraysOutput; import io.helidon.benchmark.nima.models.DbRepository; import io.helidon.benchmark.nima.models.Fortune; -import io.helidon.nima.webserver.http.Handler; -import io.helidon.nima.webserver.http.ServerRequest; -import io.helidon.nima.webserver.http.ServerResponse; +import io.helidon.webserver.http.Handler; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; import views.fortunes; import static io.helidon.benchmark.nima.Main.CONTENT_TYPE_HTML; diff --git a/frameworks/Java/helidon/nima/src/main/resources/application.yaml b/frameworks/Java/helidon/nima/src/main/resources/application.yaml index 511b0173ae5..ff4aa100b67 100644 --- a/frameworks/Java/helidon/nima/src/main/resources/application.yaml +++ b/frameworks/Java/helidon/nima/src/main/resources/application.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2023 Oracle and/or its affiliates. +# Copyright (c) 2022, 2024 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,33 +15,27 @@ # server: + host: 0.0.0.0 port: 8080 - sockets: - - name: "@default" - host: 0.0.0.0 - port: 8080 - backlog: 8192 - receive-buffer-size: 64000 - # set write-queue-length to 0 or not setting it will disable async writes - # write-queue-length: 1024 - connection-options: - read-timeout-seconds: 0 - connect-timeout-seconds: 0 - send-buffer-size: 64000 - receive-buffer-size: 64000 - connection-providers: + backlog: 8192 + write-queue-length: 8192 + connection-options: + read-timeout: PT0S + connect-timeout: PT0S + tcp-no-delay: true + protocols: "http_1_1": - validate-headers: false + validate-request-headers: false + validate-response-headers: false validate-path: false recv-log: false send-log: false host: "tfb-database" -#host: "localhost" db: "hello_world" username: benchmarkdbuser password: benchmarkdbpass -sql-pool-size: 200 +sql-pool-size: 300 db-repository: "pgclient" # "pgclient" (default) or "hikari" # The following for pgclient only diff --git a/frameworks/Java/inverno/inverno-postgres.dockerfile b/frameworks/Java/inverno/inverno-postgres.dockerfile index 6a3fcd9070f..737cb434013 100644 --- a/frameworks/Java/inverno/inverno-postgres.dockerfile +++ b/frameworks/Java/inverno/inverno-postgres.dockerfile @@ -7,6 +7,7 @@ RUN mvn package -q -Pio.inverno.io_uring EXPOSE 8080 -# CMD [ "target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark" ] CMD export DBIP=`getent hosts tfb-database | awk '{ print $1 }'` && \ - target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark --com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\" + target/inverno-benchmark-1.0.0-SNAPSHOT-application_linux_amd64/bin/inverno-benchmark \ + --com.techempower.inverno.benchmark.appConfiguration.db_host=\"$DBIP\" \ + --com.techempower.inverno.benchmark.appConfiguration.boot.reactor_event_loop_group_size=$((`grep --count ^processor /proc/cpuinfo`)) diff --git a/frameworks/Java/inverno/pom.xml b/frameworks/Java/inverno/pom.xml index 40158dba480..c91b31c2d37 100644 --- a/frameworks/Java/inverno/pom.xml +++ b/frameworks/Java/inverno/pom.xml @@ -6,7 +6,7 @@ io.inverno.dist inverno-parent - 1.7.0 + 1.10.0 com.techempower inverno-benchmark @@ -47,7 +47,7 @@ io.inverno.mod inverno-sql-vertx - + org.unbescape unbescape @@ -71,31 +71,12 @@ io.netty netty-handler-proxy - ${version.netty} io.netty netty-resolver-dns - ${version.netty} - - - - io.netty.incubator - netty-incubator-transport-native-io_uring - linux-x86_64 - - - - io.vertx - vertx-io_uring-incubator - - org.apache.logging.log4j log4j-core @@ -129,7 +110,7 @@ inverno-benchmark - -Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64 + -Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dlog4j2.level=OFF -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkAccessible=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64 @@ -138,6 +119,9 @@ + + --add-modules io.netty.transport.unix.common,io.netty.transport.classes.epoll,io.netty.transport.epoll.linux.x86_64 + @@ -146,10 +130,15 @@ io.inverno.io_uring - io.netty - netty-transport-native-epoll + io.netty.incubator + netty-incubator-transport-native-io_uring linux-x86_64 + + + io.vertx + vertx-io_uring-incubator + @@ -168,7 +157,7 @@ inverno-benchmark - -Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkBounds=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64 + -Xms2g -Xmx2g -server -XX:+UseNUMA -XX:+UseParallelGC -Dlog4j2.level=OFF -Dio.netty.leakDetection.level=disabled -Dio.netty.buffer.checkBounds=false -Dio.netty.buffer.checkAccessible=false -Dvertx.disableHttpHeadersValidation=true -Dvertx.disableMetrics=true -Dvertx.disableH2c=true -Dvertx.disableWebsockets=true -Dvertx.flashPolicyHandler=false -Dvertx.threadChecks=false -Dvertx.disableContextTimings=true -Dvertx.disableTCCL=true --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64 @@ -177,6 +166,9 @@ + + --add-modules io.netty.transport.unix.common,io.netty.incubator.transport.classes.io_uring,io.netty.incubator.transport.io_uring.linux.x86_64 + diff --git a/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java b/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java index 639ec561159..33c94a5c7b4 100644 --- a/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java +++ b/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/Controller.java @@ -1,20 +1,11 @@ package com.techempower.inverno.benchmark.internal; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Collections; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.techempower.inverno.benchmark.model.Fortune; import com.techempower.inverno.benchmark.model.Message; import com.techempower.inverno.benchmark.model.World; import com.techempower.inverno.benchmark.templates.FortunesTemplate; - import io.inverno.core.annotation.Bean; import io.inverno.core.annotation.Bean.Visibility; import io.inverno.core.annotation.Destroy; @@ -39,6 +30,13 @@ import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaderValues; import io.netty.util.AsciiString; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -81,6 +79,8 @@ public void init() { this.dateEventLoopGroup.scheduleAtFixedRate(() -> { this.date = new AsciiString(DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now())); }, 0, 1000, TimeUnit.MILLISECONDS); + + } @Destroy @@ -133,7 +133,7 @@ public void handle(Exchange exchange) throws HttpException { private static final ByteBuf STATIC_PLAINTEXT_BYTEBUF; static { - ByteBuf tmpBuf = Unpooled.directBuffer(STATIC_PLAINTEXT_LEN); + ByteBuf tmpBuf = Unpooled.buffer(STATIC_PLAINTEXT_LEN); tmpBuf.writeBytes(STATIC_PLAINTEXT); STATIC_PLAINTEXT_BYTEBUF = Unpooled.unreleasableBuffer(tmpBuf); } @@ -172,7 +172,7 @@ public void handle_json(Exchange exchange) throws HttpException ) .body() .raw() - .value(Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new Message("Hello, World!"))))); + .value(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new Message("Hello, World!")))); } catch (JsonProcessingException | IllegalStateException e) { throw new InternalServerErrorException("Error serializing message as JSON", e); @@ -196,7 +196,7 @@ public void handle_db(Exchange exchange) throws HttpException { DB_SELECT_WORLD, row -> { try { - return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new World(row.getInteger(0), row.getInteger(1))))); + return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(new World(row.getInteger(0), row.getInteger(1)))); } catch (JsonProcessingException e) { throw new InternalServerErrorException(e); @@ -241,7 +241,7 @@ public void handle_queries(Exchange exchange) throws HttpExcept .collectList() .map(worlds -> { try { - return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds))); + return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds)); } catch (JsonProcessingException e) { throw new InternalServerErrorException(e); @@ -278,7 +278,7 @@ public void handle_updates(Exchange exchange) throws HttpExcept ) .map(worlds -> { try { - return Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds))); + return Unpooled.wrappedBuffer(this.mapper.writeValueAsBytes(worlds)); } catch (JsonProcessingException e) { throw new InternalServerErrorException(e); @@ -290,7 +290,7 @@ public void handle_updates(Exchange exchange) throws HttpExcept private static final CharSequence MEDIA_TEXT_HTML_UTF8 = AsciiString.cached("text/html; charset=utf-8"); - private static final FortunesTemplate.Renderer> FORTUNES_RENDERER = FortunesTemplate.bytebuf(() -> Unpooled.unreleasableBuffer(Unpooled.buffer())); + private static final FortunesTemplate.Renderer> FORTUNES_RENDERER = FortunesTemplate.bytebuf(() -> Unpooled.buffer()); public void handle_fortunes(Exchange exchange) throws HttpException { exchange.response() diff --git a/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/SqlClientReactorScope.java b/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/SqlClientReactorScope.java index 81b30069ec2..d3b8a463865 100644 --- a/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/SqlClientReactorScope.java +++ b/frameworks/Java/inverno/src/main/java/com/techempower/inverno/benchmark/internal/SqlClientReactorScope.java @@ -59,6 +59,8 @@ public void destroy() { @Override protected Mono create() { - return Mono.fromCompletionStage(PgConnection.connect(this.vertx, this.connectOptions).toCompletionStage()).map(pgConn -> (SqlClient)new ConnectionSqlClient(pgConn)).cache(); + return Mono.fromCompletionStage(() -> PgConnection.connect(this.vertx, this.connectOptions).toCompletionStage()) + .map(pgConn -> (SqlClient)new ConnectionSqlClient(pgConn)) + .cacheInvalidateWhen(client -> ((ConnectionSqlClient)client).onClose()); } } diff --git a/frameworks/Java/inverno/src/main/resources/configuration.cprops b/frameworks/Java/inverno/src/main/resources/configuration.cprops index df4680e124b..9fc9d6fddd0 100644 --- a/frameworks/Java/inverno/src/main/resources/configuration.cprops +++ b/frameworks/Java/inverno/src/main/resources/configuration.cprops @@ -6,7 +6,9 @@ com.techempower.inverno.benchmark.appConfiguration { http_server { tls_enabled = false server_port = 8080 - h2c_enabled = false + h2_enabled = false + http1x_validate_headers = false + ws_enabled = false } db_database = "hello_world" db_host = "tfb-database" diff --git a/frameworks/Java/jooby/pom.xml b/frameworks/Java/jooby/pom.xml index 90b9758b991..338f8ca065d 100644 --- a/frameworks/Java/jooby/pom.xml +++ b/frameworks/Java/jooby/pom.xml @@ -11,9 +11,10 @@ jooby - 3.0.8 + 3.1.2 + 4.1.110.Final 2.0.2 - 42.7.2 + 42.7.3 UTF-8 21 21 @@ -41,10 +42,9 @@ com.mysql mysql-connector-j - 8.3.0 + 8.4.0 - org.postgresql @@ -55,7 +55,7 @@ io.vertx vertx-pg-client - 4.5.4 + 4.5.7 @@ -166,6 +166,25 @@ + + mac + + + mac + + + + + com.ongres.scram + client + 2.1 + + + io.netty + netty-resolver-dns-native-macos + + + undertow @@ -202,6 +221,14 @@ + + io.netty + netty-bom + ${netty.version} + pom + import + + io.jooby jooby-bom diff --git a/frameworks/Java/jooby/src/main/java/com/techempower/App.java b/frameworks/Java/jooby/src/main/java/com/techempower/App.java index 01c3665a76b..f7cf3373b4a 100644 --- a/frameworks/Java/jooby/src/main/java/com/techempower/App.java +++ b/frameworks/Java/jooby/src/main/java/com/techempower/App.java @@ -40,7 +40,7 @@ public class App extends Jooby { DataSource ds = require(DataSource.class); /** Template engine: */ - install(new RockerModule().reuseBuffer(true)); + install(new RockerModule()); get("/plaintext", ctx -> ctx.send(MESSAGE_BUFFER.duplicate()) diff --git a/frameworks/Java/jooby/src/main/java/com/techempower/Json.java b/frameworks/Java/jooby/src/main/java/com/techempower/Json.java index 87543caec1f..2fa2af86ba1 100644 --- a/frameworks/Java/jooby/src/main/java/com/techempower/Json.java +++ b/frameworks/Java/jooby/src/main/java/com/techempower/Json.java @@ -19,8 +19,7 @@ public class Json { public static ByteBuffer encode(Message data) { JsonWriter writer = pool.get(); writer.reset(); - _Message_DslJsonConverter.ObjectFormatConverter converter = new _Message_DslJsonConverter.ObjectFormatConverter( - dslJson); + var converter = new _Message_DslJsonConverter.ObjectFormatConverter(dslJson); converter.write(writer, data); return ByteBuffer.wrap(writer.getByteBuffer(), 0, writer.size()); } @@ -28,8 +27,7 @@ public static ByteBuffer encode(Message data) { public static ByteBuffer encode(World data) { JsonWriter writer = pool.get(); writer.reset(); - _World_DslJsonConverter.ObjectFormatConverter converter = new _World_DslJsonConverter.ObjectFormatConverter( - dslJson); + var converter = new _World_DslJsonConverter.ObjectFormatConverter(dslJson); converter.write(writer, data); return ByteBuffer.wrap(writer.getByteBuffer(), 0, writer.size()); } @@ -37,8 +35,7 @@ public static ByteBuffer encode(World data) { public static ByteBuffer encode(World[] data) { JsonWriter writer = pool.get(); writer.reset(); - _World_DslJsonConverter.ObjectFormatConverter converter = new _World_DslJsonConverter.ObjectFormatConverter( - dslJson); + var converter = new _World_DslJsonConverter.ObjectFormatConverter(dslJson); writer.serialize(data, converter); return ByteBuffer.wrap(writer.getByteBuffer(), 0, writer.size()); } @@ -46,8 +43,7 @@ public static ByteBuffer encode(World[] data) { public static ByteBuffer encode(List data) { JsonWriter writer = pool.get(); writer.reset(); - _World_DslJsonConverter.ObjectFormatConverter converter = new _World_DslJsonConverter.ObjectFormatConverter( - dslJson); + var converter = new _World_DslJsonConverter.ObjectFormatConverter(dslJson); writer.serialize(data, converter); return ByteBuffer.wrap(writer.getByteBuffer(), 0, writer.size()); } diff --git a/frameworks/Java/jooby/src/main/java/com/techempower/ReactivePg.java b/frameworks/Java/jooby/src/main/java/com/techempower/ReactivePg.java index bd456dc2824..6a674c5e8df 100644 --- a/frameworks/Java/jooby/src/main/java/com/techempower/ReactivePg.java +++ b/frameworks/Java/jooby/src/main/java/com/techempower/ReactivePg.java @@ -4,17 +4,14 @@ import static io.jooby.ExecutionMode.EVENT_LOOP; import static io.jooby.MediaType.JSON; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import com.fizzed.rocker.RockerOutputFactory; import io.jooby.Context; import io.jooby.Jooby; import io.jooby.MediaType; import io.jooby.ServerOptions; -import io.jooby.rocker.ByteBufferOutput; +import io.jooby.rocker.DataBufferOutput; import io.jooby.rocker.RockerModule; import io.vertx.sqlclient.Row; import io.vertx.sqlclient.RowIterator; @@ -34,7 +31,7 @@ public class ReactivePg extends Jooby { PgClient client = new PgClient(getConfig().getConfig("db")); /** Template engine: */ - install(new RockerModule().reuseBuffer(true)); + install(new RockerModule()); /** Single query: */ get("/db", ctx -> { @@ -109,7 +106,7 @@ public class ReactivePg extends Jooby { }).setNonBlocking(true); /** Fortunes: */ - RockerOutputFactory factory = require(RockerOutputFactory.class); + RockerOutputFactory factory = require(RockerOutputFactory.class); get("/fortunes", ctx -> { client.fortunes(rsp -> { if (rsp.succeeded()) { diff --git a/frameworks/Java/light-java/pom.xml b/frameworks/Java/light-java/pom.xml index eca4217eec8..0d76eb4e631 100644 --- a/frameworks/Java/light-java/pom.xml +++ b/frameworks/Java/light-java/pom.xml @@ -25,7 +25,7 @@ 11 2.0.1 1.3.12 - 2.3.5.Final + 2.3.12.Final 3.3.1 8.0.28 42.7.2 diff --git a/frameworks/Java/micronaut/benchmark_config.json b/frameworks/Java/micronaut/benchmark_config.json index 215f6a90565..a72758e6862 100755 --- a/frameworks/Java/micronaut/benchmark_config.json +++ b/frameworks/Java/micronaut/benchmark_config.json @@ -16,9 +16,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Vertx PG Client", @@ -39,9 +39,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Vertx PG Client GraalVM", @@ -60,9 +60,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut JDBC", @@ -81,9 +81,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut JDBC GraalVM", @@ -102,9 +102,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut R2DBC", @@ -123,9 +123,9 @@ "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Raw", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut R2DBC GraalVM", @@ -139,14 +139,14 @@ "update_url": "/updates?queries=", "port": 8080, "approach": "Realistic", - "classification": "Micro", + "classification": "fullstack", "database": "Postgres", "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Micro", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Data JDBC", @@ -160,14 +160,14 @@ "update_url": "/updates?queries=", "port": 8080, "approach": "Realistic", - "classification": "Micro", + "classification": "fullstack", "database": "Postgres", "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Micro", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Data JDBC GraalVM", @@ -181,14 +181,14 @@ "update_url": "/updates?queries=", "port": 8080, "approach": "Realistic", - "classification": "Micro", + "classification": "fullstack", "database": "MongoDB", "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Micro", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Data MongoDB", @@ -202,14 +202,14 @@ "update_url": "/updates?queries=", "port": 8080, "approach": "Realistic", - "classification": "Micro", + "classification": "fullstack", "database": "MongoDB", "framework": "Micronaut", "language": "Java", "flavor": "None", - "orm": "raw", + "orm": "Micro", "platform": "Netty", - "webserver": "None", + "webserver": "Netty", "os": "Linux", "database_os": "Linux", "display_name": "Micronaut Data MongoDB GraalVM", diff --git a/frameworks/Java/micronaut/buildSrc/build.gradle b/frameworks/Java/micronaut/buildSrc/build.gradle index e15932b65d0..7f10f90ed59 100644 --- a/frameworks/Java/micronaut/buildSrc/build.gradle +++ b/frameworks/Java/micronaut/buildSrc/build.gradle @@ -8,6 +8,6 @@ repositories { } dependencies { - implementation "io.micronaut.gradle:micronaut-gradle-plugin:4.0.1" - implementation "gradle.plugin.com.github.johnrengelman:shadow:7.1.2" + implementation "io.micronaut.gradle:micronaut-gradle-plugin:4.3.7" + implementation "com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.1" } \ No newline at end of file diff --git a/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/AsyncBenchmarkController.java b/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/AsyncBenchmarkController.java index df8824142a8..7e40c36a204 100644 --- a/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/AsyncBenchmarkController.java +++ b/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/AsyncBenchmarkController.java @@ -9,15 +9,12 @@ import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.QueryValue; -import io.micronaut.scheduling.TaskExecutors; -import jakarta.inject.Named; import views.fortunes; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.concurrent.CompletionStage; -import java.util.concurrent.Executor; import static java.util.Comparator.comparing; @@ -27,14 +24,11 @@ public class AsyncBenchmarkController extends AbstractBenchmarkController { private final AsyncWorldRepository worldRepository; private final AsyncFortuneRepository fortuneRepository; - private final Executor executor; public AsyncBenchmarkController(AsyncWorldRepository worldRepository, - AsyncFortuneRepository fortuneRepository, - @Named(TaskExecutors.BLOCKING) Executor executor) { + AsyncFortuneRepository fortuneRepository) { this.worldRepository = worldRepository; this.fortuneRepository = fortuneRepository; - this.executor = executor; } @Get("/prepare-data-for-test") @@ -45,7 +39,7 @@ public CompletionStage prepareDataForTest() { // https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#single-database-query @Get("/db") public CompletionStage db() { - return worldRepository.findById(randomId()).thenApplyAsync(world -> world, executor); + return worldRepository.findById(randomId()); } // https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#multiple-database-queries @@ -56,20 +50,20 @@ public CompletionStage> queries(@QueryValue String queries) { for (int i = 0; i < count; i++) { ids.add(randomId()); } - return worldRepository.findByIds(ids).thenApplyAsync(worlds -> worlds, executor); + return worldRepository.findByIds(ids); } // https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#fortunes @Get(value = "/fortunes", produces = "text/html;charset=utf-8") public CompletionStage> fortune() { - return fortuneRepository.findAll().thenApplyAsync(fortuneList -> { + return fortuneRepository.findAll().thenApply(fortuneList -> { List all = new ArrayList<>(fortuneList.size() + 1); all.add(new Fortune(0, "Additional fortune added at request time.")); all.addAll(fortuneList); all.sort(comparing(Fortune::message)); String body = fortunes.template(all).render().toString(); return HttpResponse.ok(body).contentType("text/html;charset=utf-8"); - }, executor); + }); } // https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#database-updates @@ -80,7 +74,7 @@ public CompletionStage> updates(@QueryValue String queries) { world.setRandomNumber(randomWorldNumber()); } worlds.sort(Comparator.comparingInt(World::getId)); // Avoid deadlock - return worldRepository.updateAll(worlds).thenApplyAsync(ignore -> worlds, executor); + return worldRepository.updateAll(worlds).thenApply(ignore -> worlds); }); } diff --git a/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/BenchmarkController.java b/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/BenchmarkController.java index 5f23b1ee017..c00eed41fb4 100644 --- a/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/BenchmarkController.java +++ b/frameworks/Java/micronaut/common/src/main/java/benchmark/controller/BenchmarkController.java @@ -9,8 +9,6 @@ import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Get; import io.micronaut.http.annotation.QueryValue; -import io.micronaut.scheduling.TaskExecutors; -import io.micronaut.scheduling.annotation.ExecuteOn; import views.fortunes; import java.util.ArrayList; @@ -20,7 +18,6 @@ import static java.util.Comparator.comparing; -@ExecuteOn(TaskExecutors.IO) @Requires(beans = {WorldRepository.class, FortuneRepository.class}) @Controller public class BenchmarkController extends AbstractBenchmarkController { diff --git a/frameworks/Java/micronaut/common/src/main/java/benchmark/filter/ServerHeaderFilter.java b/frameworks/Java/micronaut/common/src/main/java/benchmark/filter/ServerHeaderFilter.java index 8a20f9c765c..0a89778bfef 100644 --- a/frameworks/Java/micronaut/common/src/main/java/benchmark/filter/ServerHeaderFilter.java +++ b/frameworks/Java/micronaut/common/src/main/java/benchmark/filter/ServerHeaderFilter.java @@ -4,7 +4,9 @@ import io.micronaut.http.annotation.Filter; import io.micronaut.http.annotation.ResponseFilter; import io.micronaut.http.annotation.ServerFilter; +import io.micronaut.http.netty.NettyHttpHeaders; import io.micronaut.scheduling.annotation.Scheduled; +import io.netty.handler.codec.http.HttpHeaderNames; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -25,7 +27,8 @@ public void setDateHeader() { @ResponseFilter public void addDateHeader(MutableHttpResponse mutableHttpResponse) { - mutableHttpResponse.header("Date", dateHeader); + NettyHttpHeaders nettyHttpHeaders = (NettyHttpHeaders) mutableHttpResponse.getHeaders(); + nettyHttpHeaders.setUnsafe(HttpHeaderNames.DATE, dateHeader); } } \ No newline at end of file diff --git a/frameworks/Java/micronaut/common/src/main/resources/application-benchmark.yml b/frameworks/Java/micronaut/common/src/main/resources/application-benchmark.yml index efff28fbc46..4a1882287dc 100644 --- a/frameworks/Java/micronaut/common/src/main/resources/application-benchmark.yml +++ b/frameworks/Java/micronaut/common/src/main/resources/application-benchmark.yml @@ -5,6 +5,7 @@ micronaut: port: 8080 server-header: Micronaut date-header: false + validate-url: false http: client: read-timeout: 60s diff --git a/frameworks/Java/micronaut/common/src/main/resources/application-common.yml b/frameworks/Java/micronaut/common/src/main/resources/application-common.yml index ab67403287e..0e7745c6b29 100644 --- a/frameworks/Java/micronaut/common/src/main/resources/application-common.yml +++ b/frameworks/Java/micronaut/common/src/main/resources/application-common.yml @@ -5,6 +5,7 @@ micronaut: port: 8080 server-header: Micronaut date-header: false + validate-url: false netty: resource-leak-detector-level: DISABLED @@ -17,7 +18,7 @@ datasources: driverClassName: org.postgresql.Driver db-type: postgresql dialect: POSTGRES - maximum-pool-size: 48 + maximum-pool-size: 512 transaction-per-operation: false allow-connection-per-operation: true @@ -29,7 +30,7 @@ r2dbc: options: protocol: postgres initialSize: 0 # https://github.com/micronaut-projects/micronaut-data/issues/2136 - maxSize: 48 + maxSize: 512 mongodb: package-names: diff --git a/frameworks/Java/micronaut/gradle.properties b/frameworks/Java/micronaut/gradle.properties index a52f36963cb..6d8a8be3f5c 100644 --- a/frameworks/Java/micronaut/gradle.properties +++ b/frameworks/Java/micronaut/gradle.properties @@ -1 +1 @@ -micronautVersion = 4.2.2 +micronautVersion=4.4.3 diff --git a/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.jar b/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.jar index 7f93135c49b..e6441136f3d 100644 Binary files a/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.jar and b/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.jar differ diff --git a/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.properties b/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.properties index 3fa8f862f75..b82aa23a4f0 100644 --- a/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.properties +++ b/frameworks/Java/micronaut/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/frameworks/Java/micronaut/gradlew.bat b/frameworks/Java/micronaut/gradlew.bat index 6689b85beec..7101f8e4676 100644 --- a/frameworks/Java/micronaut/gradlew.bat +++ b/frameworks/Java/micronaut/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile index 2057d6d9487..c93c4012437 100644 --- a/frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-jdbc-graalvm.dockerfile @@ -1,11 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-data-jdbc:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-data-jdbc:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 -RUN apk --no-cache update && apk add libstdc++ +FROM cgr.dev/chainguard/wolfi-base:latest WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-data-jdbc/build/native/nativeCompile/micronaut-data-jdbc micronaut diff --git a/frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile b/frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile index a15705ff470..53b8546389f 100644 --- a/frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-jdbc.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-data-jdbc:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut 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 diff --git a/frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile index 1f090fc4deb..162ab11cb31 100644 --- a/frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-mongodb-graalvm.dockerfile @@ -1,11 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-data-mongodb:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-data-mongodb:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 -RUN apk --no-cache update && apk add libstdc++ +FROM cgr.dev/chainguard/wolfi-base:latest WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-data-mongodb/build/native/nativeCompile/micronaut-data-mongodb micronaut diff --git a/frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile b/frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile index 3b009baa929..4e8c3f928f7 100644 --- a/frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-mongodb.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-data-mongodb:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut 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 diff --git a/frameworks/Java/micronaut/micronaut-data-mongodb/build.gradle b/frameworks/Java/micronaut/micronaut-data-mongodb/build.gradle index a80c5797d38..07cc244708a 100644 --- a/frameworks/Java/micronaut/micronaut-data-mongodb/build.gradle +++ b/frameworks/Java/micronaut/micronaut-data-mongodb/build.gradle @@ -4,6 +4,6 @@ plugins { dependencies { annotationProcessor("io.micronaut.data:micronaut-data-document-processor") - implementation("io.micronaut.data:micronaut-data-mongodb:3.8.1") + implementation("io.micronaut.data:micronaut-data-mongodb") runtimeOnly("io.micronaut.mongodb:micronaut-mongo-sync") } \ No newline at end of file diff --git a/frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile index ad20f4f403d..14004898dc1 100644 --- a/frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-r2dbc-graalvm.dockerfile @@ -1,11 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-data-r2dbc:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-data-r2dbc:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 -RUN apk --no-cache update && apk add libstdc++ +FROM cgr.dev/chainguard/wolfi-base:latest WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-data-r2dbc/build/native/nativeCompile/micronaut-data-r2dbc micronaut diff --git a/frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile b/frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile index efb48dd3fb1..04f065d8288 100644 --- a/frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile +++ b/frameworks/Java/micronaut/micronaut-data-r2dbc.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-data-r2dbc:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut 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 diff --git a/frameworks/Java/micronaut/micronaut-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-graalvm.dockerfile index 3f364c05edd..f4cbb033460 100644 --- a/frameworks/Java/micronaut/micronaut-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-graalvm.dockerfile @@ -1,10 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-vertx-pg-client:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-vertx-pg-client:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 +FROM cgr.dev/chainguard/wolfi-base:latest RUN apk --no-cache update && apk add libstdc++ WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-vertx-pg-client/build/native/nativeCompile/micronaut-vertx-pg-client micronaut diff --git a/frameworks/Java/micronaut/micronaut-jdbc-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-jdbc-graalvm.dockerfile index 3a35839970c..a64b60773ad 100644 --- a/frameworks/Java/micronaut/micronaut-jdbc-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-jdbc-graalvm.dockerfile @@ -1,11 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-jdbc:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-jdbc:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 -RUN apk --no-cache update && apk add libstdc++ +FROM cgr.dev/chainguard/wolfi-base:latest WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-jdbc/build/native/nativeCompile/micronaut-jdbc micronaut diff --git a/frameworks/Java/micronaut/micronaut-jdbc.dockerfile b/frameworks/Java/micronaut/micronaut-jdbc.dockerfile index 6113f396683..1d56f8a5a8a 100644 --- a/frameworks/Java/micronaut/micronaut-jdbc.dockerfile +++ b/frameworks/Java/micronaut/micronaut-jdbc.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-jdbc:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-jdbc/build/libs/micronaut-jdbc-all.jar micronaut.jar COPY run_benchmark.sh run_benchmark.sh diff --git a/frameworks/Java/micronaut/micronaut-r2dbc-graalvm.dockerfile b/frameworks/Java/micronaut/micronaut-r2dbc-graalvm.dockerfile index 627fd21aba2..ff10709dae7 100644 --- a/frameworks/Java/micronaut/micronaut-r2dbc-graalvm.dockerfile +++ b/frameworks/Java/micronaut/micronaut-r2dbc-graalvm.dockerfile @@ -1,11 +1,10 @@ -FROM ghcr.io/graalvm/graalvm-community:latest as build +FROM ghcr.io/graalvm/native-image-community:21-ol9 as build +RUN microdnf install findutils # Gradle 8.7 requires xargs COPY . /home/gradle/src WORKDIR /home/gradle/src -RUN ./gradlew --no-daemon -RUN ./gradlew micronaut-r2dbc:nativeBuild -x test --no-daemon +RUN ./gradlew micronaut-r2dbc:nativeCompile -x test --no-daemon -FROM frolvlad/alpine-glibc:glibc-2.34 -RUN apk --no-cache update && apk add libstdc++ +FROM cgr.dev/chainguard/wolfi-base:latest WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-r2dbc/build/native/nativeCompile/micronaut-r2dbc micronaut diff --git a/frameworks/Java/micronaut/micronaut-r2dbc.dockerfile b/frameworks/Java/micronaut/micronaut-r2dbc.dockerfile index cad08e08d3b..7bc182aa09c 100644 --- a/frameworks/Java/micronaut/micronaut-r2dbc.dockerfile +++ b/frameworks/Java/micronaut/micronaut-r2dbc.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-r2dbc:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-r2dbc/build/libs/micronaut-r2dbc-all.jar micronaut.jar COPY run_benchmark.sh run_benchmark.sh diff --git a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/AbstractVertxSqlClientRepository.java b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/AbstractVertxSqlClientRepository.java index 8f76190eaa4..26e993fe9e6 100644 --- a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/AbstractVertxSqlClientRepository.java +++ b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/AbstractVertxSqlClientRepository.java @@ -7,6 +7,7 @@ import io.vertx.sqlclient.RowSet; import io.vertx.sqlclient.SqlClient; import io.vertx.sqlclient.Tuple; +import jakarta.inject.Inject; import java.util.ArrayList; import java.util.List; @@ -15,23 +16,20 @@ public class AbstractVertxSqlClientRepository { - protected final Pool client; - - public AbstractVertxSqlClientRepository(Pool client) { - this.client = client; - } + @Inject + protected ConnectionHolder holder; protected CompletionStage execute(String sql) { - return client.preparedQuery(sql).execute().toCompletionStage(); + return holder.get().flatMap(conn->conn.preparedQuery(sql).execute()).toCompletionStage(); } protected CompletionStage executeAndCollectOne(String sql, Tuple tuple, Function mapper) { - return client.preparedQuery(sql).execute(tuple).map(rows -> mapper.apply(rows.iterator().next())) + return holder.get().flatMap(conn->conn.preparedQuery(sql).execute(tuple).map(rows -> mapper.apply(rows.iterator().next()))) .toCompletionStage(); } protected CompletionStage> executeAndCollectList(String sql, Function mapper) { - return client.preparedQuery(sql).execute().map(rows -> { + return holder.get().flatMap(conn->conn.preparedQuery(sql).execute()).map(rows -> { List result = new ArrayList<>(rows.size()); for (Row row : rows) { result.add(mapper.apply(row)); @@ -52,7 +50,7 @@ protected Future> executeMany(SqlClient sqlClient, String sql, List< } protected CompletionStage executeBatch(String sql, List data) { - return client.preparedQuery(sql).executeBatch(data).toCompletionStage(); + return holder.get().flatMap(conn->conn.preparedQuery(sql).executeBatch(data)).toCompletionStage(); } } diff --git a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/ConnectionHolder.java b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/ConnectionHolder.java new file mode 100644 index 00000000000..d471adc91c3 --- /dev/null +++ b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/ConnectionHolder.java @@ -0,0 +1,140 @@ +package benchmark; + +import io.micronaut.context.annotation.Property; +import io.netty.bootstrap.Bootstrap; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFactory; +import io.netty.channel.EventLoop; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.ServerChannel; +import io.netty.channel.socket.DatagramChannel; +import io.netty.channel.socket.InternetProtocolFamily; +import io.netty.util.concurrent.FastThreadLocal; +import io.netty.util.internal.ThreadExecutorMap; +import io.vertx.core.Future; +import io.vertx.core.Vertx; +import io.vertx.core.datagram.DatagramSocketOptions; +import io.vertx.core.impl.VertxBuilder; +import io.vertx.core.net.ClientOptionsBase; +import io.vertx.core.net.NetServerOptions; +import io.vertx.core.spi.transport.Transport; +import io.vertx.pgclient.PgConnectOptions; +import io.vertx.pgclient.PgConnection; +import io.vertx.sqlclient.PoolOptions; +import jakarta.inject.Singleton; + +import java.net.SocketAddress; +import java.util.concurrent.ThreadFactory; + +@Singleton +public class ConnectionHolder { + private final FastThreadLocal> conn = new FastThreadLocal<>(); + + @Property(name = "datasources.default.url") String url; + @Property(name = "datasources.default.username") String user; + @Property(name = "datasources.default.password") String password; + @Property(name = "datasources.default.maximum-pool-size") int maxPoolSize; + + public Future get() { + Future c = conn.get(); + if (c == null) { + + PgConnectOptions connectOptions = PgConnectOptions.fromUri(url.substring(5)) + .setUser(user) + .setPassword(password) + .setCachePreparedStatements(true) + .setTcpNoDelay(true) + .setTcpQuickAck(true) + .setPipeliningLimit(1024); + PoolOptions poolOptions = new PoolOptions(); + poolOptions.setMaxSize(maxPoolSize); + + VertxBuilder builder = new VertxBuilder() + .init(); + + EventLoop loop = (EventLoop) ThreadExecutorMap.currentExecutor(); + + Vertx vertx = builder + .findTransport(new ExistingTransport(builder.findTransport(), loop)) + .vertx(); + + c = PgConnection.connect(vertx, connectOptions); + conn.set(c); + } + return c; + } + + private record ExistingTransport(Transport transport, EventLoop loop) implements Transport { + + @Override + public boolean supportsDomainSockets() { + return transport.supportsDomainSockets(); + } + + @Override + public boolean supportFileRegion() { + return transport.supportFileRegion(); + } + + @Override + public boolean isAvailable() { + return transport.isAvailable(); + } + + @Override + public Throwable unavailabilityCause() { + return transport.unavailabilityCause(); + } + + @Override + public SocketAddress convert(io.vertx.core.net.SocketAddress address) { + return transport.convert(address); + } + + @Override + public io.vertx.core.net.SocketAddress convert(SocketAddress address) { + return transport.convert(address); + } + + @Override + public EventLoopGroup eventLoopGroup(int type, int nThreads, ThreadFactory threadFactory, int ignoredIoRatio) { + return loop; + } + + @Override + public DatagramChannel datagramChannel() { + return transport.datagramChannel(); + } + + @Override + public DatagramChannel datagramChannel(InternetProtocolFamily family) { + return transport.datagramChannel(family); + } + + @Override + public ChannelFactory channelFactory(boolean domainSocket) { + return transport.channelFactory(domainSocket); + } + + @Override + public ChannelFactory serverChannelFactory(boolean domainSocket) { + return transport.serverChannelFactory(domainSocket); + } + + @Override + public void configure(DatagramChannel channel, DatagramSocketOptions options) { + transport.configure(channel, options); + } + + @Override + public void configure(ClientOptionsBase options, boolean domainSocket, Bootstrap bootstrap) { + transport.configure(options, domainSocket, bootstrap); + } + + @Override + public void configure(NetServerOptions options, boolean domainSocket, ServerBootstrap bootstrap) { + transport.configure(options, domainSocket, bootstrap); + } + } +} diff --git a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/PgClientFactory.java b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/PgClientFactory.java deleted file mode 100644 index 3b10b483c42..00000000000 --- a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/PgClientFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2017-2020 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package benchmark; - -import io.micronaut.context.annotation.Bean; -import io.micronaut.context.annotation.Factory; -import io.micronaut.context.annotation.Property; -import io.vertx.core.Vertx; -import io.vertx.core.VertxOptions; -import io.vertx.core.impl.VertxBuilder; -import io.vertx.pgclient.PgConnectOptions; -import io.vertx.pgclient.PgPool; -import io.vertx.sqlclient.PoolOptions; -import jakarta.inject.Singleton; - -/** - * The Factory for creating Vertx PG client. - */ -@Factory -public class PgClientFactory { - - @Singleton - @Bean(preDestroy = "close") - public PgPool client(@Property(name = "datasources.default.url") String url, - @Property(name = "datasources.default.username") String user, - @Property(name = "datasources.default.password") String password, - @Property(name = "datasources.default.maximum-pool-size") int maxPoolSize) { - - VertxOptions vertxOptions = new VertxOptions() - .setPreferNativeTransport(true); - - PgConnectOptions connectOptions = PgConnectOptions.fromUri(url.substring(5)) - .setUser(user) - .setPassword(password) - .setCachePreparedStatements(true) - .setTcpNoDelay(true) - .setTcpQuickAck(true) - .setPipeliningLimit(1024); - PoolOptions poolOptions = new PoolOptions(); - poolOptions.setMaxSize(maxPoolSize); - - Vertx vertx = new VertxBuilder(vertxOptions).init().vertx(); - return PgPool.pool(vertx, connectOptions, poolOptions); - } -} diff --git a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgFortuneRepository.java b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgFortuneRepository.java index 3515f9fc118..1c25569cd0f 100644 --- a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgFortuneRepository.java +++ b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgFortuneRepository.java @@ -2,7 +2,6 @@ import benchmark.model.Fortune; import benchmark.repository.AsyncFortuneRepository; -import io.vertx.sqlclient.Pool; import io.vertx.sqlclient.Tuple; import jakarta.inject.Singleton; @@ -14,10 +13,6 @@ @Singleton public class VertxPgFortuneRepository extends AbstractVertxSqlClientRepository implements AsyncFortuneRepository { - public VertxPgFortuneRepository(Pool client) { - super(client); - } - private CompletionStage createTable() { return execute("DROP TABLE IF EXISTS Fortune;") .thenCompose(ignore -> execute("CREATE TABLE Fortune (id INTEGER NOT NULL,message VARCHAR(255) NOT NULL);")); diff --git a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgWorldRepository.java b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgWorldRepository.java index c584b69d095..b1929d8833c 100644 --- a/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgWorldRepository.java +++ b/frameworks/Java/micronaut/micronaut-vertx-pg-client/src/main/java/benchmark/VertxPgWorldRepository.java @@ -2,7 +2,6 @@ import benchmark.model.World; import benchmark.repository.AsyncWorldRepository; -import io.vertx.sqlclient.Pool; import io.vertx.sqlclient.Row; import io.vertx.sqlclient.Tuple; import jakarta.inject.Singleton; @@ -19,10 +18,6 @@ public class VertxPgWorldRepository extends AbstractVertxSqlClientRepository imp private static final Function ROW_TO_WORLD_MAPPER = row -> new World(row.getInteger(0), row.getInteger(1)); - public VertxPgWorldRepository(Pool client) { - super(client); - } - private CompletionStage createTable() { return execute("DROP TABLE IF EXISTS World;").thenCompose(ignore -> execute("CREATE TABLE World (id INTEGER NOT NULL,randomNumber INTEGER NOT NULL);")); } @@ -44,7 +39,7 @@ public CompletionStage> findByIds(List ids) { for (Integer id : ids) { data.add(Tuple.of(id)); } - return client.withConnection(sqlConnection -> + return holder.get().flatMap(sqlConnection -> executeMany(sqlConnection, "SELECT * FROM world WHERE id = $1", data, ROW_TO_WORLD_MAPPER)) .toCompletionStage(); } diff --git a/frameworks/Java/micronaut/micronaut.dockerfile b/frameworks/Java/micronaut/micronaut.dockerfile index 72376d86588..ce7ff654f4b 100644 --- a/frameworks/Java/micronaut/micronaut.dockerfile +++ b/frameworks/Java/micronaut/micronaut.dockerfile @@ -1,9 +1,9 @@ -FROM gradle:8.1.0-jdk17 as build +FROM gradle:8.7.0-jdk21 as build COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle micronaut-vertx-pg-client:build -x test --no-daemon -FROM openjdk:21 +FROM openjdk:22 WORKDIR /micronaut COPY --from=build /home/gradle/src/micronaut-vertx-pg-client/build/libs/micronaut-vertx-pg-client-all.jar micronaut.jar COPY run_benchmark.sh run_benchmark.sh diff --git a/frameworks/Java/micronaut/run_benchmark.sh b/frameworks/Java/micronaut/run_benchmark.sh index 4f8fccf3ba4..40e9572de48 100755 --- a/frameworks/Java/micronaut/run_benchmark.sh +++ b/frameworks/Java/micronaut/run_benchmark.sh @@ -3,7 +3,6 @@ JAVA_OPTIONS="-server \ -XX:+UseParallelGC \ -XX:+UseNUMA \ - -XX:+UseStringDeduplication \ -XX:-StackTraceInThrowable \ -Dio.netty.buffer.checkBounds=false \ -Dio.netty.buffer.checkAccessible=false \ diff --git a/frameworks/Java/quarkus/pom.xml b/frameworks/Java/quarkus/pom.xml index 0739e3171f7..3782b479cb3 100644 --- a/frameworks/Java/quarkus/pom.xml +++ b/frameworks/Java/quarkus/pom.xml @@ -14,14 +14,11 @@ UTF-8 quarkus-bom io.quarkus - 3.2.0.Final + 3.9.4 true 3.0.0 - 0.0.21.Final - 4.4.4 + 0.0.25.Final 1.3.0 - 6.2.6.Final - 2.0.2.Final @@ -42,17 +39,10 @@ org.hibernate.orm hibernate-core - ${hibernate-orm.version} org.hibernate.reactive hibernate-reactive-core - ${hibernate-reactive.version} - - - io.vertx - vertx-core - ${vertx.version} ${quarkus.platform.group-id} @@ -151,7 +141,6 @@ io.vertx vertx-io_uring-incubator - ${vertx.version} io.netty.incubator diff --git a/frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/pom.xml b/frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/pom.xml index c036d06258d..8948c5ffb06 100644 --- a/frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/pom.xml +++ b/frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/pom.xml @@ -30,11 +30,11 @@ io.quarkus - quarkus-resteasy-reactive + quarkus-rest io.quarkus - quarkus-resteasy-reactive-jackson + quarkus-rest-jackson io.vertx diff --git a/frameworks/Java/quarkus/resteasy-reactive-hibernate/pom.xml b/frameworks/Java/quarkus/resteasy-reactive-hibernate/pom.xml index 3f75ad69d45..5cd634dbea5 100644 --- a/frameworks/Java/quarkus/resteasy-reactive-hibernate/pom.xml +++ b/frameworks/Java/quarkus/resteasy-reactive-hibernate/pom.xml @@ -26,11 +26,11 @@ io.quarkus - quarkus-resteasy-reactive + quarkus-rest io.quarkus - quarkus-resteasy-reactive-jackson + quarkus-rest-jackson io.quarkus diff --git a/frameworks/Java/quarkus/vertx/pom.xml b/frameworks/Java/quarkus/vertx/pom.xml index e751ed6aa51..1414a21df4a 100644 --- a/frameworks/Java/quarkus/vertx/pom.xml +++ b/frameworks/Java/quarkus/vertx/pom.xml @@ -23,7 +23,6 @@ io.vertx vertx-pg-client - ${vertx.version} io.quarkus diff --git a/frameworks/Java/smart-socket/pom.xml b/frameworks/Java/smart-socket/pom.xml index b95e7d71c52..376f82878f7 100644 --- a/frameworks/Java/smart-socket/pom.xml +++ b/frameworks/Java/smart-socket/pom.xml @@ -11,7 +11,7 @@ 17 17 2.17.1 - 0.6-SNAPSHOT + 1.0-SNAPSHOT 5.0.0 0.9.23 diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java index b20525ec571..5c46d0ca5ef 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java @@ -4,9 +4,9 @@ import com.jsoniter.output.JsonStreamPool; import com.jsoniter.spi.JsonException; import com.jsoniter.spi.Slice; -import jakarta.servlet.http.HttpServletResponse; import org.smartboot.http.server.HttpResponse; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/HelloWorldServlet.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/HelloWorldServlet.java index c3900de716c..6ac97cc7606 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/HelloWorldServlet.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/HelloWorldServlet.java @@ -1,10 +1,10 @@ package org.smartboot.servlet; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/JsonServlet.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/JsonServlet.java index 064bc80556d..e484da19fc3 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/JsonServlet.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/JsonServlet.java @@ -1,12 +1,12 @@ package org.smartboot.servlet; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import org.smartboot.Message; import org.smartboot.http.JsonUtil; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/frameworks/Java/today/.gitignore b/frameworks/Java/today/.gitignore new file mode 100644 index 00000000000..ea1cbb085ef --- /dev/null +++ b/frameworks/Java/today/.gitignore @@ -0,0 +1,9 @@ +# Ignore Gradle project-specific cache directory +.gradle + +# Ignore Gradle build output directory +build + +.idea +today.properties +gradle \ No newline at end of file diff --git a/frameworks/Java/today/README.md b/frameworks/Java/today/README.md new file mode 100644 index 00000000000..a7c42243f25 --- /dev/null +++ b/frameworks/Java/today/README.md @@ -0,0 +1,26 @@ +# [TODAY Infrastructure](https://github.com/TAKETODAY/today-infrastructure) Benchmarking Test + +## Test URLs +### JSON + +http://localhost:8080/json + +### PLAINTEXT + +http://localhost:8080/plaintext + +### DB + +http://localhost:8080/db + +### QUERY + +http://localhost:8080/queries?queries= + +### UPDATE + +http://localhost:8080/update?queries= + +### FORTUNES + +http://localhost:8080/fortunes diff --git a/frameworks/Java/today/benchmark_config.json b/frameworks/Java/today/benchmark_config.json new file mode 100755 index 00000000000..92c3c756ad1 --- /dev/null +++ b/frameworks/Java/today/benchmark_config.json @@ -0,0 +1,30 @@ +{ + "framework": "today", + "tests": [ + { + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "query_url": "/queries?queries=", + "fortune_url": "/fortunes", + "update_url": "/updates?queries=", + "port": 8080, + "approach": "Realistic", + "classification": "Fullstack", + "database": "mysql", + "framework": "Today", + "language": "Java", + "flavor": "None", + "orm": "micro", + "platform": "Netty", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "Today", + "notes": "", + "versus": "None" + } + } + ] +} diff --git a/frameworks/Java/today/build.gradle b/frameworks/Java/today/build.gradle new file mode 100644 index 00000000000..a95a1982f4e --- /dev/null +++ b/frameworks/Java/today/build.gradle @@ -0,0 +1,63 @@ +description = "benchmark" + +apply plugin: "java" +apply plugin: "application" +apply plugin: 'cn.taketoday.application' +apply plugin: 'io.spring.dependency-management' + +configure(allprojects) { + group = "cn.taketoday.benchmark" + + repositories { + mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + } +} + +dependencies { + implementation 'cn.taketoday:today-starter-netty' + implementation 'cn.taketoday:today-starter-json' + implementation 'cn.taketoday:today-starter-jdbc' + implementation 'cn.taketoday:today-starter-web' + implementation 'cn.taketoday:today-starter-freemarker' + + implementation 'mysql:mysql-connector-java' + + implementation 'ch.qos.logback:logback-classic' + + implementation('io.netty:netty-transport-native-epoll') { + artifact { + classifier = 'linux-x86_64' + } + } + +// implementation('io.netty:netty-transport-native-kqueue') { +// artifact { +// classifier = 'osx-aarch_64' +// } +// } + +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +application { + mainClass = 'cn.taketoday.benchmark.BenchmarkApplication' + applicationDefaultJvmArgs = [ + "-server", + "-XX:+UseNUMA", + "-XX:+UseG1GC", + "-XX:+DisableExplicitGC", + "-XX:-StackTraceInThrowable", + "-XX:+UseStringDeduplication", + "-Dinfra.profiles.active=test", + "-Dio.netty.buffer.checkBounds=false", + "-Dio.netty.buffer.checkAccessible=false", + "-Dio.netty.leakDetection.level=disabled", + "--add-opens=java.base/java.nio=ALL-UNNAMED", + "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED" + ] +} diff --git a/frameworks/Java/today/config.toml b/frameworks/Java/today/config.toml new file mode 100644 index 00000000000..dc2e84c877d --- /dev/null +++ b/frameworks/Java/today/config.toml @@ -0,0 +1,20 @@ +[framework] +name = "today" + +[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 = "mysql" +database_os = "Linux" +display_name = "today" +os = "Linux" +orm = "raw" +platform = "Netty" +webserver = "None" +versus = "None" diff --git a/frameworks/Java/today/gradle.properties b/frameworks/Java/today/gradle.properties new file mode 100644 index 00000000000..9379f1c95c9 --- /dev/null +++ b/frameworks/Java/today/gradle.properties @@ -0,0 +1,7 @@ +version=1.0.0 +#infraVersion=4.0.0-Draft.6-SNAPSHOT +infraVersion=4.0.0-Draft.6 + +org.gradle.caching=true +org.gradle.jvmargs=-Xmx2048m +org.gradle.parallel=true diff --git a/frameworks/Java/today/settings.gradle b/frameworks/Java/today/settings.gradle new file mode 100644 index 00000000000..8cb2bee3734 --- /dev/null +++ b/frameworks/Java/today/settings.gradle @@ -0,0 +1,15 @@ +buildscript { + repositories { + mavenLocal() + maven { + url "https://oss.sonatype.org/content/repositories/snapshots/" + } + mavenCentral() + } + + dependencies { + classpath "cn.taketoday:infra-gradle-plugin:$infraVersion" + } +} + +rootProject.name = 'today' diff --git a/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/AppConfig.java b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/AppConfig.java new file mode 100644 index 00000000000..1d385a77133 --- /dev/null +++ b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/AppConfig.java @@ -0,0 +1,70 @@ +package cn.taketoday.benchmark; + +import java.time.ZonedDateTime; + +import javax.sql.DataSource; + +import cn.taketoday.beans.factory.annotation.DisableAllDependencyInjection; +import cn.taketoday.beans.factory.config.BeanDefinition; +import cn.taketoday.context.annotation.Configuration; +import cn.taketoday.context.annotation.Role; +import cn.taketoday.framework.web.netty.NettyRequestConfig; +import cn.taketoday.framework.web.netty.SendErrorHandler; +import cn.taketoday.jdbc.RepositoryManager; +import cn.taketoday.jdbc.persistence.EntityManager; +import cn.taketoday.stereotype.Component; +import io.netty.handler.codec.http.DefaultHttpHeadersFactory; +import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpHeadersFactory; +import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory; + +import static cn.taketoday.http.HttpHeaders.DATE_FORMATTER; + +/** + * @author Harry Yang + * @since 1.0 2024/3/19 12:59 + */ +@DisableAllDependencyInjection +@Role(BeanDefinition.ROLE_INFRASTRUCTURE) +@Configuration(proxyBeanMethods = false) +class AppConfig { + + private static final DefaultHttpHeadersFactory headersFactory = DefaultHttpHeadersFactory.headersFactory(); + + @Component + static RepositoryManager repositoryManager(DataSource dataSource) { + return new RepositoryManager(dataSource); + } + + @Component + static EntityManager entityManager(RepositoryManager repositoryManager) { + return repositoryManager.getEntityManager(); + } + + @Component + @Role(BeanDefinition.ROLE_INFRASTRUCTURE) + static NettyRequestConfig nettyRequestConfig(SendErrorHandler sendErrorHandler) { + var factory = new DefaultHttpDataFactory(false); + return NettyRequestConfig.forBuilder() + .httpDataFactory(factory) + .sendErrorHandler(sendErrorHandler) + .headersFactory(new HttpHeadersFactory() { + + @Override + public HttpHeaders newHeaders() { + HttpHeaders headers = headersFactory.newHeaders(); + headers.set("Server", "TODAY"); + headers.set("Date", DATE_FORMATTER.format(ZonedDateTime.now())); + return headers; + } + + @Override + public HttpHeaders newEmptyHeaders() { + return headersFactory.newEmptyHeaders(); + } + }) + .secure(false) + .build(); + } + +} diff --git a/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/BenchmarkApplication.java b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/BenchmarkApplication.java new file mode 100644 index 00000000000..0e2eea0f995 --- /dev/null +++ b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/BenchmarkApplication.java @@ -0,0 +1,13 @@ +package cn.taketoday.benchmark; + +import cn.taketoday.framework.Application; +import cn.taketoday.framework.InfraApplication; + +@InfraApplication +public class BenchmarkApplication { + + public static void main(String[] args) { + Application.run(BenchmarkApplication.class, args); + } + +} diff --git a/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/http/BenchmarkHttpHandler.java b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/http/BenchmarkHttpHandler.java new file mode 100644 index 00000000000..d0d240534bd --- /dev/null +++ b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/http/BenchmarkHttpHandler.java @@ -0,0 +1,120 @@ +package cn.taketoday.benchmark.http; + +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ThreadLocalRandom; +import java.util.stream.IntStream; + +import cn.taketoday.benchmark.model.Fortune; +import cn.taketoday.benchmark.model.World; +import cn.taketoday.http.MediaType; +import cn.taketoday.http.ResponseEntity; +import cn.taketoday.jdbc.persistence.EntityManager; +import cn.taketoday.lang.Nullable; +import cn.taketoday.ui.Model; +import cn.taketoday.web.annotation.GET; +import cn.taketoday.web.annotation.RestController; +import cn.taketoday.web.view.ViewRef; + +/** + * @author Harry Yang + * @since 1.0 2024/3/19 12:56 + */ +@RestController +final class BenchmarkHttpHandler { + + private static final int MIN_WORLD_NUMBER = 1; + private static final int MAX_WORLD_NUMBER = 10_000; + + private final EntityManager entityManager; + + BenchmarkHttpHandler(EntityManager entityManager) { + this.entityManager = entityManager; + } + + @GET("/json") + public ResponseEntity> json() { + return ResponseEntity.ok() + .contentType(MediaType.APPLICATION_JSON) + .body(Map.of("message", "Hello, World!")); + } + + @GET("/plaintext") + public String plaintext() { + return "Hello, World!"; + } + + @GET("/db") + public World db() { + return entityManager.findById(World.class, nextInt()); + } + + @GET("/queries") + public List queries(@Nullable String queries) { + return randomNumbers() + .mapToObj(this::findWorldById) + .limit(parseQueryCount(queries)) + .toList(); + } + + @GET("/updates") + public List updates(@Nullable String queries) { + return randomNumbers() + .mapToObj(this::findWorldById) + .filter(Objects::nonNull) + .peek(world -> { + world.setRandomNumber(nextInt()); + entityManager.updateById(world); + }) + .limit(parseQueryCount(queries)) + .toList(); + } + + @GET("/fortunes") + public ViewRef fortunes(Model model) { + List fortunes = entityManager.find(Fortune.class); + fortunes.add(new Fortune(0, "Additional fortune added at request time.")); + fortunes.sort(Comparator.comparing(Fortune::getMessage)); + + model.addAttribute("fortunes", fortunes); + return ViewRef.forViewName("fortunes"); + } + + @Nullable + private World findWorldById(int id) { + return entityManager.findById(World.class, boxed[id]); + } + + // + + private static IntStream randomNumbers() { + return ThreadLocalRandom.current() + .ints(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER) + .distinct(); + } + + private static final Integer[] boxed = IntStream.range(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER + 1) + .boxed() + .toArray(Integer[]::new); + + private static Integer nextInt() { + return boxed[ThreadLocalRandom.current().nextInt(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER)]; + } + + private static int parseQueryCount(@Nullable String textValue) { + if (textValue == null) { + return 1; + } + int parsedValue; + try { + parsedValue = Integer.parseInt(textValue); + } + catch (NumberFormatException e) { + return 1; + } + return Math.min(500, Math.max(1, parsedValue)); + } + +} diff --git a/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/Fortune.java b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/Fortune.java new file mode 100644 index 00000000000..a261c1434bd --- /dev/null +++ b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/Fortune.java @@ -0,0 +1,54 @@ +package cn.taketoday.benchmark.model; + +import java.util.Objects; + +import cn.taketoday.jdbc.persistence.Id; +import cn.taketoday.jdbc.persistence.Table; + +@Table("fortune") +public class Fortune { + + @Id + private Integer id; + + private String message; + + public Fortune() { } + + public Fortune(Integer id, String message) { + this.id = id; + this.message = message; + } + + public void setId(Integer id) { + this.id = id; + } + + public void setMessage(String message) { + this.message = message; + } + + public Integer getId() { + return id; + } + + public String getMessage() { + return message; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof Fortune fortune)) + return false; + return Objects.equals(id, fortune.id) + && Objects.equals(message, fortune.message); + } + + @Override + public int hashCode() { + return Objects.hash(id, message); + } + +} diff --git a/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/World.java b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/World.java new file mode 100644 index 00000000000..04c60c8445f --- /dev/null +++ b/frameworks/Java/today/src/main/java/cn/taketoday/benchmark/model/World.java @@ -0,0 +1,55 @@ +package cn.taketoday.benchmark.model; + +import java.util.Objects; + +import cn.taketoday.jdbc.persistence.Column; +import cn.taketoday.jdbc.persistence.Id; +import cn.taketoday.jdbc.persistence.Table; + +@Table("world") +public class World { + + @Id + private Integer id; + + @Column("randomNumber") + private Integer randomNumber; + + public World() { } + + public World(Integer id, Integer randomNumber) { + this.id = id; + this.randomNumber = randomNumber; + } + + public Integer getId() { + return id; + } + + public Integer getRandomNumber() { + return randomNumber; + } + + public void setId(Integer id) { + this.id = id; + } + + public void setRandomNumber(Integer randomNumber) { + this.randomNumber = randomNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof World world)) + return false; + return Objects.equals(id, world.id) + && Objects.equals(randomNumber, world.randomNumber); + } + + @Override + public int hashCode() { + return Objects.hash(id, randomNumber); + } +} diff --git a/frameworks/Java/today/src/main/resources/application-dev.yaml b/frameworks/Java/today/src/main/resources/application-dev.yaml new file mode 100644 index 00000000000..07dbdf12fbc --- /dev/null +++ b/frameworks/Java/today/src/main/resources/application-dev.yaml @@ -0,0 +1,9 @@ +datasource: + url: jdbc:mysql://localhost:3306/hello_world?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + username: root + password: 88888888 + +logging: + level: + root: info + sql: debug \ No newline at end of file diff --git a/frameworks/Java/today/src/main/resources/application-test.yaml b/frameworks/Java/today/src/main/resources/application-test.yaml new file mode 100644 index 00000000000..e901f8a0476 --- /dev/null +++ b/frameworks/Java/today/src/main/resources/application-test.yaml @@ -0,0 +1,14 @@ +datasource: + url: jdbc:mysql://tfb-database:3306/hello_world?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + username: benchmarkdbuser + password: benchmarkdbpass + +logging: + level: + root: info + +server: + netty: + acceptor-threads: 4 + worker-threads: 8 + max-connection: 65535 \ No newline at end of file diff --git a/frameworks/Java/today/src/main/resources/application.yaml b/frameworks/Java/today/src/main/resources/application.yaml new file mode 100644 index 00000000000..650df4454a5 --- /dev/null +++ b/frameworks/Java/today/src/main/resources/application.yaml @@ -0,0 +1,41 @@ +app: + name: benchmark-app + +server: + port: 8080 + +infra: + output: + ansi: + enabled: always + +freemarker: + cache: true + settings: + classic_compatible: true + date_format: yyyy-MM-dd + datetime_format: yyyy-MM-dd HH:mm:ss + default_encoding: UTF-8 + locale: UTF-8 + log_template_exceptions: false + number_format: 0.#### + tag_syntax: auto_detect + template_exception_handler: ignore + template_update_delay: 0 + time_format: HH:mm:ss + url_escaping_charset: UTF-8 + +datasource: + name: 'app-datasource' + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + hikari: + maximum-pool-size: 20 + max-lifetime: 120000 + connection-test-query: 'select 1' + +logging: + level: + root: OFF + pattern: + dateformat: 'yyyy-MM-dd HH:mm:ss.SSS' \ No newline at end of file diff --git a/frameworks/Java/today/src/main/resources/templates/fortunes.ftl b/frameworks/Java/today/src/main/resources/templates/fortunes.ftl new file mode 100644 index 00000000000..0ad737e5dcc --- /dev/null +++ b/frameworks/Java/today/src/main/resources/templates/fortunes.ftl @@ -0,0 +1,21 @@ +<#-- @ftlvariable name="fortunes" type="cn.taketoday.benchmark.model.Fortune[]" --> + + + + Fortunes + + + + + + + + <#list fortunes as fortune> + + + + + +
idmessage
#{fortune.id}${fortune.message?html}
+ + \ No newline at end of file diff --git a/frameworks/Java/today/today.dockerfile b/frameworks/Java/today/today.dockerfile new file mode 100644 index 00000000000..b063749f6b1 --- /dev/null +++ b/frameworks/Java/today/today.dockerfile @@ -0,0 +1,11 @@ +FROM gradle:8.6.0-jdk17 as build +COPY --chown=gradle:gradle . /home/gradle/src +WORKDIR /home/gradle/src +RUN gradle installInfraDist --no-daemon + +FROM openjdk:21 +WORKDIR /today +COPY --from=build /home/gradle/src/build/install/today-infra-app/ ./ + +EXPOSE 8080 +ENTRYPOINT "./bin/today" diff --git a/frameworks/Java/undertow-jersey/pom.xml b/frameworks/Java/undertow-jersey/pom.xml index 2a11ad2b658..5be3dd82456 100644 --- a/frameworks/Java/undertow-jersey/pom.xml +++ b/frameworks/Java/undertow-jersey/pom.xml @@ -174,7 +174,7 @@ io.undertow undertow-core - 2.3.5.Final + 2.3.12.Final diff --git a/frameworks/Java/undertow/pom.xml b/frameworks/Java/undertow/pom.xml index 5ff7009c963..1a0f95afd69 100644 --- a/frameworks/Java/undertow/pom.xml +++ b/frameworks/Java/undertow/pom.xml @@ -20,7 +20,7 @@ 3.2.2 0.9.10 42.7.2 - 2.3.5.Final + 2.3.12.Final diff --git a/frameworks/JavaScript/express/express-mongodb.dockerfile b/frameworks/JavaScript/express/express-mongodb.dockerfile index 6eea6502e96..b9f22ed1162 100644 --- a/frameworks/JavaScript/express/express-mongodb.dockerfile +++ b/frameworks/JavaScript/express/express-mongodb.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ diff --git a/frameworks/JavaScript/express/express-mysql.dockerfile b/frameworks/JavaScript/express/express-mysql.dockerfile index c0c727e57f2..c34740fb009 100644 --- a/frameworks/JavaScript/express/express-mysql.dockerfile +++ b/frameworks/JavaScript/express/express-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ diff --git a/frameworks/JavaScript/express/express-postgres.dockerfile b/frameworks/JavaScript/express/express-postgres.dockerfile index 3450df4395e..7f6367401fc 100644 --- a/frameworks/JavaScript/express/express-postgres.dockerfile +++ b/frameworks/JavaScript/express/express-postgres.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ diff --git a/frameworks/JavaScript/express/express.dockerfile b/frameworks/JavaScript/express/express.dockerfile index 6e463a2efd6..c78d8648283 100644 --- a/frameworks/JavaScript/express/express.dockerfile +++ b/frameworks/JavaScript/express/express.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ diff --git a/frameworks/JavaScript/express/mongodb-app.js b/frameworks/JavaScript/express/mongodb-app.js index ad8bb0bfac4..534fddc63f5 100644 --- a/frameworks/JavaScript/express/mongodb-app.js +++ b/frameworks/JavaScript/express/mongodb-app.js @@ -6,11 +6,7 @@ const cluster = require('cluster'); const numCPUs = require('os').cpus().length; const express = require('express'); const mongoose = require('mongoose'); -const connection = mongoose.createConnection('mongodb://tfb-database/hello_world',{ - useNewUrlParser: true, - useUnifiedTopology: true, - useFindAndModify: false, -}); +const connection = mongoose.createConnection('mongodb://tfb-database/hello_world'); // Middleware const bodyParser = require('body-parser'); diff --git a/frameworks/JavaScript/express/package.json b/frameworks/JavaScript/express/package.json index 60c1f6a6b32..32ea58ae528 100644 --- a/frameworks/JavaScript/express/package.json +++ b/frameworks/JavaScript/express/package.json @@ -7,11 +7,11 @@ "dateformat": "3.0.3", "escape-html": "1.0.3", "express": "4.18.2", - "mongoose": "5.13.20", - "mysql2": "2.2.5", + "mongoose": "8.3.2", + "mysql2": "3.9.8", "pg": "8.5.0", "pg-promise": "10.7.3", - "pug": "2.0.1", + "pug": "3.0.3", "postgres": "^3.4.3", "slow-json-stringify": "^2.0.1", "sequelize": "6.29.0" diff --git a/frameworks/JavaScript/fastify/db/mongo.js b/frameworks/JavaScript/fastify/db/mongo.js index ca4200ad550..666dd49d412 100644 --- a/frameworks/JavaScript/fastify/db/mongo.js +++ b/frameworks/JavaScript/fastify/db/mongo.js @@ -7,13 +7,7 @@ let client; async function getCollection(name) { if (!client) { - client = await new MongoClient( - mongoUrl, - { - useNewUrlParser: true, - useUnifiedTopology: true - } - ).connect(); + client = await new MongoClient(mongoUrl).connect(); } const db = client.db(dbName); diff --git a/frameworks/JavaScript/fastify/fastify-mysql.dockerfile b/frameworks/JavaScript/fastify/fastify-mysql.dockerfile index dce82ff1a90..a77917aceb0 100644 --- a/frameworks/JavaScript/fastify/fastify-mysql.dockerfile +++ b/frameworks/JavaScript/fastify/fastify-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-alpine +FROM node:20.12.2-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/fastify-postgres.dockerfile b/frameworks/JavaScript/fastify/fastify-postgres.dockerfile index 65bf195566d..069b66c250a 100644 --- a/frameworks/JavaScript/fastify/fastify-postgres.dockerfile +++ b/frameworks/JavaScript/fastify/fastify-postgres.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-alpine +FROM node:20.12.2-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/fastify.dockerfile b/frameworks/JavaScript/fastify/fastify.dockerfile index fdd8dcf4946..48a7611a848 100644 --- a/frameworks/JavaScript/fastify/fastify.dockerfile +++ b/frameworks/JavaScript/fastify/fastify.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-alpine +FROM node:20.12.2-alpine COPY ./ ./ diff --git a/frameworks/JavaScript/fastify/package.json b/frameworks/JavaScript/fastify/package.json index e0740139501..c1a261a4328 100644 --- a/frameworks/JavaScript/fastify/package.json +++ b/frameworks/JavaScript/fastify/package.json @@ -9,8 +9,8 @@ "fastify": "4.13.0", "handlebars": "4.7.6", "knex": "2.4.2", - "mongodb": "3.5.9", - "mysql2": "2.2.5", + "mongodb": "6.5.0", + "mysql2": "3.9.7", "pg": "8.5.1" } } diff --git a/frameworks/JavaScript/hapi/package.json b/frameworks/JavaScript/hapi/package.json index 4aae630d9fa..5d6070a266a 100644 --- a/frameworks/JavaScript/hapi/package.json +++ b/frameworks/JavaScript/hapi/package.json @@ -10,7 +10,7 @@ "handlebars": "4.3.0", "mongoose": "5.13.20", "mysql": "2.16.0", - "mysql2": "1.6.5", + "mysql2": "3.9.7", "pg": "8.5.1", "pg-hstore": "2.3.2", "sequelize": "6.29.0" diff --git a/frameworks/JavaScript/hono/package-lock.json b/frameworks/JavaScript/hono/package-lock.json index 173cf4dc47e..ee69cbea0c1 100644 --- a/frameworks/JavaScript/hono/package-lock.json +++ b/frameworks/JavaScript/hono/package-lock.json @@ -9,23 +9,23 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@hono/node-server": "^1.4.1", + "@hono/node-server": "^1.10.1", "hono": "^3.10.4", "postgres": "^3.4.3" } }, "node_modules/@hono/node-server": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.4.1.tgz", - "integrity": "sha512-7jB8iMs6T2FhREs4Ugk+7rzn7d5aC6wEX3FAy67ZafzcQqqBVggcLkFPCMauaFJJyjc+bFvMOdFxJXKYsBM6MQ==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.10.1.tgz", + "integrity": "sha512-5BKW25JH5PQKPDkTcIgv3yNUPtOAbnnjFFgWvIxxAY/B/ZNeYjjWoAeDmqhIiCgOAJ3Tauuw+0G+VainhuZRYQ==", "engines": { "node": ">=18.14.1" } }, "node_modules/hono": { - "version": "3.11.7", - "resolved": "https://registry.npmjs.org/hono/-/hono-3.11.7.tgz", - "integrity": "sha512-TcfAq7IdipF+9coxnuzYlSSBXbm9mTyWjjagLCv/2ampboNcKJdi+XCK5G48mHQtpI5+9Rj3J4FfcGgw9vzIww==", + "version": "3.12.12", + "resolved": "https://registry.npmjs.org/hono/-/hono-3.12.12.tgz", + "integrity": "sha512-5IAMJOXfpA5nT+K0MNjClchzz0IhBHs2Szl7WFAhrFOsbtQsYmNynFyJRg/a3IPsmCfxcrf8txUGiNShXpK5Rg==", "engines": { "node": ">=16.0.0" } diff --git a/frameworks/JavaScript/hono/package.json b/frameworks/JavaScript/hono/package.json index 62b18bb58bf..39a6184c2c5 100644 --- a/frameworks/JavaScript/hono/package.json +++ b/frameworks/JavaScript/hono/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@hono/node-server": "^1.4.1", + "@hono/node-server": "^1.10.1", "hono": "^3.10.4", "postgres": "^3.4.3" }, diff --git a/frameworks/JavaScript/koa/package.json b/frameworks/JavaScript/koa/package.json index 2931b364147..2e0fb45a363 100644 --- a/frameworks/JavaScript/koa/package.json +++ b/frameworks/JavaScript/koa/package.json @@ -12,7 +12,7 @@ "koa-hbs": "1.0.0", "koa-router": "7.4.0", "mongoose": "5.13.20", - "mysql2": "1.5.3", + "mysql2": "3.9.7", "pg": "8.5.1", "pg-hstore": "2.3.2", "sequelize": "6.29.0" diff --git a/frameworks/JavaScript/nodejs/package.json b/frameworks/JavaScript/nodejs/package.json index 3c7a14550af..8af5fedae2b 100644 --- a/frameworks/JavaScript/nodejs/package.json +++ b/frameworks/JavaScript/nodejs/package.json @@ -8,7 +8,7 @@ "mongodb": "3.7.3", "mongoose": "5.13.20", "mysql": "2.16.0", - "mysql2": "1.6.5", + "mysql2": "3.9.7", "parseurl": "1.3.2", "pg": "8.5.0", "pg-hstore": "2.3.2", diff --git a/frameworks/JavaScript/sailsjs/package.json b/frameworks/JavaScript/sailsjs/package.json index 90e44e19f8e..9be38df56ad 100644 --- a/frameworks/JavaScript/sailsjs/package.json +++ b/frameworks/JavaScript/sailsjs/package.json @@ -7,10 +7,10 @@ "dependencies": { "async": "1.5.2", "bluebird": "3.4.1", - "ejs": "2.5.7", + "ejs": "3.1.10", "handlebars": "4.7.6", "mysql": "2.16.0", - "mysql2": "1.6.5", + "mysql2": "3.9.7", "pg": "6.0.5", "pg-hstore": "2.3.2", "rc": "1.1.6", diff --git a/frameworks/JavaScript/spliffy/package-lock.json b/frameworks/JavaScript/spliffy/package-lock.json index f0c6a55ff5b..db22f966f30 100644 --- a/frameworks/JavaScript/spliffy/package-lock.json +++ b/frameworks/JavaScript/spliffy/package-lock.json @@ -1073,9 +1073,9 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "denque": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", - "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" }, "etag": { "version": "1.8.1", @@ -1135,7 +1135,7 @@ "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" }, "isarray": { "version": "0.0.1", @@ -1152,17 +1152,14 @@ } }, "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==" }, "memory-pager": { "version": "1.5.0", @@ -1192,48 +1189,32 @@ } }, "mysql2": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.2.5.tgz", - "integrity": "sha512-XRqPNxcZTpmFdXbJqb+/CtYVLCx14x1RTeNMD4954L331APu75IC74GDqnZMEt1kwaXy6TySo55rF2F3YJS78g==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.9.7.tgz", + "integrity": "sha512-KnJT8vYRcNAZv73uf9zpXqNbvBG7DJrs+1nACsjZP1HMJ1TgXEy8wnNilXAn/5i57JizXKtrUtwDB7HxT9DDpw==", "requires": { - "denque": "^1.4.1", + "denque": "^2.1.0", "generate-function": "^2.3.1", - "iconv-lite": "^0.6.2", - "long": "^4.0.0", - "lru-cache": "^6.0.0", - "named-placeholders": "^1.1.2", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" - }, - "dependencies": { - "sqlstring": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.2.tgz", - "integrity": "sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg==" - } } }, "named-placeholders": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", - "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", "requires": { - "lru-cache": "^4.1.3" + "lru-cache": "^7.14.1" }, "dependencies": { "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" } } }, @@ -1377,11 +1358,6 @@ "xtend": "^4.0.0" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -1410,7 +1386,7 @@ "seq-queue": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=" + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" }, "smart-buffer": { "version": "4.2.0", @@ -1443,6 +1419,11 @@ "readable-stream": "^3.0.0" } }, + "sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" + }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -1503,11 +1484,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/frameworks/JavaScript/spliffy/package.json b/frameworks/JavaScript/spliffy/package.json index 0d1a3d5dbf3..bdb6b49aa45 100644 --- a/frameworks/JavaScript/spliffy/package.json +++ b/frameworks/JavaScript/spliffy/package.json @@ -6,7 +6,7 @@ "@srfnstack/spliffy": "0.6.1", "html-escaper": "3.0.3", "mongodb": "^4.17.0", - "mysql2": "^2.2.5", + "mysql2": "^3.9.7", "node-cache": "5.1.2", "pg": "8.6.0", "pg-native": "3.0.1" diff --git a/frameworks/JavaScript/uwebsockets.js/README.md b/frameworks/JavaScript/uwebsockets.js/README.md index e8f8ad1162a..73fc530d673 100644 --- a/frameworks/JavaScript/uwebsockets.js/README.md +++ b/frameworks/JavaScript/uwebsockets.js/README.md @@ -10,12 +10,14 @@ The tests were run with: - [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js/) - [postgres](https://github.com/porsager/postgres/) +- [mariadb](https://github.com/mariadb-corporation/mariadb-connector-nodejs/) ## Database There are individual handlers for each DB approach. The logic for each of them are found here: -- [PostgreSQL](database/postgres.js) +- [PostgreSQL](src/database/postgres.js) +- [MySQL](src/database/mysql.js) There are **no database endpoints** or drivers attached by default. @@ -23,6 +25,7 @@ To initialize the application with one of these, run any _one_ of the following ```sh $ DATABASE=postgres npm start +$ DATABASE=mysql npm start ``` ## Test Endpoints diff --git a/frameworks/JavaScript/uwebsockets.js/benchmark_config.json b/frameworks/JavaScript/uwebsockets.js/benchmark_config.json index 9c45b755447..c19862c849e 100644 --- a/frameworks/JavaScript/uwebsockets.js/benchmark_config.json +++ b/frameworks/JavaScript/uwebsockets.js/benchmark_config.json @@ -41,6 +41,27 @@ "update_url": "/updates?queries=", "versus": "nodejs", "webserver": "None" + }, + "mysql": { + "approach": "Realistic", + "classification": "Platform", + "database": "MySQL", + "database_os": "Linux", + "db_url": "/db", + "display_name": "uWebSockets.js", + "flavor": "NodeJS", + "fortune_url": "/fortunes", + "framework": "uWebSockets.js", + "language": "JavaScript", + "notes": "", + "orm": "Raw", + "os": "Linux", + "platform": "None", + "port": 8080, + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "versus": "nodejs", + "webserver": "None" } } ] diff --git a/frameworks/JavaScript/uwebsockets.js/package-lock.json b/frameworks/JavaScript/uwebsockets.js/package-lock.json index 6e9b94da9da..275f2f63b2e 100644 --- a/frameworks/JavaScript/uwebsockets.js/package-lock.json +++ b/frameworks/JavaScript/uwebsockets.js/package-lock.json @@ -9,25 +9,94 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "postgres": "^3.4.0", + "mariadb": "^3.3.0", + "postgres": "^3.4.4", "slow-json-stringify": "^2.0.1", - "uWebSockets.js": "uNetworking/uWebSockets.js#v20.32.0" + "uWebSockets.js": "uNetworking/uWebSockets.js#v20.43.0" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + }, + "node_modules/@types/node": { + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/mariadb": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/mariadb/-/mariadb-3.3.0.tgz", + "integrity": "sha512-sAL4bJgbfCAtXcE8bXI+NAMzVaPNkIU8hRZUXYfgNFoWB9U57G3XQiMeCx/A6IrS6y7kGwBLylrwgsZQ8kUYlw==", + "dependencies": { + "@types/geojson": "^7946.0.14", + "@types/node": "^20.11.17", + "denque": "^2.1.0", + "iconv-lite": "^0.6.3", + "lru-cache": "^10.2.0" + }, + "engines": { + "node": ">= 14" } }, "node_modules/postgres": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.0.tgz", - "integrity": "sha512-d7UtSoCg4hUtzxM9aRi3J8BrM6t0h4bQmgAHG96cDCNpP9CnnWQRdRl7WWNvKs0oOaQU2InGoOi1jETmdZK02g==", + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.4.tgz", + "integrity": "sha512-IbyN+9KslkqcXa8AO9fxpk97PA4pzewvpi2B3Dwy9u4zpV32QicaEdgmF3eSQUzdRk7ttDHQejNgAEr4XoeH4A==", + "engines": { + "node": ">=12" + }, "funding": { "type": "individual", "url": "https://github.com/sponsors/porsager" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "node_modules/slow-json-stringify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/slow-json-stringify/-/slow-json-stringify-2.0.1.tgz", "integrity": "sha512-jqyzIqTaSkRGcWdWqjmOLKHZgOGUT71ZCTsvQu1xGu9Mqaod7O26y5FJJEmaUQhaTWh0bkXv2qqN0i+EQsD1jQ==" }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/uWebSockets.js": { "version": "20.31.0", "resolved": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#809b99d2d7d12e2cbf89b7135041e9b41ff84084" diff --git a/frameworks/JavaScript/uwebsockets.js/package.json b/frameworks/JavaScript/uwebsockets.js/package.json index 05ac667ab57..c64742e442d 100644 --- a/frameworks/JavaScript/uwebsockets.js/package.json +++ b/frameworks/JavaScript/uwebsockets.js/package.json @@ -1,8 +1,9 @@ { "dependencies": { - "postgres": "^3.4.0", - "uWebSockets.js": "uNetworking/uWebSockets.js#v20.32.0", - "slow-json-stringify": "^2.0.1" + "mariadb": "^3.3.0", + "postgres": "^3.4.4", + "slow-json-stringify": "^2.0.1", + "uWebSockets.js": "uNetworking/uWebSockets.js#v20.43.0" }, "license": "MIT", "main": "src/server.js", diff --git a/frameworks/JavaScript/uwebsockets.js/src/database/mysql.js b/frameworks/JavaScript/uwebsockets.js/src/database/mysql.js new file mode 100644 index 00000000000..a627a74d132 --- /dev/null +++ b/frameworks/JavaScript/uwebsockets.js/src/database/mysql.js @@ -0,0 +1,16 @@ +import { createPool } from "mariadb"; +import os from "node:os"; + +const pool = createPool({ + host: "tfb-database", + user: "benchmarkdbuser", + password: "benchmarkdbpass", + database: "hello_world", + connectionLimit: os.availableParallelism() +}); + +export const fortunes = async () => await pool.execute("SELECT id, message FROM fortune"); + +export const find = async (id) => await pool.execute("SELECT id, randomnumber FROM world WHERE id = ?", [id]).then((arr) => arr[0]); + +export const bulkUpdate = async (worlds) => await Promise.all(worlds.map(world => pool.execute("UPDATE world SET randomnumber = ? WHERE id = ?", [world.randomNumber, world.id]))); diff --git a/frameworks/JavaScript/uwebsockets.js/uwebsockets.js-mysql.dockerfile b/frameworks/JavaScript/uwebsockets.js/uwebsockets.js-mysql.dockerfile new file mode 100644 index 00000000000..8533d8b9a61 --- /dev/null +++ b/frameworks/JavaScript/uwebsockets.js/uwebsockets.js-mysql.dockerfile @@ -0,0 +1,12 @@ +FROM node:20-slim + +COPY ./ ./ + +RUN npm install + +ENV NODE_ENV production +ENV DATABASE mysql + +EXPOSE 8080 + +CMD ["npm", "start"] diff --git a/frameworks/Kotlin/http4k/build.gradle.kts b/frameworks/Kotlin/http4k/build.gradle.kts index 954b08a5fbc..37e2ce6aca6 100644 --- a/frameworks/Kotlin/http4k/build.gradle.kts +++ b/frameworks/Kotlin/http4k/build.gradle.kts @@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.js.translate.context.Namer.kotlin plugins { - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "1.9.23" application } @@ -35,14 +35,14 @@ allprojects { } java { - sourceCompatibility = VERSION_20 - targetCompatibility = VERSION_20 + sourceCompatibility = VERSION_21 + targetCompatibility = VERSION_21 } tasks { withType { kotlinOptions { - jvmTarget = "20" + jvmTarget = "21" allWarningsAsErrors = true } } diff --git a/frameworks/Kotlin/http4k/core-jdbc/build.gradle.kts b/frameworks/Kotlin/http4k/core-jdbc/build.gradle.kts index 1aa1eb417b6..68e2916ec1a 100644 --- a/frameworks/Kotlin/http4k/core-jdbc/build.gradle.kts +++ b/frameworks/Kotlin/http4k/core-jdbc/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { api(project(":core")) - api("com.zaxxer:HikariCP:5.0.1") - api("org.postgresql:postgresql:42.5.0") + api("com.zaxxer:HikariCP:5.1.0") + api("org.postgresql:postgresql:42.7.3") } diff --git a/frameworks/Kotlin/http4k/core-pgclient/src/main/kotlin/PostgresDatabase.kt b/frameworks/Kotlin/http4k/core-pgclient/src/main/kotlin/PostgresDatabase.kt index e9b55d4c177..377d72aff87 100644 --- a/frameworks/Kotlin/http4k/core-pgclient/src/main/kotlin/PostgresDatabase.kt +++ b/frameworks/Kotlin/http4k/core-pgclient/src/main/kotlin/PostgresDatabase.kt @@ -1,6 +1,4 @@ import io.vertx.core.Future -import io.vertx.core.Vertx -import io.vertx.core.VertxOptions import io.vertx.pgclient.PgConnectOptions import io.vertx.pgclient.PgPool.client import io.vertx.sqlclient.PoolOptions @@ -11,13 +9,7 @@ import java.util.Random class PostgresDatabase : Database { - private val queryPool: SqlClient - private val updatePool: SqlClient - - private val random = Random() - - init { - val vertx = Vertx.vertx(VertxOptions().setPreferNativeTransport(true)) + private val dbPool = run { val connectOptions = PgConnectOptions().apply { port = 5432 cachePreparedStatements = true @@ -26,52 +18,53 @@ class PostgresDatabase : Database { user = "benchmarkdbuser" password = "benchmarkdbpass" } - val clientOptions = PoolOptions().setMaxSize(64) - queryPool = client(vertx, connectOptions, clientOptions) - updatePool = client(vertx, connectOptions, clientOptions) + client(connectOptions, PoolOptions().apply { maxSize = 64 }) } - override fun findWorld() = - queryPool.findWorld(random.world()).toCompletionStage().toCompletableFuture().get() + private val random = Random() + + override fun findWorld() = dbPool.findWorld(random.world()) - override fun loadAll() = queryPool.preparedQuery("SELECT id, randomnumber FROM world ") + override fun loadAll() = dbPool.preparedQuery("SELECT id, randomnumber FROM world") .execute() .map { it.map(::toWorld) } - .toCompletionStage().toCompletableFuture().get() + .awaitComplete() - override fun findWorlds(count: Int) = - Future - .all( - (1..count).map { queryPool.findWorld(random.world()) } - ).toCompletionStage().toCompletableFuture().get().list() + override fun findWorlds(count: Int) = (1..count) + .map { dbPool.findWorld(random.world()) } - override fun updateWorlds(count: Int) = (1..count).map { - queryPool.findWorld(random.world()) - .flatMap { world -> - updatePool.preparedQuery("UPDATE world SET randomnumber = $1 WHERE id = $2") - .execute(Tuple.of(random.world(), world.first)) - .map { world } + override fun updateWorlds(count: Int) = (1..count) + .map { World(random.world(), random.world()) } + .onEach { + dbPool + .preparedQuery("SELECT id, randomnumber FROM world WHERE id = $1") + .execute(Tuple.of(it.first)) + .map { rowSet -> + val row = rowSet.iterator().next() + row.getInteger(1) + dbPool + .preparedQuery("UPDATE world SET randomnumber = $1 WHERE id = $2") + .execute(Tuple.of(it.second, it.first)) } - .toCompletionStage() - .toCompletableFuture() - .get() + .awaitComplete() } - override fun fortunes() = queryPool.preparedQuery("SELECT id, message FROM fortune") + override fun fortunes() = dbPool.preparedQuery("SELECT id, message FROM fortune") .execute() - .map { it.map(::toFortune) } + .map { it.map { Fortune(it.getInteger(0), it.getString(1)) } } .map { (it + Fortune(0, "Additional fortune added at request time.")) } .map { it.sortedBy { it.message } } - .toCompletionStage().toCompletableFuture().get() + .awaitComplete() companion object { private fun SqlClient.findWorld(id: Int) = preparedQuery("SELECT id, randomnumber FROM world WHERE id = $1") .execute(Tuple.of(id)) - .map { toWorld(it.single()) } + .map { it.map(::toWorld).first() } + .awaitComplete() } } private fun toWorld(r: Row) = r.getInteger("id") to r.getInteger("randomnumber") -private fun toFortune(it: Row) = Fortune(it.getInteger(0), it.getString(1)) +private fun Future.awaitComplete(): T = toCompletionStage().toCompletableFuture().get() \ No newline at end of file diff --git a/frameworks/Kotlin/http4k/core/build.gradle.kts b/frameworks/Kotlin/http4k/core/build.gradle.kts index 3780e39df97..9cd7e8f5269 100644 --- a/frameworks/Kotlin/http4k/core/build.gradle.kts +++ b/frameworks/Kotlin/http4k/core/build.gradle.kts @@ -4,13 +4,13 @@ plugins { } dependencies { - api(platform("org.http4k:http4k-bom:5.12.0.0")) - api("org.jetbrains.kotlin:kotlin-stdlib:1.9.22") - api("org.jetbrains.kotlin:kotlin-reflect:1.9.22") + api(platform("org.http4k:http4k-bom:5.14.4.0")) + api("org.jetbrains.kotlin:kotlin-stdlib:1.9.23") + api("org.jetbrains.kotlin:kotlin-reflect:1.9.23") api("org.http4k:http4k-core") api("org.http4k:http4k-format-argo") api("org.http4k:http4k-template-rocker") - api("org.apache.commons:commons-lang3:3.12.0") + api("org.apache.commons:commons-lang3:3.14.0") api("org.cache2k:cache2k-core:2.6.1.Final") compileOnly("com.fizzed:rocker-compiler:1.4.0") diff --git a/frameworks/Kotlin/http4k/gradle/wrapper/gradle-wrapper.properties b/frameworks/Kotlin/http4k/gradle/wrapper/gradle-wrapper.properties index 3fa8f862f75..b82aa23a4f0 100644 --- a/frameworks/Kotlin/http4k/gradle/wrapper/gradle-wrapper.properties +++ b/frameworks/Kotlin/http4k/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/frameworks/Kotlin/http4k/http4k-apache-graalvm.dockerfile b/frameworks/Kotlin/http4k/http4k-apache-graalvm.dockerfile index c6815f305cc..51132613c98 100644 --- a/frameworks/Kotlin/http4k/http4k-apache-graalvm.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-apache-graalvm.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 as gradle +FROM gradle:8.7.0-jdk21 as gradle USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-apache.dockerfile b/frameworks/Kotlin/http4k/http4k-apache.dockerfile index 559b490293c..de62168324d 100644 --- a/frameworks/Kotlin/http4k/http4k-apache.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-apache.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-apache4.dockerfile b/frameworks/Kotlin/http4k/http4k-apache4.dockerfile index 4b61309baef..840bc34ca4a 100644 --- a/frameworks/Kotlin/http4k/http4k-apache4.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-apache4.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-graalvm.dockerfile b/frameworks/Kotlin/http4k/http4k-graalvm.dockerfile index 667932c0441..e2688ac80a4 100644 --- a/frameworks/Kotlin/http4k/http4k-graalvm.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-graalvm.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 as gradle +FROM gradle:8.7.0-jdk21 as gradle USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-helidon-graalvm.dockerfile b/frameworks/Kotlin/http4k/http4k-helidon-graalvm.dockerfile index 0dd8a12cd2b..650f8dfc528 100644 --- a/frameworks/Kotlin/http4k/http4k-helidon-graalvm.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-helidon-graalvm.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 as gradle +FROM gradle:8.7.0-jdk21 as gradle USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-helidon-jdbc.dockerfile b/frameworks/Kotlin/http4k/http4k-helidon-jdbc.dockerfile index 4e447003e55..f8a49b8b7dd 100644 --- a/frameworks/Kotlin/http4k/http4k-helidon-jdbc.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-helidon-jdbc.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-helidon-pgclient.dockerfile b/frameworks/Kotlin/http4k/http4k-helidon-pgclient.dockerfile index 0425f9da4e3..7e36fa04a8b 100644 --- a/frameworks/Kotlin/http4k/http4k-helidon-pgclient.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-helidon-pgclient.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jetty.dockerfile b/frameworks/Kotlin/http4k/http4k-jetty.dockerfile index cafa466fabf..674a7f34bba 100644 --- a/frameworks/Kotlin/http4k/http4k-jetty.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jetty.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jetty11.dockerfile b/frameworks/Kotlin/http4k/http4k-jetty11.dockerfile index de416c28a3d..d9c785409f0 100644 --- a/frameworks/Kotlin/http4k/http4k-jetty11.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jetty11.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jetty11loom-jdbc.dockerfile b/frameworks/Kotlin/http4k/http4k-jetty11loom-jdbc.dockerfile index 729ef447464..d085a9b1913 100644 --- a/frameworks/Kotlin/http4k/http4k-jetty11loom-jdbc.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jetty11loom-jdbc.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jetty11loom-pgclient.dockerfile b/frameworks/Kotlin/http4k/http4k-jetty11loom-pgclient.dockerfile index 0560643c10e..d2cd8bc3c65 100644 --- a/frameworks/Kotlin/http4k/http4k-jetty11loom-pgclient.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jetty11loom-pgclient.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jettyloom-jdbc.dockerfile b/frameworks/Kotlin/http4k/http4k-jettyloom-jdbc.dockerfile index 9f69eef32e6..a3837e51fa6 100644 --- a/frameworks/Kotlin/http4k/http4k-jettyloom-jdbc.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jettyloom-jdbc.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-jettyloom-pgclient.dockerfile b/frameworks/Kotlin/http4k/http4k-jettyloom-pgclient.dockerfile index 2751bfa30d8..7259d27378a 100644 --- a/frameworks/Kotlin/http4k/http4k-jettyloom-pgclient.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-jettyloom-pgclient.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-ktorcio.dockerfile b/frameworks/Kotlin/http4k/http4k-ktorcio.dockerfile index 11849d31a41..ff2a0ed08b5 100644 --- a/frameworks/Kotlin/http4k/http4k-ktorcio.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-ktorcio.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-ktornetty.dockerfile b/frameworks/Kotlin/http4k/http4k-ktornetty.dockerfile index e36719d5348..ed9db5cdae8 100644 --- a/frameworks/Kotlin/http4k/http4k-ktornetty.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-ktornetty.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-netty.dockerfile b/frameworks/Kotlin/http4k/http4k-netty.dockerfile index d7221f8d8b6..37dea590804 100644 --- a/frameworks/Kotlin/http4k/http4k-netty.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-netty.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-ratpack.dockerfile b/frameworks/Kotlin/http4k/http4k-ratpack.dockerfile index 62e01176850..6e496eb8501 100644 --- a/frameworks/Kotlin/http4k/http4k-ratpack.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-ratpack.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-sunhttploom.dockerfile b/frameworks/Kotlin/http4k/http4k-sunhttploom.dockerfile index a07a6c1fcd4..3fa136cb9fc 100644 --- a/frameworks/Kotlin/http4k/http4k-sunhttploom.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-sunhttploom.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k-undertow.dockerfile b/frameworks/Kotlin/http4k/http4k-undertow.dockerfile index 7e29e7c091c..3f0ab95fc50 100644 --- a/frameworks/Kotlin/http4k/http4k-undertow.dockerfile +++ b/frameworks/Kotlin/http4k/http4k-undertow.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/http4k/http4k.dockerfile b/frameworks/Kotlin/http4k/http4k.dockerfile index 18ad4598276..ec643dda001 100644 --- a/frameworks/Kotlin/http4k/http4k.dockerfile +++ b/frameworks/Kotlin/http4k/http4k.dockerfile @@ -1,4 +1,4 @@ -FROM gradle:8.4.0-jdk21 +FROM gradle:8.7.0-jdk21 USER root WORKDIR /http4k COPY build.gradle.kts build.gradle.kts diff --git a/frameworks/Kotlin/pellet/pellet.dockerfile b/frameworks/Kotlin/pellet/pellet.dockerfile index f57e433dcd6..3600569ea35 100644 --- a/frameworks/Kotlin/pellet/pellet.dockerfile +++ b/frameworks/Kotlin/pellet/pellet.dockerfile @@ -4,7 +4,7 @@ COPY sample/build.gradle.kts build.gradle.kts COPY sample/src src RUN gradle clean shadowJar --no-daemon -FROM openjdk:21-jdk-buster +FROM openjdk:22-jdk-buster WORKDIR /sample COPY --from=gradle /sample/build/libs/sample-1.0.0-all.jar app.jar diff --git a/frameworks/Lua/openresty/openresty.dockerfile b/frameworks/Lua/openresty/openresty.dockerfile index 1777000e241..83283446c19 100644 --- a/frameworks/Lua/openresty/openresty.dockerfile +++ b/frameworks/Lua/openresty/openresty.dockerfile @@ -1,4 +1,4 @@ -FROM openresty/openresty:1.19.9.1-focal +FROM openresty/openresty:1.25.3.1-2-jammy ADD ./nginx.conf /openresty/ ADD ./app.lua /openresty/ diff --git a/frameworks/PHP/amp/amp.dockerfile b/frameworks/PHP/amp/amp.dockerfile index 1c164b024cf..066337e6302 100644 --- a/frameworks/PHP/amp/amp.dockerfile +++ b/frameworks/PHP/amp/amp.dockerfile @@ -14,7 +14,7 @@ RUN wget http://pear.php.net/go-pear.phar --quiet && php go-pear.phar #RUN apt-get install -y libuv1-dev > /dev/null RUN apt-get install -y libevent-dev > /dev/null #RUN pecl install uv-0.2.4 > /dev/null && echo "extension=uv.so" > /etc/php/8.3/cli/conf.d/uv.ini -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini ADD ./ /amp WORKDIR /amp diff --git a/frameworks/PHP/comet/comet-mysql.dockerfile b/frameworks/PHP/comet/comet-mysql.dockerfile index 9d694c24d99..2adc4d70f81 100644 --- a/frameworks/PHP/comet/comet-mysql.dockerfile +++ b/frameworks/PHP/comet/comet-mysql.dockerfile @@ -11,7 +11,7 @@ RUN apt-get install -yqq php8.3-cli php8.3-xml php8.3-mysql php8.3-mbstring > /d COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/comet/comet.dockerfile b/frameworks/PHP/comet/comet.dockerfile index 545a4abcaba..b210108832e 100644 --- a/frameworks/PHP/comet/comet.dockerfile +++ b/frameworks/PHP/comet/comet.dockerfile @@ -11,7 +11,7 @@ RUN apt-get install -yqq php8.3-cli php8.3-pgsql php8.3-xml php8.3-mbstring > /d COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/kumbiaphp/kumbiaphp-raw.dockerfile b/frameworks/PHP/kumbiaphp/kumbiaphp-raw.dockerfile index 3bcf358c18b..b30a5ad25fe 100644 --- a/frameworks/PHP/kumbiaphp/kumbiaphp-raw.dockerfile +++ b/frameworks/PHP/kumbiaphp/kumbiaphp-raw.dockerfile @@ -9,12 +9,11 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq nginx git unzip \ php8.3-fpm php8.3-mysql > /dev/null -COPY deploy/conf/* /etc/php/8.3/fpm/ - -ADD ./ /kumbiaphp +COPY --link deploy/conf/* /etc/php/8.3/fpm/ WORKDIR /kumbiaphp +COPY --link . . -RUN git clone -b v1.1.4 --single-branch --depth 1 -q https://github.com/KumbiaPHP/KumbiaPHP.git vendor/Kumbia +RUN git clone -b v1.2.1 --single-branch --depth 1 -q https://github.com/KumbiaPHP/KumbiaPHP.git vendor/Kumbia RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi; diff --git a/frameworks/PHP/kumbiaphp/kumbiaphp-workerman-mysql.dockerfile b/frameworks/PHP/kumbiaphp/kumbiaphp-workerman-mysql.dockerfile index 47bb53f8086..6c17e29857b 100644 --- a/frameworks/PHP/kumbiaphp/kumbiaphp-workerman-mysql.dockerfile +++ b/frameworks/PHP/kumbiaphp/kumbiaphp-workerman-mysql.dockerfile @@ -11,7 +11,7 @@ RUN apt-get install -yqq git php8.3-cli php8.3-mysql php8.3-xml > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cliphp.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/kumbiaphp/kumbiaphp-workerman.dockerfile b/frameworks/PHP/kumbiaphp/kumbiaphp-workerman.dockerfile index d5a8ffe7aac..541ff1fb00d 100644 --- a/frameworks/PHP/kumbiaphp/kumbiaphp-workerman.dockerfile +++ b/frameworks/PHP/kumbiaphp/kumbiaphp-workerman.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cliphp.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/kumbiaphp/kumbiaphp.dockerfile b/frameworks/PHP/kumbiaphp/kumbiaphp.dockerfile index fc54d6192a5..3f8edde3e2f 100644 --- a/frameworks/PHP/kumbiaphp/kumbiaphp.dockerfile +++ b/frameworks/PHP/kumbiaphp/kumbiaphp.dockerfile @@ -9,12 +9,11 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq nginx git unzip \ php8.3-fpm php8.3-mysql > /dev/null -COPY deploy/conf/* /etc/php/8.3/fpm/ - -ADD ./ /kumbiaphp +COPY --link deploy/conf/* /etc/php/8.3/fpm/ WORKDIR /kumbiaphp +COPY --link . . -RUN git clone -b v1.1.4 --single-branch --depth 1 https://github.com/KumbiaPHP/KumbiaPHP.git vendor/Kumbia +RUN git clone -b v1.2.1 --single-branch --depth 1 https://github.com/KumbiaPHP/KumbiaPHP.git vendor/Kumbia RUN git clone -b dev --single-branch --depth 1 https://github.com/KumbiaPHP/ActiveRecord.git vendor/Kumbia/ActiveRecord RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi; diff --git a/frameworks/PHP/kumbiaphp/server.php b/frameworks/PHP/kumbiaphp/server.php index 3ec60d615fa..2b3123173da 100644 --- a/frameworks/PHP/kumbiaphp/server.php +++ b/frameworks/PHP/kumbiaphp/server.php @@ -5,7 +5,7 @@ use Adapterman\Adapterman; use Workerman\Worker; -Adapterman::init(); +Adapterman::init(); $http_worker = new Worker('http://0.0.0.0:8080'); $http_worker->count = (int) shell_exec('nproc') * 4; diff --git a/frameworks/PHP/laravel/.env b/frameworks/PHP/laravel/.env index 3bed03b2b6d..e29e1170f97 100644 --- a/frameworks/PHP/laravel/.env +++ b/frameworks/PHP/laravel/.env @@ -1,5 +1,5 @@ APP_NAME=Laravel -APP_ENV=local +APP_ENV=production APP_KEY=base64:JRW3D/imCqern1eNGYaRTmP8wixsi3gWRXTSIT1LGTQ= APP_DEBUG=false APP_URL=http://localhost diff --git a/frameworks/PHP/laravel/benchmark_config.json b/frameworks/PHP/laravel/benchmark_config.json index 63c99532f2a..588dab1e17f 100644 --- a/frameworks/PHP/laravel/benchmark_config.json +++ b/frameworks/PHP/laravel/benchmark_config.json @@ -115,6 +115,29 @@ "display_name": "laravel-workerman", "notes": "", "versus": "php" + }, + "octane-frankenphp": { + "json_url": "/json", + "db_url": "/db", + "query_url": "/queries/", + "fortune_url": "/fortunes", + "update_url": "/updates/", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Fullstack", + "database": "MySQL", + "framework": "laravel", + "language": "PHP", + "flavor": "None", + "orm": "Full", + "platform": "Frankenphp", + "webserver": "caddy", + "os": "Linux", + "database_os": "Linux", + "display_name": "laravel-octane [frankenphp]", + "notes": "", + "versus": "php" } }] } \ No newline at end of file diff --git a/frameworks/PHP/laravel/config/app.php b/frameworks/PHP/laravel/config/app.php index eed03bfef75..de8547f82e1 100644 --- a/frameworks/PHP/laravel/config/app.php +++ b/frameworks/PHP/laravel/config/app.php @@ -142,7 +142,7 @@ // Illuminate\Redis\RedisServiceProvider::class, // Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, // Illuminate\Session\SessionServiceProvider::class, - // Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, // Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, diff --git a/frameworks/PHP/laravel/deploy/roadrunner/.rr.yaml b/frameworks/PHP/laravel/deploy/roadrunner/.rr.yaml index e1eecad8f04..bd19a378b20 100644 --- a/frameworks/PHP/laravel/deploy/roadrunner/.rr.yaml +++ b/frameworks/PHP/laravel/deploy/roadrunner/.rr.yaml @@ -1,4 +1,7 @@ # see https://roadrunner.dev/docs/intro-config +version: "3" +#https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml + server: command: "php ./vendor/bin/rr-worker start --relay-dsn unix:///usr/local/var/run/rr-rpc.sock" relay: "unix:///usr/local/var/run/rr-rpc.sock" @@ -7,7 +10,7 @@ logs: level: error http: address: 0.0.0.0:8080 - middleware: ["headers", "static", "gzip"] + middleware: ["headers"] pool: #max_jobs: 64 # feel free to change this supervisor: @@ -15,8 +18,6 @@ http: headers: response: Server: "RoadRunner" - static: - dir: "public" - forbid: [".php"] + diff --git a/frameworks/PHP/laravel/laravel-octane-frankenphp.dockerfile b/frameworks/PHP/laravel/laravel-octane-frankenphp.dockerfile new file mode 100644 index 00000000000..1829a4292f4 --- /dev/null +++ b/frameworks/PHP/laravel/laravel-octane-frankenphp.dockerfile @@ -0,0 +1,29 @@ +FROM dunglas/frankenphp + +RUN install-php-extensions \ + pcntl \ + pdo_mysql \ + intl \ + zip \ + opcache > /dev/null + +COPY . /app + +COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer + +RUN mkdir -p /app/bootstrap/cache /app/storage/logs /app/storage/framework/sessions /app/storage/framework/views /app/storage/framework/cache +RUN chmod -R 777 /app + +COPY deploy/conf/php.ini /usr/local/etc/php + +RUN composer require laravel/octane guzzlehttp/guzzle + +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet + +RUN php artisan optimize + +RUN frankenphp -v + +EXPOSE 8080 + +ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--port=8080"] diff --git a/frameworks/PHP/laravel/laravel-roadrunner.dockerfile b/frameworks/PHP/laravel/laravel-roadrunner.dockerfile index 8aa87522504..d5d42d62879 100644 --- a/frameworks/PHP/laravel/laravel-roadrunner.dockerfile +++ b/frameworks/PHP/laravel/laravel-roadrunner.dockerfile @@ -6,30 +6,29 @@ RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/docker-php-ext-opca #RUN echo "opcache.jit=1205" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini #RUN echo "opcache.jit_buffer_size=128M" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini -ADD ./ /laravel WORKDIR /laravel +COPY --link . . RUN mkdir -p /laravel/bootstrap/cache /laravel/storage/logs /laravel/storage/framework/sessions /laravel/storage/framework/views /laravel/storage/framework/cache -RUN chmod -R 777 /laravel RUN apt-get update > /dev/null && \ - apt-get install -yqq git unzip > /dev/null -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php && php -r "unlink('composer-setup.php');" -RUN mv composer.phar /usr/local/bin/composer + apt-get install -yqq curl unzip > /dev/null -COPY deploy/roadrunner/composer.json ./ -COPY deploy/roadrunner/.rr.yaml ./ +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer + +COPY --link deploy/roadrunner/composer.json . +COPY --link deploy/roadrunner/.rr.yaml . RUN composer install -a --no-dev --quiet RUN php artisan optimize # install roadrunner -COPY --from=ghcr.io/roadrunner-server/roadrunner:2.12.1 /usr/bin/rr ./rr +COPY --from=ghcr.io/roadrunner-server/roadrunner:2023.3 --link /usr/bin/rr /usr/local/bin/rr RUN php artisan vendor:publish --provider='Spiral\RoadRunnerLaravel\ServiceProvider' --tag=config +RUN rr -v EXPOSE 8080 # CMD bash -CMD ./rr serve -c ./.rr.yaml - +CMD rr serve -c .rr.yaml diff --git a/frameworks/PHP/laravel/laravel-workerman.dockerfile b/frameworks/PHP/laravel/laravel-workerman.dockerfile index 016c3d0d9a7..48cf4ee5e42 100644 --- a/frameworks/PHP/laravel/laravel-workerman.dockerfile +++ b/frameworks/PHP/laravel/laravel-workerman.dockerfile @@ -12,7 +12,7 @@ RUN apt-get install -yqq git unzip \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini ADD ./ /laravel WORKDIR /laravel diff --git a/frameworks/PHP/leaf/leaf-workerman.dockerfile b/frameworks/PHP/leaf/leaf-workerman.dockerfile index 80f9248d07a..eaa11589d3a 100644 --- a/frameworks/PHP/leaf/leaf-workerman.dockerfile +++ b/frameworks/PHP/leaf/leaf-workerman.dockerfile @@ -12,7 +12,7 @@ RUN apt-get update -yqq > /dev/null && apt-get install -yqq git \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/lumen/lumen-workerman.dockerfile b/frameworks/PHP/lumen/lumen-workerman.dockerfile index bc0f416c759..aabe520cdc8 100644 --- a/frameworks/PHP/lumen/lumen-workerman.dockerfile +++ b/frameworks/PHP/lumen/lumen-workerman.dockerfile @@ -12,7 +12,7 @@ RUN apt-get install -yqq nginx git unzip \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini ADD ./ /lumen WORKDIR /lumen diff --git a/frameworks/PHP/mark/mark.dockerfile b/frameworks/PHP/mark/mark.dockerfile index 3b39a27ef56..1785231f315 100644 --- a/frameworks/PHP/mark/mark.dockerfile +++ b/frameworks/PHP/mark/mark.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/mixphp/mixphp-workerman-mysql.dockerfile b/frameworks/PHP/mixphp/mixphp-workerman-mysql.dockerfile index 0861a10948d..9ac2ffaf0a2 100644 --- a/frameworks/PHP/mixphp/mixphp-workerman-mysql.dockerfile +++ b/frameworks/PHP/mixphp/mixphp-workerman-mysql.dockerfile @@ -8,7 +8,7 @@ RUN apt-get update -yqq && apt-get install -yqq git unzip wget curl build-essent RUN apt-get install -y php8.3-dev libevent-dev > /dev/null RUN wget http://pear.php.net/go-pear.phar --quiet && php go-pear.phar -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php-jit.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/mixphp/mixphp-workerman-pgsql.dockerfile b/frameworks/PHP/mixphp/mixphp-workerman-pgsql.dockerfile index f469165bf97..1f63e1fd91f 100644 --- a/frameworks/PHP/mixphp/mixphp-workerman-pgsql.dockerfile +++ b/frameworks/PHP/mixphp/mixphp-workerman-pgsql.dockerfile @@ -8,7 +8,7 @@ RUN apt-get update -yqq && apt-get install -yqq git unzip wget curl build-essent RUN apt-get install -y php8.3-dev libevent-dev > /dev/null RUN wget http://pear.php.net/go-pear.phar --quiet && php go-pear.phar -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php-jit.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/php-ngx/benchmark_config.json b/frameworks/PHP/php-ngx/benchmark_config.json index ab370278e0e..d96e89c0e7f 100644 --- a/frameworks/PHP/php-ngx/benchmark_config.json +++ b/frameworks/PHP/php-ngx/benchmark_config.json @@ -81,7 +81,8 @@ "database_os": "Linux", "display_name": "ngx-php async", "notes": "ngx_php async", - "versus": "php" + "versus": "php", + "tags": ["broken"] } }] } diff --git a/frameworks/PHP/php-ngx/php-ngx-async.dockerfile b/frameworks/PHP/php-ngx/php-ngx-async.dockerfile index 56acecf97ee..37f36d08671 100644 --- a/frameworks/PHP/php-ngx/php-ngx-async.dockerfile +++ b/frameworks/PHP/php-ngx/php-ngx-async.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -9,12 +9,10 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get update -yqq > /dev/null && \ apt-get install -yqq wget git libxml2-dev systemtap-sdt-dev \ - zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev libkrb5-dev \ + zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev \ php8.3-cli php8.3-dev libphp8.3-embed php8.3-mysql > /dev/null -ADD . . - -ENV NGINX_VERSION 1.25.4 +ENV NGINX_VERSION 1.26.0 RUN git clone -b v0.0.29 --single-branch --depth 1 https://github.com/rryqszq4/ngx-php.git > /dev/null @@ -28,8 +26,11 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ --add-module=/ngx-php/third_party/ngx_devel_kit \ --add-module=/ngx-php > /dev/null && \ make > /dev/null && make install > /dev/null + RUN sed -i "s|opcache.jit=off|;opcache.jit=off|g" /etc/php/8.3/embed/conf.d/10-opcache.ini +COPY --link . . + EXPOSE 8080 CMD /nginx/sbin/nginx -c /deploy/nginx_async.conf diff --git a/frameworks/PHP/php-ngx/php-ngx-mysql.dockerfile b/frameworks/PHP/php-ngx/php-ngx-mysql.dockerfile index 90d87b8523d..8c93d9d3fd1 100644 --- a/frameworks/PHP/php-ngx/php-ngx-mysql.dockerfile +++ b/frameworks/PHP/php-ngx/php-ngx-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -9,11 +9,10 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get update -yqq > /dev/null && \ apt-get install -yqq wget git libxml2-dev systemtap-sdt-dev \ - zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev libkrb5-dev \ + zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev \ php8.3-cli php8.3-dev libphp8.3-embed php8.3-mysql > /dev/null -ADD . . -ENV NGINX_VERSION 1.25.4 +ENV NGINX_VERSION 1.26.0 RUN git clone -b v0.0.29 --single-branch --depth 1 https://github.com/rryqszq4/ngx-php.git > /dev/null @@ -28,6 +27,10 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ --add-module=/ngx-php > /dev/null && \ make > /dev/null && make install > /dev/null +RUN sed -i "s|opcache.jit=off|;opcache.jit=off|g" /etc/php/8.3/embed/conf.d/10-opcache.ini + +COPY --link . . + RUN export WORKERS=$(( 4 * $(nproc) )) && \ sed -i "s/worker_processes auto/worker_processes $WORKERS/g" /deploy/nginx.conf diff --git a/frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile b/frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile index b7a157833fd..ab6d1e4f5df 100644 --- a/frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile +++ b/frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -9,11 +9,10 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get update -yqq > /dev/null && \ apt-get install -yqq wget git libxml2-dev systemtap-sdt-dev \ - zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev libkrb5-dev \ + zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev \ php8.3-cli php8.3-dev libphp8.3-embed php8.3-pgsql > /dev/null -ADD . . -ENV NGINX_VERSION 1.25.4 +ENV NGINX_VERSION 1.26.0 RUN git clone -b v0.0.29 --single-branch --depth 1 https://github.com/rryqszq4/ngx-php.git > /dev/null @@ -28,11 +27,15 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ --add-module=/ngx-php > /dev/null && \ make > /dev/null && make install > /dev/null +RUN sed -i "s|opcache.jit=off|;opcache.jit=off|g" /etc/php/8.3/embed/conf.d/10-opcache.ini + +COPY --link . . + RUN sed -i "s|app.php|app-pg.php|g" /deploy/nginx.conf RUN export WORKERS=$(( 4 * $(nproc) )) && \ sed -i "s|worker_processes auto|worker_processes $WORKERS|g" /deploy/nginx.conf -RUN sed -i "s|opcache.jit=off|opcache.jit=function|g" /etc/php/8.3/embed/conf.d/10-opcache.ini + EXPOSE 8080 CMD /nginx/sbin/nginx -c /deploy/nginx.conf diff --git a/frameworks/PHP/php-ngx/php-ngx.dockerfile b/frameworks/PHP/php-ngx/php-ngx.dockerfile index 671a6312aef..60d488d6649 100644 --- a/frameworks/PHP/php-ngx/php-ngx.dockerfile +++ b/frameworks/PHP/php-ngx/php-ngx.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -9,11 +9,10 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get update -yqq > /dev/null && \ apt-get install -yqq wget git libxml2-dev systemtap-sdt-dev \ - zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev libkrb5-dev \ + zlib1g-dev libpcre3-dev libargon2-dev libsodium-dev libkrb5-dev \ php8.3-cli php8.3-dev libphp8.3-embed php8.3-mysql > /dev/null -ADD . . -ENV NGINX_VERSION 1.25.4 +ENV NGINX_VERSION 1.26.0 RUN git clone -b v0.0.29 --single-branch --depth 1 https://github.com/rryqszq4/ngx-php.git > /dev/null @@ -27,8 +26,11 @@ RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ --add-module=/ngx-php/third_party/ngx_devel_kit \ --add-module=/ngx-php > /dev/null && \ make > /dev/null && make install > /dev/null + RUN sed -i "s|opcache.jit=off|;opcache.jit=off|g" /etc/php/8.3/embed/conf.d/10-opcache.ini +COPY --link . . + EXPOSE 8080 CMD /nginx/sbin/nginx -c /deploy/nginx_default.conf diff --git a/frameworks/PHP/php/deploy/nginx-unit.json b/frameworks/PHP/php/deploy/nginx-unit.json index b5bc980d07b..51fcc77c5bb 100644 --- a/frameworks/PHP/php/deploy/nginx-unit.json +++ b/frameworks/PHP/php/deploy/nginx-unit.json @@ -8,7 +8,11 @@ "applications": { "benchmark": { "type": "php", - "processes": 84, + "processes": { + "max": 224, + "spare": 168, + "idle_timeout": 20 + }, "user": "www-data", "group": "www-data", "root": "/php/", @@ -19,5 +23,10 @@ "requests": 10000000 } } + }, + "settings": { + "http": { + "server_version": false + } } } \ No newline at end of file diff --git a/frameworks/PHP/php/php-franken.dockerfile b/frameworks/PHP/php/php-franken.dockerfile index 56748c15fab..70d28b7a1ba 100644 --- a/frameworks/PHP/php/php-franken.dockerfile +++ b/frameworks/PHP/php/php-franken.dockerfile @@ -4,12 +4,13 @@ FROM dunglas/frankenphp RUN install-php-extensions \ pdo_mysql \ zip \ - opcache + opcache > /dev/null -COPY deploy/franken/Caddyfile /etc/caddy/Caddyfile +COPY --link deploy/franken/Caddyfile /etc/caddy/Caddyfile +COPY --link deploy/conf/php.ini /usr/local/etc/php/ -ADD . /php +COPY --link . /php # Worker mode #ENV FRANKENPHP_CONFIG="worker ./public/index.php" diff --git a/frameworks/PHP/php/php-h2o.dockerfile b/frameworks/PHP/php/php-h2o.dockerfile index cd73427a08e..57571b6b3c7 100644 --- a/frameworks/PHP/php/php-h2o.dockerfile +++ b/frameworks/PHP/php/php-h2o.dockerfile @@ -1,4 +1,4 @@ -ARG UBUNTU_VERSION=22.04 +ARG UBUNTU_VERSION=24.04 ARG H2O_PREFIX=/opt/h2o @@ -22,6 +22,7 @@ RUN apt-get -yqq update && \ libuv1-dev \ libwslay-dev \ libz-dev \ + llvm-dev \ ninja-build \ pkg-config \ rsync \ diff --git a/frameworks/PHP/php/php-unit.dockerfile b/frameworks/PHP/php/php-unit.dockerfile index fa37e1cb4a9..1fa2d5bbe9d 100644 --- a/frameworks/PHP/php/php-unit.dockerfile +++ b/frameworks/PHP/php/php-unit.dockerfile @@ -1,13 +1,20 @@ -FROM unit:1.30.0-php8.2 +FROM unit:php8.3 + +RUN docker-php-ext-install pdo_mysql opcache > /dev/null -ADD . /php WORKDIR /php +COPY --link . . -RUN docker-php-ext-install pdo_mysql opcache > /dev/null -RUN if [ $(nproc) = 2 ]; then sed -i "s|\"processes\": 84,|\"processes\": 64,|g" /php/deploy/nginx-unit.json ; fi; +RUN if [ $(nproc) = 2 ]; then sed -i "s|\"spare\": 168,|\"spare\": 64,|g" /php/deploy/nginx-unit.json ; fi; -EXPOSE 8080 +#RUN more /php/deploy/nginx-unit.json -COPY deploy/nginx-unit.json /docker-entrypoint.d/nginx-unit.json +RUN unitd && \ + curl -X PUT --data-binary @/php/deploy/nginx-unit.json --unix-socket \ + /var/run/control.unit.sock http://localhost/config + +ENTRYPOINT [ ] + +EXPOSE 8080 CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] diff --git a/frameworks/PHP/php/php-workerman.dockerfile b/frameworks/PHP/php/php-workerman.dockerfile index 6f392702778..bd257c3883c 100644 --- a/frameworks/PHP/php/php-workerman.dockerfile +++ b/frameworks/PHP/php/php-workerman.dockerfile @@ -10,7 +10,7 @@ RUN apt-get install -yqq git unzip \ php8.3 php8.3-common php8.3-cli php8.3-fpm php8.3-mysql > /dev/null RUN apt-get install -y php-pear php8.3-dev php8.3-xml libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/workerman/cli-php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/slim/slim-workerman-pgsql.dockerfile b/frameworks/PHP/slim/slim-workerman-pgsql.dockerfile index 4a40505c701..b1326f40cac 100644 --- a/frameworks/PHP/slim/slim-workerman-pgsql.dockerfile +++ b/frameworks/PHP/slim/slim-workerman-pgsql.dockerfile @@ -13,7 +13,7 @@ RUN apt-get install -yqq git \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/slim/slim-workerman.dockerfile b/frameworks/PHP/slim/slim-workerman.dockerfile index fefb80f8106..c7029637156 100644 --- a/frameworks/PHP/slim/slim-workerman.dockerfile +++ b/frameworks/PHP/slim/slim-workerman.dockerfile @@ -12,7 +12,7 @@ RUN apt-get update -yqq > /dev/null && apt-get install -yqq git \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/spiral/php/install-composer.sh b/frameworks/PHP/spiral/php/install-composer.sh deleted file mode 100644 index f8e743d6a13..00000000000 --- a/frameworks/PHP/spiral/php/install-composer.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)" -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" - -if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] -then - >&2 echo 'ERROR: Invalid installer signature' - rm composer-setup.php - exit 1 -fi - -php composer-setup.php --quiet -RESULT=$? -rm composer-setup.php -exit $RESULT \ No newline at end of file diff --git a/frameworks/PHP/spiral/php/php.ini b/frameworks/PHP/spiral/php/php.ini index 11fcf3af36e..6270be627e7 100644 --- a/frameworks/PHP/spiral/php/php.ini +++ b/frameworks/PHP/spiral/php/php.ini @@ -1909,6 +1909,11 @@ opcache.huge_code_pages=1 ; SSL stream context option. ;openssl.capath= + + +opcache.jit_buffer_size=128M +opcache.jit=tracing + ; Local Variables: ; tab-width: 4 ; End: \ No newline at end of file diff --git a/frameworks/PHP/spiral/spiral.dockerfile b/frameworks/PHP/spiral/spiral.dockerfile index ca9d98d9612..1f5d3440a48 100644 --- a/frameworks/PHP/spiral/spiral.dockerfile +++ b/frameworks/PHP/spiral/spiral.dockerfile @@ -1,21 +1,24 @@ FROM php:8.3-cli -RUN docker-php-ext-install pdo_mysql > /dev/null +RUN apt-get update -yqq > /dev/null && apt-get install -yqq git unzip > /dev/null +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer + +RUN docker-php-ext-install \ + opcache \ + pdo_mysql \ + sockets > /dev/null -# Workaround solution for installing ext-sockets for PHP 8.0 -# See https://github.com/docker-library/php/issues/1245 -RUN CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install sockets > /dev/null +# RoadRunner >= 2024.x.x requires protobuf extensions to be installed +ARG PROTOBUF_VERSION="4.26.1" +RUN pecl channel-update pecl.php.net +RUN MAKEFLAGS="-j $(nproc)" pecl install protobuf-${PROTOBUF_VERSION} > /dev/null -ADD ./ /spiral WORKDIR /spiral +COPY --link . . # composer and opcache settings -COPY php/* /usr/local/etc/php/ -RUN chmod +x /usr/local/etc/php/install-composer.sh && /usr/local/etc/php/install-composer.sh - -# install dependencies -RUN apt-get update -yqq > /dev/null && apt-get install -yqq git unzip > /dev/null -RUN php composer.phar install --optimize-autoloader --classmap-authoritative --no-dev +COPY --link php/php.ini /usr/local/etc/php/ +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet # pre-configure RUN ./vendor/bin/rr get-binary > /dev/null 2>&1 diff --git a/frameworks/PHP/symfony/.rr.yaml b/frameworks/PHP/symfony/.rr.yaml new file mode 100644 index 00000000000..88aeb945668 --- /dev/null +++ b/frameworks/PHP/symfony/.rr.yaml @@ -0,0 +1,25 @@ +version: "3" +#https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml + +server: + command: "php /symfony/public/runtime.php" + env: + - APP_RUNTIME: Runtime\RoadRunnerSymfonyNyholm\Runtime + +http: + address: "0.0.0.0:8080" + + middleware: ["headers"] + headers: + response: + Server: "RoadRunner" + #pool: + #num_workers: 0 + #max_jobs: 500 + +logs: + mode: production + level: error +#rpc: +# listen: tcp://127.0.0.1:6001 + diff --git a/frameworks/PHP/symfony/benchmark_config.json b/frameworks/PHP/symfony/benchmark_config.json index 2c202dbfdf1..d5f97f06800 100644 --- a/frameworks/PHP/symfony/benchmark_config.json +++ b/frameworks/PHP/symfony/benchmark_config.json @@ -116,6 +116,30 @@ "versus": "php", "tags": [] }, + "roadrunner": { + "plaintext_url": "/plaintext", + "json_url": "/json", + "db_url": "/db", + "update_url": "/updates?queries=", + "query_url": "/queries?queries=", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "Fullstack", + "database": "Postgres", + "framework": "symfony", + "language": "PHP", + "flavor": "PHP8", + "orm": "Full", + "platform": "roadrunner", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "symfony-roadrunner", + "notes": "", + "versus": "php", + "tags": [] + }, "franken": { "plaintext_url": "/plaintext", "json_url": "/json", diff --git a/frameworks/PHP/symfony/deploy/Caddyfile b/frameworks/PHP/symfony/deploy/Caddyfile index 56f20d882a2..f794fd3d647 100644 --- a/frameworks/PHP/symfony/deploy/Caddyfile +++ b/frameworks/PHP/symfony/deploy/Caddyfile @@ -3,7 +3,7 @@ {$CADDY_DEBUG} frankenphp { - #worker /path/to/your/worker.php + #worker /path/to/your/runtime.php {$FRANKENPHP_CONFIG} } } @@ -15,7 +15,7 @@ route { # If the requested file does not exist, try index files @indexFiles file { - try_files {path} {path}/worker.php worker.php + try_files {path} {path}/runtime.php runtime.php split_path .php } rewrite @indexFiles {http.matchers.file.relative} diff --git a/frameworks/PHP/symfony/deploy/conf/php.ini b/frameworks/PHP/symfony/deploy/conf/php.ini index 0e87f1d8855..e0f3a8a6e41 100644 --- a/frameworks/PHP/symfony/deploy/conf/php.ini +++ b/frameworks/PHP/symfony/deploy/conf/php.ini @@ -1767,7 +1767,7 @@ ldap.max_links = -1 opcache.enable=1 ; Determines if Zend OPCache is enabled for the CLI version of PHP -;opcache.enable_cli=0 +opcache.enable_cli=1 ; The OPcache shared memory storage size. opcache.memory_consumption=256 diff --git a/frameworks/PHP/symfony/public/worker.php b/frameworks/PHP/symfony/public/runtime.php similarity index 79% rename from frameworks/PHP/symfony/public/worker.php rename to frameworks/PHP/symfony/public/runtime.php index 9982c218d69..c99b79378ef 100644 --- a/frameworks/PHP/symfony/public/worker.php +++ b/frameworks/PHP/symfony/public/runtime.php @@ -4,6 +4,6 @@ require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; -return function (array $context) { +return function (array $context): Kernel { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); }; diff --git a/frameworks/PHP/symfony/symfony-franken.dockerfile b/frameworks/PHP/symfony/symfony-franken.dockerfile index 3bf0b7e3fd9..967b9370514 100644 --- a/frameworks/PHP/symfony/symfony-franken.dockerfile +++ b/frameworks/PHP/symfony/symfony-franken.dockerfile @@ -2,30 +2,25 @@ FROM dunglas/frankenphp # add additional extensions here: RUN install-php-extensions \ - pdo_pgsql \ intl \ - opcache - -RUN apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null && \ - apt-get install unzip > /dev/null - -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer + opcache \ + pdo_pgsql \ + zip > /dev/null -EXPOSE 8080 +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -COPY deploy/Caddyfile /etc/caddy/Caddyfile +COPY --link deploy/Caddyfile /etc/caddy/Caddyfile +COPY --link deploy/conf/php.ini /usr/local/etc/php/ -ADD . /symfony WORKDIR /symfony +COPY --link . . -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --no-scripts +ENV FRANKENPHP_CONFIG="worker /symfony/public/runtime.php" +ENV APP_RUNTIME="Runtime\FrankenPhpSymfony\Runtime" +#ENV CADDY_DEBUG=debug +RUN composer require runtime/frankenphp-symfony --update-no-dev --no-scripts --quiet RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear -RUN composer require runtime/frankenphp-symfony -ENV FRANKENPHP_CONFIG="worker ./public/worker.php" -ENV APP_RUNTIME=Runtime\\FrankenPhpSymfony\\Runtime +EXPOSE 8080 -#ENV CADDY_DEBUG=debug +RUN frankenphp -v diff --git a/frameworks/PHP/symfony/symfony-mysql.dockerfile b/frameworks/PHP/symfony/symfony-mysql.dockerfile index c6361bcacd8..a394aea7152 100644 --- a/frameworks/PHP/symfony/symfony-mysql.dockerfile +++ b/frameworks/PHP/symfony/symfony-mysql.dockerfile @@ -1,4 +1,3 @@ -FROM composer/composer:2-bin AS composer FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive @@ -11,24 +10,19 @@ RUN apt-get install -yqq nginx git unzip curl \ php8.3-cli php8.3-fpm php8.3-mysql \ php8.3-mbstring php8.3-xml php8.3-curl php8.3-dev > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -COPY deploy/conf/* /etc/php/8.3/fpm/ - -ADD . /symfony +COPY --link deploy/conf/* /etc/php/8.3/fpm/ WORKDIR /symfony +COPY --link . . RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi; -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --no-scripts +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet RUN cp deploy/mysql/.env . && composer dump-env prod && bin/console cache:clear RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini - EXPOSE 8080 # Uncomment next line for Laravel console error logging to be viewable in docker logs diff --git a/frameworks/PHP/symfony/symfony-raw.dockerfile b/frameworks/PHP/symfony/symfony-raw.dockerfile index 2957d6246c2..7af272bbef1 100644 --- a/frameworks/PHP/symfony/symfony-raw.dockerfile +++ b/frameworks/PHP/symfony/symfony-raw.dockerfile @@ -10,19 +10,15 @@ RUN apt-get install -yqq nginx git unzip curl \ php8.3-cli php8.3-fpm php8.3-pgsql \ php8.3-mbstring php8.3-xml php8.3-curl > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -COPY deploy/conf/* /etc/php/8.3/fpm/ - -ADD . /symfony +COPY --link deploy/conf/* /etc/php/8.3/fpm/ WORKDIR /symfony +COPY --link . . RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi; -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --no-scripts +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini diff --git a/frameworks/PHP/symfony/symfony-roadrunner.dockerfile b/frameworks/PHP/symfony/symfony-roadrunner.dockerfile new file mode 100644 index 00000000000..1fc48dadcdc --- /dev/null +++ b/frameworks/PHP/symfony/symfony-roadrunner.dockerfile @@ -0,0 +1,25 @@ +FROM php:8.3-cli + +COPY --from=ghcr.io/roadrunner-server/roadrunner:2023.3 --link /usr/bin/rr /usr/local/bin/rr +COPY --from=mlocati/php-extension-installer --link /usr/bin/install-php-extensions /usr/local/bin/ +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer + +RUN install-php-extensions \ + intl \ + opcache \ + pdo_pgsql \ + sockets \ + zip > /dev/null + +COPY --link deploy/conf/php.ini /usr/local/etc/php/ +WORKDIR /symfony +COPY --link . . + +ENV APP_RUNTIME="Runtime\RoadRunnerSymfonyNyholm\Runtime" +RUN composer require runtime/roadrunner-symfony-nyholm --update-no-dev --no-scripts --quiet +RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear + +EXPOSE 8080 + +RUN rr -v +ENTRYPOINT ["rr", "serve"] diff --git a/frameworks/PHP/symfony/symfony-swoole.dockerfile b/frameworks/PHP/symfony/symfony-swoole.dockerfile index b23c0e67b02..37403a24c97 100644 --- a/frameworks/PHP/symfony/symfony-swoole.dockerfile +++ b/frameworks/PHP/symfony/symfony-swoole.dockerfile @@ -10,25 +10,17 @@ RUN apt-get update -yqq && \ apt-get install -yqq libpq-dev libicu-dev git unzip > /dev/null && \ docker-php-ext-install pdo_pgsql opcache intl > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -COPY deploy/swoole/php.ini /usr/local/etc/php/ - -ADD . /symfony +COPY --link deploy/swoole/php.ini /usr/local/etc/php/ WORKDIR /symfony -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log -#RUN mkdir -m 777 -p /symfony/var/cache/swoole /symfony/var/log -RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --no-scripts --quiet -RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear - -ENV APP_RUNTIME=Runtime\\Swoole\\Runtime -RUN composer require runtime/swoole - -RUN COMPOSER_ALLOW_SUPERUSER=1 composer dump-autoload --no-dev --classmap-authoritative -RUN COMPOSER_ALLOW_SUPERUSER=1 composer dump-env prod +COPY --link . . #ENV APP_DEBUG=1 +ENV APP_RUNTIME="Runtime\Swoole\Runtime" +RUN composer require runtime/swoole --update-no-dev --no-scripts --quiet +RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear EXPOSE 8080 -CMD php /symfony/public/swoole.php +ENTRYPOINT [ "php", "/symfony/public/swoole.php" ] diff --git a/frameworks/PHP/symfony/symfony-workerman.dockerfile b/frameworks/PHP/symfony/symfony-workerman.dockerfile index b306f90710d..fec8e3bdd5e 100644 --- a/frameworks/PHP/symfony/symfony-workerman.dockerfile +++ b/frameworks/PHP/symfony/symfony-workerman.dockerfile @@ -6,25 +6,22 @@ RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /de RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null -RUN apt-get install -yqq git unzip \ +RUN apt-get install -yqq unzip \ php8.3-cli php8.3-pgsql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null && \ + pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini -EXPOSE 8080 - -ADD . /symfony WORKDIR /symfony +COPY --link . . -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --no-scripts +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear -COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini +COPY --link deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini + +EXPOSE 8080 -CMD php server.php start +ENTRYPOINT [ "php", "server.php", "start" ] diff --git a/frameworks/PHP/symfony/symfony.dockerfile b/frameworks/PHP/symfony/symfony.dockerfile index 392f19e91b6..8c3606087e6 100644 --- a/frameworks/PHP/symfony/symfony.dockerfile +++ b/frameworks/PHP/symfony/symfony.dockerfile @@ -10,19 +10,16 @@ RUN apt-get install -yqq nginx git unzip curl \ php8.3-cli php8.3-fpm php8.3-pgsql \ php8.3-mbstring php8.3-xml php8.3-curl php8.3-dev > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -COPY deploy/conf/* /etc/php/8.3/fpm/ +COPY --link deploy/conf/* /etc/php/8.3/fpm/ -ADD . /symfony WORKDIR /symfony +COPY --link . . RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi; -RUN mkdir -m 777 -p /symfony/var/cache/{dev,prod} /symfony/var/log - -ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --no-scripts +RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini diff --git a/frameworks/PHP/ubiquity/ubiquity-workerman-mongo.dockerfile b/frameworks/PHP/ubiquity/ubiquity-workerman-mongo.dockerfile index b8ed0a2df5c..f4834e90eb5 100644 --- a/frameworks/PHP/ubiquity/ubiquity-workerman-mongo.dockerfile +++ b/frameworks/PHP/ubiquity/ubiquity-workerman-mongo.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/php-async.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/ubiquity/ubiquity-workerman-mysql.dockerfile b/frameworks/PHP/ubiquity/ubiquity-workerman-mysql.dockerfile index 12568a07af3..f27f630c898 100644 --- a/frameworks/PHP/ubiquity/ubiquity-workerman-mysql.dockerfile +++ b/frameworks/PHP/ubiquity/ubiquity-workerman-mysql.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/php-async.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/ubiquity/ubiquity-workerman-raw.dockerfile b/frameworks/PHP/ubiquity/ubiquity-workerman-raw.dockerfile index 75b757a748d..da49301a7e2 100644 --- a/frameworks/PHP/ubiquity/ubiquity-workerman-raw.dockerfile +++ b/frameworks/PHP/ubiquity/ubiquity-workerman-raw.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/php-async.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/ubiquity/ubiquity-workerman.dockerfile b/frameworks/PHP/ubiquity/ubiquity-workerman.dockerfile index 4b92ddc6f4a..d98b0f46ae4 100644 --- a/frameworks/PHP/ubiquity/ubiquity-workerman.dockerfile +++ b/frameworks/PHP/ubiquity/ubiquity-workerman.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/php-async.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/webman/webman.dockerfile b/frameworks/PHP/webman/webman.dockerfile index 512b164d99c..5b64cd4aa16 100644 --- a/frameworks/PHP/webman/webman.dockerfile +++ b/frameworks/PHP/webman/webman.dockerfile @@ -11,7 +11,7 @@ RUN apt-get install -yqq php8.3-cli php8.3-pgsql php8.3-xml > /dev/null COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get update -yqq && apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/PHP/workerman/app-pg.php b/frameworks/PHP/workerman/app-pg.php index 471c71b2186..b92809d2787 100644 --- a/frameworks/PHP/workerman/app-pg.php +++ b/frameworks/PHP/workerman/app-pg.php @@ -47,6 +47,8 @@ function db() function query($request) { + $random = DbRaw::$random; + $query_count = 1; $q = (int) $request->get('q'); if ($q > 1) { @@ -54,8 +56,8 @@ function query($request) } while ($query_count--) { - DbRaw::$random->execute([mt_rand(1, 10000)]); - $arr[] = DbRaw::$random->fetch(); + $random->execute([mt_rand(1, 10000)]); + $arr[] = $random->fetch(); } return new Response(200, [ @@ -66,6 +68,8 @@ function query($request) function updateraw($request) { + $random = DbRaw::$random; + $query_count = 1; $q = (int) $request->get('q'); if ($q > 1) { @@ -74,8 +78,8 @@ function updateraw($request) while ($query_count--) { - DbRaw::$random->execute([mt_rand(1, 10000)]); - $row = DbRaw::$random->fetch(); + $random->execute([mt_rand(1, 10000)]); + $row = $random->fetch(); $row['randomNumber'] = mt_rand(1, 10000); $worlds[] = $row; diff --git a/frameworks/PHP/workerman/server.php b/frameworks/PHP/workerman/server.php index 2822b170ff0..5a38cf1e0fc 100644 --- a/frameworks/PHP/workerman/server.php +++ b/frameworks/PHP/workerman/server.php @@ -7,7 +7,7 @@ $http_worker = new Worker('http://0.0.0.0:8080'); $http_worker->count = (int) shell_exec('nproc') * 4; -$http_worker->onWorkerStart = function () { +$http_worker->onWorkerStart = static function () { Header::$date = gmdate('D, d M Y H:i:s').' GMT'; Timer::add(1, function() { Header::$date = gmdate('D, d M Y H:i:s').' GMT'; diff --git a/frameworks/PHP/workerman/workerman-async.dockerfile b/frameworks/PHP/workerman/workerman-async.dockerfile index 4228e2adf98..3730d43e58e 100644 --- a/frameworks/PHP/workerman/workerman-async.dockerfile +++ b/frameworks/PHP/workerman/workerman-async.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -8,15 +8,15 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq php8.3-cli php8.3-mysql > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.3-dev php8.3-xml libevent-dev git > /dev/null -RUN pecl install event-3.1.1 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null && \ + pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini -COPY php.ini /etc/php/8.3/cli/php.ini +COPY --link php.ini /etc/php/8.3/cli/php.ini -ADD ./ /workerman WORKDIR /workerman +COPY --link . . RUN composer require react/mysql "^0.6" --quiet RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet diff --git a/frameworks/PHP/workerman/workerman-pgsql.dockerfile b/frameworks/PHP/workerman/workerman-pgsql.dockerfile index f131163c93c..826a6a39383 100644 --- a/frameworks/PHP/workerman/workerman-pgsql.dockerfile +++ b/frameworks/PHP/workerman/workerman-pgsql.dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 + ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null @@ -7,15 +8,15 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq php8.3-cli php8.3-pgsql php8.3-xml > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.1.1 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null && \ + pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini -COPY php.ini /etc/php/8.3/cli/php.ini +COPY --link php.ini /etc/php/8.3/cli/php.ini -ADD ./ /workerman WORKDIR /workerman +COPY --link . . RUN sed -i "s|'/app.php|'/app-pg.php|g" server.php RUN sed -i "s|init()|DbRaw::init()|g" server.php diff --git a/frameworks/PHP/workerman/workerman-php8-jit.dockerfile b/frameworks/PHP/workerman/workerman-php8-jit.dockerfile index 194a2e8817d..528a5c312f6 100644 --- a/frameworks/PHP/workerman/workerman-php8-jit.dockerfile +++ b/frameworks/PHP/workerman/workerman-php8-jit.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -8,15 +8,15 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq php8.3-cli php8.3-pgsql php8.3-xml > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.1.1 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null && \ + pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini -COPY php-jit.ini /etc/php/8.3/cli/php.ini +COPY --link php-jit.ini /etc/php/8.3/cli/php.ini -ADD ./ /workerman WORKDIR /workerman +COPY --link . . RUN sed -i "s|'/app.php|'/app-pg.php|g" server.php RUN sed -i "s|init()|DbRaw::init()|g" server.php diff --git a/frameworks/PHP/workerman/workerman.dockerfile b/frameworks/PHP/workerman/workerman.dockerfile index 36abb360fc1..5d09ee6362a 100644 --- a/frameworks/PHP/workerman/workerman.dockerfile +++ b/frameworks/PHP/workerman/workerman.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive @@ -8,15 +8,15 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \ RUN apt-get install -yqq php8.3-cli php8.3-mysql php8.3-xml > /dev/null -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer -RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null -RUN pecl install event-3.1.1 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN apt-get install -y php-pear php8.3-dev libevent-dev git > /dev/null && \ + pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini -COPY php-jit.ini /etc/php/8.3/cli/php.ini +COPY --link php-jit.ini /etc/php/8.3/cli/php.ini -ADD ./ /workerman WORKDIR /workerman +COPY --link . . RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet diff --git a/frameworks/PHP/yii2/yii2-workerman.dockerfile b/frameworks/PHP/yii2/yii2-workerman.dockerfile index e5502f5b455..48c840c6f69 100644 --- a/frameworks/PHP/yii2/yii2-workerman.dockerfile +++ b/frameworks/PHP/yii2/yii2-workerman.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -yqq > /dev/null && \ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null -RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini +RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini COPY deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini diff --git a/frameworks/Pascal/mormot/benchmark_config.json b/frameworks/Pascal/mormot/benchmark_config.json index 10bbf278270..4a7322cac5f 100644 --- a/frameworks/Pascal/mormot/benchmark_config.json +++ b/frameworks/Pascal/mormot/benchmark_config.json @@ -31,6 +31,7 @@ "dockerfile": "mormot.dockerfile", "db_url": "/rawdb", "query_url": "/rawqueries?queries=", + "cached_query_url": "/rawcached?count=", "fortune_url": "/rawfortunes", "update_url": "/rawupdates?queries=", "port": 8080, diff --git a/frameworks/Pascal/mormot/mormot.dockerfile b/frameworks/Pascal/mormot/mormot.dockerfile index 831fa50b48f..ab276d4cf51 100644 --- a/frameworks/Pascal/mormot/mormot.dockerfile +++ b/frameworks/Pascal/mormot/mormot.dockerfile @@ -10,6 +10,7 @@ COPY setup_and_build.sh . RUN /bin/bash -c ./setup_and_build.sh FROM ubuntu:22.04 +RUN apt-get update -yqq && apt-get install -yqq libmimalloc2.0 ARG TFB_TEST_NAME @@ -17,6 +18,7 @@ COPY --from=builder /build/bin/fpc-x86_64-linux/raw /usr/local/bin/raw COPY --from=builder /build/libpq.so.5.16 /usr/lib/x86_64-linux-gnu/libpq.so.5 ENV TFB_TEST_NAME=$TFB_TEST_NAME +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libmimalloc.so.2.0 EXPOSE 8080 CMD ["raw"] diff --git a/frameworks/Pascal/mormot/setup_and_build.sh b/frameworks/Pascal/mormot/setup_and_build.sh index 81fc5b37ad0..7494c84747a 100755 --- a/frameworks/Pascal/mormot/setup_and_build.sh +++ b/frameworks/Pascal/mormot/setup_and_build.sh @@ -27,7 +27,7 @@ rm -rf ./libs mkdir -p ./libs/mORMot/static # echo "Getting the latest pre-release URL..." # USED_TAG=$(wget -qO- https://api.github.com/repos/synopse/mORMot2/releases/latest | jq -r '.tag_name') -USED_TAG="2.1.stable" +USED_TAG="2.2.stable" echo "Used release tag $USED_TAG" URL="https://github.com/synopse/mORMot2/releases/download/$USED_TAG/mormot2static.tgz" @@ -35,7 +35,7 @@ echo "Download statics from $URL ..." wget -qO- "$URL" | tar -xz -C ./libs/mORMot/static # uncomment for fixed commit URL -URL=https://github.com/synopse/mORMot2/tarball/c68d24054ffd3e5d63ecb33a2eea49055948e816 +URL=https://github.com/synopse/mORMot2/tarball/527b3fb11cb4dad5f2c03ace293b550f85504420 #URL="https://api.github.com/repos/synopse/mORMot2/tarball/$USED_TAG" echo "Download and unpacking mORMot sources from $URL ..." wget -qO- "$URL" | tar -xz -C ./libs/mORMot --strip-components=1 diff --git a/frameworks/Pascal/mormot/src/raw.pas b/frameworks/Pascal/mormot/src/raw.pas index 82b7d8f872a..27ec81b92f7 100644 --- a/frameworks/Pascal/mormot/src/raw.pas +++ b/frameworks/Pascal/mormot/src/raw.pas @@ -46,7 +46,7 @@ type // data structures TMessageRec = packed record - message: RawUtf8; + message: PUtf8Char; end; TWorldRec = packed record id: integer; @@ -54,8 +54,8 @@ end; TWorlds = array of TWorldRec; TFortune = packed record - id: integer; - message: RawUtf8; + id: PtrUInt; + message: PUtf8Char; end; TFortunes = array of TFortune; @@ -86,6 +86,7 @@ TRawAsyncServer = class(TSynPersistent) fStore: TRestServerDB; fTemplate: TSynMustache; fCachedWorldsTable: POrmCacheTable; + fRawCache: TOrmWorlds; fDbPool: TSqlDBPostgresConnectionProperties; procedure OnAsyncDb(Statement: TSqlDBPostgresAsyncStatement; Context: TObject); procedure OnAsyncFortunes(Statement: TSqlDBPostgresAsyncStatement; Context: TObject); @@ -107,6 +108,7 @@ TRawAsyncServer = class(TSynPersistent) function updates(ctxt: THttpServerRequest): cardinal; function rawdb(ctxt: THttpServerRequest): cardinal; function rawqueries(ctxt: THttpServerRequest): cardinal; + function rawcached(ctxt: THttpServerRequest): cardinal; function rawfortunes(ctxt: THttpServerRequest): cardinal; function rawupdates(ctxt: THttpServerRequest): cardinal; // asynchronous PostgreSQL pipelined DB access @@ -144,13 +146,13 @@ TRawAsyncServer = class(TSynPersistent) ''; -function ComputeRandomWorld: integer; inline; +function ComputeRandomWorld(gen: PLecuyer): integer; inline; begin - result := Random32(WORLD_COUNT) + 1; + result := gen^.Next(WORLD_COUNT) + 1; end; function GetQueriesParamValue(ctxt: THttpServerRequest; - const search: RawUtf8 = 'QUERIES='): cardinal; + const search: RawUtf8 = 'QUERIES='): cardinal; inline; begin if not ctxt.UrlParam(search, result) or (result = 0) then @@ -190,6 +192,7 @@ constructor TRawAsyncServer.Create( if fStore.Server.Cache.SetCache(TOrmCachedWorld) then fStore.Server.Cache.FillFromQuery(TOrmCachedWorld, '', []); fCachedWorldsTable := fStore.Orm.Cache.Table(TOrmCachedWorld); + fStore.Orm.RetrieveListObjArray(fRawCache, TOrmCachedWorld, 'order by id', []); // initialize the mustache template for /fortunes fTemplate := TSynMustache.Parse(FORTUNES_TPL); // setup the HTTP server @@ -222,22 +225,26 @@ destructor TRawAsyncServer.Destroy; fHttpServer.Free; fStore.Free; fModel.Free; - fDBPool.free; + fDBPool.Free; + ObjArrayClear(fRawCache); inherited Destroy; end; // query DB world table for /rawqueries and /rawupdates endpoints -function TRawAsyncServer.GetRawRandomWorlds(cnt: PtrInt; out res: TWorlds): boolean; +function TRawAsyncServer.GetRawRandomWorlds(cnt: PtrInt; + out res: TWorlds): boolean; var conn: TSqlDBConnection; stmt: ISqlDBStatement; pConn: TSqlDBPostgresConnection absolute conn; pStmt: TSqlDBPostgresStatement; + gen: PLecuyer; i: PtrInt; begin result := false; SetLength(res{%H-}, cnt); + gen := Lecuyer; conn := fDbPool.ThreadSafeConnection; // specific code to use PostgresSQL pipelining mode // see test_nosync in @@ -247,7 +254,7 @@ function TRawAsyncServer.GetRawRandomWorlds(cnt: PtrInt; out res: TWorlds): bool pStmt := TSqlDBPostgresStatement(stmt.Instance); for i := 0 to cnt - 1 do begin - pStmt.Bind(1, ComputeRandomWorld); + pStmt.Bind(1, ComputeRandomWorld(gen)); pStmt.SendPipelinePrepared; pConn.PipelineSync; end; @@ -277,6 +284,7 @@ function TRawAsyncServer.ComputeRawFortunes( arr: TDynArray; n: integer; f: ^TFortune; + mus: TSynMustacheContextData; begin result := HTTP_BADREQUEST; if stmt = nil then @@ -286,13 +294,16 @@ function TRawAsyncServer.ComputeRawFortunes( begin f := arr.NewPtr; f.id := stmt.ColumnInt(0); - f.message := stmt.ColumnUtf8(1); + f.message := stmt.ColumnPUtf8(1); end; f := arr.NewPtr; f.id := 0; f.message := FORTUNES_MESSAGE; arr.Sort(FortuneCompareByMessage); - ctxt.OutContent := fTemplate.RenderDataArray(arr); + mus := stmt.Connection.GetThreadOwned(TSynMustacheContextData); + if mus = nil then + mus := stmt.Connection.SetThreadOwned(fTemplate.NewMustacheContextData); + ctxt.OutContent := mus.RenderArray(arr); ctxt.OutContentType := HTML_CONTENT_TYPE; result := HTTP_SUCCESS; end; @@ -310,7 +321,7 @@ function TRawAsyncServer.json(ctxt: THttpServerRequest): cardinal; var msgRec: TMessageRec; begin - msgRec.message := HELLO_WORLD; + msgRec.message := pointer(HELLO_WORLD); ctxt.SetOutJson(@msgRec, TypeInfo(TMessageRec)); result := HTTP_SUCCESS; end; @@ -319,7 +330,7 @@ function TRawAsyncServer.db(ctxt: THttpServerRequest): cardinal; var w: TOrmWorld; begin - w := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld); + w := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld(Lecuyer)); try ctxt.SetOutJson(w); result := HTTP_SUCCESS; @@ -332,10 +343,12 @@ function TRawAsyncServer.queries(ctxt: THttpServerRequest): cardinal; var i: PtrInt; res: TOrmWorlds; + gen: PLecuyer; begin SetLength(res, GetQueriesParamValue(ctxt, 'QUERIES=')); + gen := Lecuyer; for i := 0 to length(res) - 1 do - res[i] := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld); + res[i] := TOrmWorld.Create(fStore.Orm, ComputeRandomWorld(gen)); ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds)); ObjArrayClear(res); result := HTTP_SUCCESS; @@ -345,10 +358,12 @@ function TRawAsyncServer.cached_queries(ctxt: THttpServerRequest): cardinal; var i: PtrInt; res: TOrmWorlds; + gen: PLecuyer; begin SetLength(res, GetQueriesParamValue(ctxt, 'COUNT=')); + gen := Lecuyer; for i := 0 to length(res) - 1 do - res[i] := fCachedWorldsTable.Get(ComputeRandomWorld); + res[i] := fCachedWorldsTable.Get(ComputeRandomWorld(gen)); ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds)); result := HTTP_SUCCESS; end; @@ -386,19 +401,21 @@ function TRawAsyncServer.updates(ctxt: THttpServerRequest): cardinal; res: TOrmWorlds; w: TOrmWorld; b: TRestBatch; + gen: PLecuyer; begin result := HTTP_SERVERERROR; SetLength(res, GetQueriesParamValue(ctxt)); b := TRestBatch.Create(fStore.ORM, TOrmWorld, {transrows=}0, [boExtendedJson, boNoModelEncoding, boPutNoCacheFlush]); try + gen := Lecuyer; for i := 0 to length(res) - 1 do begin w := TOrmWorld.Create; res[i] := w; - if not fStore.Orm.Retrieve(ComputeRandomWorld, w) then + if not fStore.Orm.Retrieve(ComputeRandomWorld(gen), w) then exit; - w.RandomNumber := ComputeRandomWorld; + w.RandomNumber := ComputeRandomWorld(gen); b.Update(w); end; result := b.Send; @@ -418,7 +435,7 @@ function TRawAsyncServer.rawdb(ctxt: THttpServerRequest): cardinal; result := HTTP_SERVERERROR; conn := fDbPool.ThreadSafeConnection; stmt := conn.NewStatementPrepared(WORLD_READ_SQL, true, true); - stmt.Bind(1, ComputeRandomWorld); + stmt.Bind(1, ComputeRandomWorld(Lecuyer)); stmt.ExecutePrepared; if stmt.Step then begin @@ -440,6 +457,20 @@ function TRawAsyncServer.rawqueries(ctxt: THttpServerRequest): cardinal; result := HTTP_SUCCESS; end; +function TRawAsyncServer.rawcached(ctxt: THttpServerRequest): cardinal; +var + i: PtrInt; + res: TOrmWorlds; + gen: PLecuyer; +begin + SetLength(res, GetQueriesParamValue(ctxt, 'COUNT=')); + gen := Lecuyer; + for i := 0 to length(res) - 1 do + res[i] := fRawCache[ComputeRandomWorld(gen) - 1]; + ctxt.SetOutJson(@res, TypeInfo(TOrmWorlds)); + result := HTTP_SUCCESS; +end; + function TRawAsyncServer.rawfortunes(ctxt: THttpServerRequest): cardinal; var conn: TSqlDBConnection; @@ -471,10 +502,8 @@ function ComputeUpdateSql(cnt: integer): RawUtf8; W := TTextWriter.CreateOwnedStream(tmp{%H-}); try W.AddShort('UPDATE world SET randomNumber = v.randomNumber FROM (VALUES'); - for i := 1 to cnt do begin - W.AddShort('(?::integer, ?::integer)'); - W.Add(','); - end; + for i := 1 to cnt do + W.AddShort('(?::integer, ?::integer),'); W.CancelLastComma; W.AddShort(' order by 1) AS v (id, randomNumber) WHERE world.id = v.id'); W.SetText(LastComputeUpdateSql); @@ -491,6 +520,7 @@ function TRawAsyncServer.rawupdates(ctxt: THttpServerRequest): cardinal; cnt, i: PtrInt; res: TWorlds; ids, nums: TInt64DynArray; + gen: PLecuyer; conn: TSqlDBConnection; stmt: ISqlDBStatement; begin @@ -500,8 +530,9 @@ function TRawAsyncServer.rawupdates(ctxt: THttpServerRequest): cardinal; if not getRawRandomWorlds(cnt, res) then exit; // generate new randoms + gen := Lecuyer; for i := 0 to cnt - 1 do - res[i].randomNumber := ComputeRandomWorld; + res[i].randomNumber := ComputeRandomWorld(gen); if cnt > 20 then begin // fill parameters arrays for update with nested select (PostgreSQL only) @@ -541,7 +572,7 @@ function TRawAsyncServer.asyncdb(ctxt: THttpServerRequest): cardinal; begin with fDbPool.Async.PrepareLocked(WORLD_READ_SQL, {res=}true, ASYNC_OPT) do try - Bind(1, ComputeRandomWorld); + Bind(1, ComputeRandomWorld(Lecuyer)); ExecuteAsync(ctxt, OnAsyncDb); finally UnLock; @@ -586,8 +617,9 @@ TAsyncWorld = class res: TWorlds; count, current: integer; update: TSqlDBPostgresAsyncStatement; // prepared before any callback - function Queries(async: TSqlDBPostgresAsync; ctxt: THttpServerRequest): cardinal; - function Updates(async: TSqlDBPostgresAsync; ctxt: THttpServerRequest): cardinal; + async: TSqlDBPostgresAsync; + function Queries(server: TRawAsyncServer; ctxt: THttpServerRequest): cardinal; + function Updates(server: TRawAsyncServer; ctxt: THttpServerRequest): cardinal; procedure DoUpdates; procedure OnQueries(Statement: TSqlDBPostgresAsyncStatement; Context: TObject); procedure OnRes({%H-}Statement: TSqlDBPostgresAsyncStatement; Context: TObject); @@ -595,48 +627,51 @@ TAsyncWorld = class function TRawAsyncServer.asyncqueries(ctxt: THttpServerRequest): cardinal; begin - result := TAsyncWorld.Create.Queries(fDBPool.Async, ctxt); + result := TAsyncWorld.Create.Queries(self, ctxt); end; function TRawAsyncServer.asyncupdates(ctxt: THttpServerRequest): cardinal; begin - result := TAsyncWorld.Create.Updates(fDBPool.Async, ctxt); + result := TAsyncWorld.Create.Updates(self, ctxt); end; { TAsyncWorld } -function TAsyncWorld.Queries(async: TSqlDBPostgresAsync; ctxt: THttpServerRequest): cardinal; +function TAsyncWorld.Queries(server: TRawAsyncServer; ctxt: THttpServerRequest): cardinal; var n: integer; - opt: TSqlDBPostgresAsyncStatementOptions; // for modified libpq + opt: TSqlDBPostgresAsyncStatementOptions; // forced options for modified libpq + gen: PLecuyer; + select: TSqlDBPostgresAsyncStatement; begin request := ctxt; + if async = nil then + async := server.fDbPool.Async; if count = 0 then count := getQueriesParamValue(ctxt); SetLength(res, count); // count is > 0 - with async.PrepareLocked(WORLD_READ_SQL, {res=}true, ASYNC_OPT) do - try - opt := AsyncOptions - [asoForceConnectionFlush]; - n := count; - repeat - dec(n); - Bind(1, ComputeRandomWorld); - if n = 0 then // last item should include asoForceConnectionFlush (if set) - opt := AsyncOptions; - ExecuteAsync(ctxt, OnQueries, @opt); - until n = 0; - finally - UnLock; - end; + select := async.PrepareLocked(WORLD_READ_SQL, {res=}true, ASYNC_OPT); + opt := ASYNC_OPT - [asoForceConnectionFlush]; + n := count; + gen := Lecuyer; + repeat + dec(n); + select.Bind(1, ComputeRandomWorld(gen)); + if n = 0 then // last item should include asoForceConnectionFlush (if set) + opt := ASYNC_OPT; + select.ExecuteAsync(ctxt, OnQueries, @opt); + until n = 0; + select.UnLock; result := ctxt.SetAsyncResponse; end; -function TAsyncWorld.Updates(async: TSqlDBPostgresAsync; ctxt: THttpServerRequest): cardinal; +function TAsyncWorld.Updates(server: TRawAsyncServer; ctxt: THttpServerRequest): cardinal; begin + async := server.fDbPool.Async; count := getQueriesParamValue(ctxt); update := async.Prepare(WORLD_UPDATE_SQLN, false, ASYNC_OPT); - result := Queries(async, ctxt); + result := Queries(server, ctxt); end; procedure TAsyncWorld.OnQueries(Statement: TSqlDBPostgresAsyncStatement; @@ -661,9 +696,11 @@ procedure TAsyncWorld.DoUpdates; var i: PtrInt; params: TIntegerDynArray; + gen: PLecuyer; begin + gen := Lecuyer; for i := 0 to count - 1 do - res[i].randomNumber := ComputeRandomWorld; + res[i].randomNumber := ComputeRandomWorld(gen); SetLength(params, count); for i := 0 to count - 1 do params[i] := res[i].id; @@ -702,9 +739,9 @@ procedure TAsyncWorld.OnRes(Statement: TSqlDBPostgresAsyncStatement; // register some RTTI for records JSON serialization Rtti.RegisterFromText([ - TypeInfo(TMessageRec), 'message:RawUtf8', - TypeInfo(TWorldRec), 'id,randomNumber:integer', - TypeInfo(TFortune), 'id:integer message:RawUtf8']); + TypeInfo(TMessageRec), 'message:PUtf8Char', + TypeInfo(TWorldRec), 'id,randomNumber:cardinal', + TypeInfo(TFortune), 'id:PtrUInt message:PUtf8Char']); // compute default execution context from HW information cpuCount := CurrentCpuSet(cpuMask); // may run from a "taskset" command @@ -726,7 +763,7 @@ procedure TAsyncWorld.OnRes(Statement: TSqlDBPostgresAsyncStatement; begin // asynchronus test with single listener socket and no CPU pinning servers := 1; - threads := cpuCount * 2; + threads := cpuCount * 4; pinServers2Cores := false; end; end @@ -748,12 +785,7 @@ procedure TAsyncWorld.OnRes(Statement: TSqlDBPostgresAsyncStatement; pinServers2Cores := false; // no option would keep the default boolean Get(['s', 'servers'], servers, '#count of servers (listener sockets)', servers); Get(['t', 'threads'], threads, 'per-server thread pool #size', threads); - if Option(['?', 'help'], 'display this message') then - begin - ConsoleWrite(FullDescription); - exit; - end; - if ConsoleWriteUnknown then + if ConsoleHelpFailed('TFB Server using mORMot 2') then exit; end; diff --git a/frameworks/Python/aiohttp/requirements.txt b/frameworks/Python/aiohttp/requirements.txt index d833896a168..d0caf5f25e7 100644 --- a/frameworks/Python/aiohttp/requirements.txt +++ b/frameworks/Python/aiohttp/requirements.txt @@ -1,8 +1,8 @@ -aiohttp==3.9.2 +aiohttp==3.9.4 asyncpg==0.25.0 cchardet==2.1.7 gunicorn==20.1 -jinja2==3.1.3 +jinja2==3.1.4 psycopg2==2.9.2 SQLAlchemy==1.4.29 ujson==5.4.0 diff --git a/frameworks/Python/aioworkers/requirements-pg.txt b/frameworks/Python/aioworkers/requirements-pg.txt index 4a399de7759..4735f269313 100644 --- a/frameworks/Python/aioworkers/requirements-pg.txt +++ b/frameworks/Python/aioworkers/requirements-pg.txt @@ -2,4 +2,4 @@ uvloop==0.17.0 asyncpg==0.27.0 aioworkers-pg==0.2.0 -Jinja2==3.1.3 +Jinja2==3.1.4 diff --git a/frameworks/Python/api_hour/requirements.txt b/frameworks/Python/api_hour/requirements.txt index 2a65448dcda..81b923f4005 100644 --- a/frameworks/Python/api_hour/requirements.txt +++ b/frameworks/Python/api_hour/requirements.txt @@ -1,19 +1,19 @@ -aiohttp==3.9.2 +aiohttp==3.9.4 -e git+https://github.com/Eyepea/aiohttp_jinja2.git@c9675e5c1e1ee7741b30aea8d8fbffcde016c7a0#egg=aiohttp_jinja2-master aiopg==0.7.0 -e git+https://github.com/Eyepea/API-Hour.git@577abbdcbb8cc2810dad46e260b338b15db4d0e3#egg=api_hour-master asyncio-redis==0.13.4 chardet==2.3.0 -gunicorn==19.9.0 +gunicorn==22.0.0 hiredis==0.2.0 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==0.23 piprot==0.9.1 psycopg2==2.7.5 PyYAML==5.4 -requests==2.31.0 +requests==2.32.0 requests-futures==0.9.5 setproctitle==1.1.8 ujson==1.33 aiomysql==0.0.7 -PyMySQL==0.6.7 +PyMySQL==1.1.1 diff --git a/frameworks/Python/apidaora/requirements.txt b/frameworks/Python/apidaora/requirements.txt index 65f2f5c9b50..c1247103499 100644 --- a/frameworks/Python/apidaora/requirements.txt +++ b/frameworks/Python/apidaora/requirements.txt @@ -1,6 +1,6 @@ asyncpg==0.21.0 gunicorn==20.0.4 -jinja2==3.1.3 +jinja2==3.1.4 uvloop==0.14.0 uvicorn==0.11.7 apidaora==0.26.0 diff --git a/frameworks/Python/async-worker/Pipfile.lock b/frameworks/Python/async-worker/Pipfile.lock index aaa9ae7968e..2ecfdb16067 100644 --- a/frameworks/Python/async-worker/Pipfile.lock +++ b/frameworks/Python/async-worker/Pipfile.lock @@ -146,11 +146,12 @@ }, "idna": { "hashes": [ - "sha256:5205d03e7bcbb919cc9c19885f9920d622ca52448306f2377daede5cf3faac16", - "sha256:c5b02147e01ea9920e6b0a3f1f7bb833612d507592c837a6c49552768f4054e1" + "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc", + "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0" ], - "markers": "python_version >= '3.4'", - "version": "==3.1" + "index": "pypi", + "markers": "python_version >= '3.5'", + "version": "==3.7" }, "multidict": { "hashes": [ diff --git a/frameworks/Python/bareasgi/requirements.txt b/frameworks/Python/bareasgi/requirements.txt index 18330880fea..fb7559bce4a 100644 --- a/frameworks/Python/bareasgi/requirements.txt +++ b/frameworks/Python/bareasgi/requirements.txt @@ -8,7 +8,7 @@ hpack==4.0.0 hypercorn==0.14.3 hyperframe==6.0.1 jetblack-asgi-typing==0.4.0 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.1 orjson==3.8.0 priority==2.0.0 diff --git a/frameworks/Python/blacksheep/requirements-gunicorn.txt b/frameworks/Python/blacksheep/requirements-gunicorn.txt index 9d41f264a67..5389b4df825 100644 --- a/frameworks/Python/blacksheep/requirements-gunicorn.txt +++ b/frameworks/Python/blacksheep/requirements-gunicorn.txt @@ -1 +1 @@ -gunicorn==20.1.0 +gunicorn==22.0.0 diff --git a/frameworks/Python/blacksheep/requirements.txt b/frameworks/Python/blacksheep/requirements.txt index 2965fca87aa..a93cbff6efa 100644 --- a/frameworks/Python/blacksheep/requirements.txt +++ b/frameworks/Python/blacksheep/requirements.txt @@ -1,4 +1,4 @@ asyncpg==0.27.0 -Jinja2==3.1.3 +Jinja2==3.1.4 blacksheep==1.2.13 ujson==5.7.0 diff --git a/frameworks/Python/bottle/requirements.txt b/frameworks/Python/bottle/requirements.txt index 75f9c033488..25c2d97e91a 100644 --- a/frameworks/Python/bottle/requirements.txt +++ b/frameworks/Python/bottle/requirements.txt @@ -2,7 +2,7 @@ bottle==0.12.19 bottle-sqlalchemy==0.4.3 greenlet==0.4.14 gunicorn==19.9.0 -meinheld==0.6.1 +meinheld==1.0.2 mysqlclient==1.3.12 SQLAlchemy==1.3.0 ujson==1.35 diff --git a/frameworks/Python/eve/requirements.txt b/frameworks/Python/eve/requirements.txt index 7e89c0bc0b4..f054d6baf97 100644 --- a/frameworks/Python/eve/requirements.txt +++ b/frameworks/Python/eve/requirements.txt @@ -3,6 +3,6 @@ Flask==1.0 greenlet==0.4.14 gunicorn==19.9.0 itsdangerous==0.24 -meinheld==0.6.1 +meinheld==1.0.2 uWSGI==2.0.22 Werkzeug==0.15.5 diff --git a/frameworks/Python/falcon/requirements.txt b/frameworks/Python/falcon/requirements.txt index 81c0d6ee5de..c5da990116d 100644 --- a/frameworks/Python/falcon/requirements.txt +++ b/frameworks/Python/falcon/requirements.txt @@ -1,2 +1,2 @@ falcon==3.1.1 -jinja2==3.1.3 +jinja2==3.1.4 diff --git a/frameworks/Python/fastapi/requirements.txt b/frameworks/Python/fastapi/requirements.txt index 02ea2224c34..478fdc103e4 100644 --- a/frameworks/Python/fastapi/requirements.txt +++ b/frameworks/Python/fastapi/requirements.txt @@ -1,4 +1,4 @@ asyncpg==0.27.0 fastapi==0.109.1 -Jinja2==3.1.3 +Jinja2==3.1.4 ujson==5.7.0 diff --git a/frameworks/Python/fastwsgi/requirements.txt b/frameworks/Python/fastwsgi/requirements.txt index 6fb55802cfd..6ffecb787c6 100644 --- a/frameworks/Python/fastwsgi/requirements.txt +++ b/frameworks/Python/fastwsgi/requirements.txt @@ -3,6 +3,6 @@ ujson==5.7.0 #fastwsgi==0.0.9 git+https://github.com/jamesroberts/fastwsgi.git@5572bb31b859d690be225707b9e7e25af397544b asyncpg==0.27.0 -Jinja2==3.1.3 +Jinja2==3.1.4 cachetools==5.3.0 asyncache==0.3.1 diff --git a/frameworks/Python/flask/requirements.txt b/frameworks/Python/flask/requirements.txt index a563bd2770b..eb63cf6086d 100644 --- a/frameworks/Python/flask/requirements.txt +++ b/frameworks/Python/flask/requirements.txt @@ -6,7 +6,7 @@ psycopg2-binary==2.9.3; implementation_name=='cpython' psycopg2-pool==1.1; implementation_name=='cpython' psycopg2cffi==2.9.0; implementation_name=='pypy' itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.2 ujson==5.4.0 orjson==3.8.7; implementation_name=='cpython' diff --git a/frameworks/Python/granian/requirements.txt b/frameworks/Python/granian/requirements.txt index 68519dc8ae7..75e49987e80 100644 --- a/frameworks/Python/granian/requirements.txt +++ b/frameworks/Python/granian/requirements.txt @@ -1,4 +1,4 @@ -asyncpg==0.27.0 -granian>=0.7.0,<0.8.0 -jinja2==3.1.3 -orjson==3.9.10 +asyncpg==0.29.0 +granian>=1.3.1,<1.4.0 +jinja2==3.1.4 +orjson==3.10.2 diff --git a/frameworks/Python/granian/run.py b/frameworks/Python/granian/run.py index a81600ef9cd..82e785e5406 100644 --- a/frameworks/Python/granian/run.py +++ b/frameworks/Python/granian/run.py @@ -8,7 +8,9 @@ interface = sys.argv[1] threading_mode = sys.argv[2] workers = multiprocessing.cpu_count() - threads = 2 if threading_mode == "runtime" else 1 + if threading_mode == "workers": + workers = round(workers / 2) + threads = 1 Granian( f"app_{interface}:main", diff --git a/frameworks/Python/heaven/requirements.txt b/frameworks/Python/heaven/requirements.txt index d3a26597539..5546000791d 100644 --- a/frameworks/Python/heaven/requirements.txt +++ b/frameworks/Python/heaven/requirements.txt @@ -1,4 +1,4 @@ asyncpg==0.29.0 heaven==0.2.4 orjson==3.9.15 -gunicorn==20.1.0 +gunicorn==22.0.0 diff --git a/frameworks/Python/morepath/requirements.txt b/frameworks/Python/morepath/requirements.txt index 68dc3474f06..b1ff4b72a3a 100644 --- a/frameworks/Python/morepath/requirements.txt +++ b/frameworks/Python/morepath/requirements.txt @@ -4,7 +4,7 @@ gunicorn==19.9.0 importscan==0.1 Jinja2==2.11.3 MarkupSafe==1.0 -meinheld==0.6.1 +meinheld==1.0.2 more.jinja2==0.2 more.pony==0.1 morepath==0.18.1 diff --git a/frameworks/Python/panther/requirements.txt b/frameworks/Python/panther/requirements.txt index 38124b17faf..4a494ed3f7a 100644 --- a/frameworks/Python/panther/requirements.txt +++ b/frameworks/Python/panther/requirements.txt @@ -1,11 +1,11 @@ panther==3.2.1 cython==3.0.6 -jinja2==3.1.2 +jinja2==3.1.4 asyncpg==0.29.0 -gunicorn==21.2.0 +gunicorn==22.0.0 uvicorn==0.24.0 uvloop==0.19.0 httptools==0.6.1 diff --git a/frameworks/Python/pyramid/requirements.txt b/frameworks/Python/pyramid/requirements.txt index 73d07efbeb0..d9cd315c6e3 100644 --- a/frameworks/Python/pyramid/requirements.txt +++ b/frameworks/Python/pyramid/requirements.txt @@ -8,12 +8,14 @@ chameleon==3.9.1 # via pyramid-chameleon greenlet==1.1.2 # via sqlalchemy -gunicorn==20.1.0 +gunicorn==22.0.0 # via -r requirements.in hupper==1.10.3 # via pyramid orjson==3.9.15 # via -r requirements.in +packaging==24.0 + # via gunicorn pastedeploy==2.1.1 # via plaster-pastedeploy plaster==1.0 diff --git a/frameworks/Python/quart/requirements-uvicorn.txt b/frameworks/Python/quart/requirements-uvicorn.txt index 8518917c668..cb62fac6b78 100644 --- a/frameworks/Python/quart/requirements-uvicorn.txt +++ b/frameworks/Python/quart/requirements-uvicorn.txt @@ -1,7 +1,7 @@ anyio==3.6.1 -gunicorn==20.1.0 +gunicorn==22.0.0 httptools==0.4.0 -idna==3.3 +idna==3.7 python-dotenv==0.20.0 PyYAML==6.0 sniffio==1.3.0 diff --git a/frameworks/Python/quart/requirements.txt b/frameworks/Python/quart/requirements.txt index 9e99d39a225..fb1f1a1e0be 100644 --- a/frameworks/Python/quart/requirements.txt +++ b/frameworks/Python/quart/requirements.txt @@ -8,11 +8,11 @@ hpack==4.0.0 hypercorn==0.14.2 hyperframe==6.0.1 itsdangerous==2.1.2 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.1.1 priority==2.0.0 quart==0.18.0 toml==0.10.2 uvloop==0.16.0 -Werkzeug==2.2.3 +Werkzeug==3.0.3 wsproto==1.2.0 diff --git a/frameworks/Python/responder/requirements.txt b/frameworks/Python/responder/requirements.txt index 79f0a4304ce..a16d601e4a8 100644 --- a/frameworks/Python/responder/requirements.txt +++ b/frameworks/Python/responder/requirements.txt @@ -1,6 +1,6 @@ asyncpg==0.21.0 -gunicorn==20.0.4 -Jinja2==3.1.3 +gunicorn==22.0.0 +Jinja2==3.1.4 ujson==2.0.3 uvloop==0.17.0 httptools==0.5.0 diff --git a/frameworks/Python/routerling/requirements.txt b/frameworks/Python/routerling/requirements.txt index 4a11df1bc19..276a30a5894 100644 --- a/frameworks/Python/routerling/requirements.txt +++ b/frameworks/Python/routerling/requirements.txt @@ -1,9 +1,9 @@ asgiref==3.4.1 asyncpg==0.24.0 click==8.0.1 -gunicorn==20.1.0 +gunicorn==22.0.0 h11==0.12.0 -Jinja2==3.1.3 +Jinja2==3.1.4 MarkupSafe==2.0.1 routerling==0.3.1 ujson==5.4.0 diff --git a/frameworks/Python/sanic/requirements.txt b/frameworks/Python/sanic/requirements.txt index e118a108cc7..5b4738e167d 100644 --- a/frameworks/Python/sanic/requirements.txt +++ b/frameworks/Python/sanic/requirements.txt @@ -1,4 +1,4 @@ asyncpg==0.25.0 -Jinja2==3.1.3 +Jinja2==3.1.4 sanic==22.6.1 uvloop==0.16.0 diff --git a/frameworks/Python/starlette/requirements.txt b/frameworks/Python/starlette/requirements.txt index 6c1a7f01ed6..ef5a1748ca4 100644 --- a/frameworks/Python/starlette/requirements.txt +++ b/frameworks/Python/starlette/requirements.txt @@ -1,8 +1,8 @@ asyncpg==0.26.0 gunicorn==20.1.0 httptools==0.5.0 -idna==3.3 -Jinja2==3.1.3 +idna==3.7 +Jinja2==3.1.4 MarkupSafe==2.1.1 python-dotenv==0.20.0 PyYAML==6.0 diff --git a/frameworks/Python/turbogears/requirements.txt b/frameworks/Python/turbogears/requirements.txt index c3d5ccc9d7d..0ad8a126c99 100644 --- a/frameworks/Python/turbogears/requirements.txt +++ b/frameworks/Python/turbogears/requirements.txt @@ -6,5 +6,5 @@ mysqlclient==1.3.7 jinja2==2.11.3 gunicorn==19.9.0 -meinheld==0.6.1 +meinheld==1.0.2 greenlet==0.4.14 diff --git a/frameworks/Python/uvicorn/requirements.txt b/frameworks/Python/uvicorn/requirements.txt index 91523ce5164..8b3843c6cb6 100644 --- a/frameworks/Python/uvicorn/requirements.txt +++ b/frameworks/Python/uvicorn/requirements.txt @@ -1,7 +1,7 @@ asyncpg==0.28.0 -gunicorn==20.1.0 +gunicorn==22.0.0 httptools==0.6.0 -Jinja2==3.1.3 +Jinja2==3.1.4 ujson==5.8.0 uvloop==0.17.0 uvicorn==0.22.0 diff --git a/frameworks/Python/web2py/requirements.txt b/frameworks/Python/web2py/requirements.txt index ffff87771f6..968f12b799f 100644 --- a/frameworks/Python/web2py/requirements.txt +++ b/frameworks/Python/web2py/requirements.txt @@ -1,4 +1,4 @@ mysqlclient==1.3.12 gunicorn==19.7.1 -meinheld==0.6.1 +meinheld==1.0.2 greenlet==0.4.14 diff --git a/frameworks/Python/weppy/requirements.txt b/frameworks/Python/weppy/requirements.txt index 9e0c789e3ba..078948040eb 100644 --- a/frameworks/Python/weppy/requirements.txt +++ b/frameworks/Python/weppy/requirements.txt @@ -1,6 +1,6 @@ psycopg2==2.7.5 weppy==1.3 gunicorn==19.9.0 -meinheld==0.6.1 +meinheld==1.0.2 uwsgi==2.0.22 greenlet==0.4.14 diff --git a/frameworks/Python/wsgi/requirements.txt b/frameworks/Python/wsgi/requirements.txt index 8c35857d83b..9ba0b97b7b6 100644 --- a/frameworks/Python/wsgi/requirements.txt +++ b/frameworks/Python/wsgi/requirements.txt @@ -1,4 +1,4 @@ ujson==1.35 gunicorn==19.9.0 -meinheld==0.6.1 +meinheld==1.0.2 greenlet==0.4.14 diff --git a/frameworks/Ruby/agoo/.ruby-gemset b/frameworks/Ruby/agoo/.ruby-gemset deleted file mode 100644 index 92fc86eb583..00000000000 --- a/frameworks/Ruby/agoo/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -agoo diff --git a/frameworks/Ruby/agoo/.ruby-version b/frameworks/Ruby/agoo/.ruby-version deleted file mode 100644 index 4560fb912c0..00000000000 --- a/frameworks/Ruby/agoo/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -ruby-2.6.3 diff --git a/frameworks/Ruby/agoo/agoo.dockerfile b/frameworks/Ruby/agoo/agoo.dockerfile index b423b2b4f4d..964e91aa5a5 100644 --- a/frameworks/Ruby/agoo/agoo.dockerfile +++ b/frameworks/Ruby/agoo/agoo.dockerfile @@ -6,6 +6,13 @@ RUN apt-get update -q \ libpq-dev \ && rm -rf /var/lib/apt/lists/* +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + WORKDIR /rack COPY Gemfile app.rb ./ @@ -14,6 +21,5 @@ RUN bundle install --jobs=4 EXPOSE 8080 -ENV RUBY_YJIT_ENABLE=1 CMD AGOO_WORKER_COUNT=$(nproc) ruby app.rb diff --git a/frameworks/Ruby/agoo/app.rb b/frameworks/Ruby/agoo/app.rb index f2c2c9f3301..498c0ece93b 100644 --- a/frameworks/Ruby/agoo/app.rb +++ b/frameworks/Ruby/agoo/app.rb @@ -6,7 +6,7 @@ require 'pg' require 'rack' -$pool = ConnectionPool.new(size: 256, timeout: 5) do +$pool = ConnectionPool.new(size: 1, timeout: 5) do PG::Connection.new({ dbname: 'hello_world', host: 'tfb-database', @@ -15,18 +15,31 @@ }) end +QUERY_RANGE = (1..10_000).freeze +ALL_IDS = QUERY_RANGE.to_a +QUERIES_MIN = 1 +QUERIES_MAX = 500 + +CONTENT_TYPE = 'Content-Type' +CONTENT_LENGTH = 'Content-Length' +DATE = 'Date' +SERVER = 'Server' +SERVER_STRING = 'Agoo' + +JSON_TYPE = 'application/json' +HTML_TYPE = 'text/html; charset=utf-8' +PLAINTEXT_TYPE = 'text/plain' + + class BaseHandler def self.extract_queries_param(request = nil) queries = Rack::Utils.parse_query(request['QUERY_STRING'])['queries'].to_i rescue 1 - return 1 if queries < 1 - return 500 if queries > 500 - - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end def self.get_one_random_number - 1 + Random.rand(10000) + Random.rand(QUERY_RANGE) end def self.get_one_record(id = get_one_random_number) @@ -43,9 +56,9 @@ def self.html_response(str = '') [ 200, { - 'Content-Type' => 'text/html; charset=utf-8', - 'Date' => Time.now.utc.httpdate, - 'Server' => 'Agoo' + CONTENT_TYPE => HTML_TYPE, + DATE => Time.now.httpdate, + SERVER => SERVER_STRING }, [str] ] @@ -55,9 +68,9 @@ def self.json_response(obj = {}) [ 200, { - 'Content-Type' => 'application/json', - 'Date' => Time.now.utc.httpdate, - 'Server' => 'Agoo' + CONTENT_TYPE => JSON_TYPE, + DATE => Time.now.httpdate, + SERVER => SERVER_STRING }, [Oj.dump(obj, { :mode => :strict })] ] @@ -67,9 +80,9 @@ def self.plain_response(str = '') [ 200, { - 'Content-Type' => 'text/plain', - 'Date' => Time.now.utc.httpdate, - 'Server' => 'Agoo' + CONTENT_TYPE => PLAINTEXT_TYPE, + DATE => Time.now.httpdate, + SERVER => SERVER_STRING }, [str] ] @@ -140,12 +153,10 @@ def self.call(_req) class QueriesHandler < BaseHandler def self.call(req) - records = - [].tap do|r| - (extract_queries_param req).times do - r << get_one_record() - end - end + queries = extract_queries_param req + records = ALL_IDS.sample(queries).map do |id| + get_one_record(id) + end json_response(records) end @@ -153,20 +164,18 @@ def self.call(req) class UpdatesHandler < BaseHandler def self.call(req) - records = - [].tap do|r| - (extract_queries_param req).times do - r << get_one_record() - end - end - - updated_records = - records.map { |r| r['randomnumber'] = get_one_random_number; r } + queries = extract_queries_param req + records = ALL_IDS.sample(queries).map do |id| + world = get_one_record(id) + world['randomnumber'] = get_one_random_number + world + end sql_values = - updated_records. - map { |r| "(#{ r['id'] }, #{ r['randomnumber'] })"}. - join(', ') + records. + map { |r| + "(#{ r['id'] }, #{ r['randomnumber'] })" + }.join(', ') $pool.with do |conn| conn.exec(<<-SQL) @@ -179,7 +188,7 @@ def self.call(req) SQL end - json_response(updated_records) + json_response(records) end end diff --git a/frameworks/Ruby/grape/Gemfile b/frameworks/Ruby/grape/Gemfile index 846757d6607..11003918d94 100644 --- a/frameworks/Ruby/grape/Gemfile +++ b/frameworks/Ruby/grape/Gemfile @@ -1,4 +1,4 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' gem 'mysql2', '0.5.4' gem 'unicorn', '6.1.0' diff --git a/frameworks/Ruby/grape/config.ru b/frameworks/Ruby/grape/config.ru index 1bd2494c83f..22142a30c72 100644 --- a/frameworks/Ruby/grape/config.ru +++ b/frameworks/Ruby/grape/config.ru @@ -4,6 +4,8 @@ require 'yaml' require_relative 'config/auto_tune' MAX_PK = 10_000 +ID_RANGE = (1..MAX_PK).freeze +ALL_IDS = ID_RANGE.to_a QUERIES_MIN = 1 QUERIES_MAX = 500 @@ -36,9 +38,7 @@ module Acme helpers do def bounded_queries queries = params[:queries].to_i - return QUERIES_MIN if queries < QUERIES_MIN - return QUERIES_MAX if queries > QUERIES_MAX - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end # Return a random number between 1 and MAX_PK @@ -55,8 +55,8 @@ module Acme get '/query' do ActiveRecord::Base.connection_pool.with_connection do - Array.new(bounded_queries) do - World.find(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + World.find(id) end end end @@ -64,11 +64,11 @@ module Acme get '/updates' do worlds = ActiveRecord::Base.connection_pool.with_connection do - Array.new(bounded_queries) do - world = World.find(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + world = World.find(id) new_value = rand1 new_value = rand1 while new_value == world.randomNumber - world.update(randomNumber: new_value) + world.update_columns(randomNumber: new_value) world end end diff --git a/frameworks/Ruby/grape/grape-unicorn.dockerfile b/frameworks/Ruby/grape/grape-unicorn.dockerfile index 2b0e1ba1dc3..3cc4c7d2d37 100644 --- a/frameworks/Ruby/grape/grape-unicorn.dockerfile +++ b/frameworks/Ruby/grape/grape-unicorn.dockerfile @@ -8,7 +8,7 @@ ADD ./ /grape WORKDIR /grape -RUN bundle install --jobs=4 --gemfile=/grape/Gemfile --path=/grape/grape/bundle +RUN bundle install --jobs=4 --gemfile=/grape/Gemfile EXPOSE 8080 diff --git a/frameworks/Ruby/grape/grape.dockerfile b/frameworks/Ruby/grape/grape.dockerfile index ea90f27d262..5beaf426ddd 100644 --- a/frameworks/Ruby/grape/grape.dockerfile +++ b/frameworks/Ruby/grape/grape.dockerfile @@ -6,7 +6,7 @@ ADD ./ /grape WORKDIR /grape -RUN bundle install --jobs=4 --gemfile=/grape/Gemfile --path=/grape/grape/bundle +RUN bundle install --jobs=4 --gemfile=/grape/Gemfile EXPOSE 8080 diff --git a/frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile b/frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile index 3274f168c87..7cc59cf699f 100644 --- a/frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile +++ b/frameworks/Ruby/h2o_mruby/h2o_mruby.dockerfile @@ -1,4 +1,4 @@ -ARG UBUNTU_VERSION=22.04 +ARG UBUNTU_VERSION=24.04 ARG H2O_PREFIX=/opt/h2o @@ -22,6 +22,7 @@ RUN apt-get -yqq update && \ libuv1-dev \ libwslay-dev \ libz-dev \ + llvm-dev \ ninja-build \ pkg-config \ rsync \ diff --git a/frameworks/Ruby/hanami/hanami.dockerfile b/frameworks/Ruby/hanami/hanami.dockerfile index 4fb8b4523f7..01972160167 100644 --- a/frameworks/Ruby/hanami/hanami.dockerfile +++ b/frameworks/Ruby/hanami/hanami.dockerfile @@ -1,12 +1,17 @@ FROM ruby:3.3 -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + WORKDIR /hanami COPY Gemfile ./ +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 COPY . . diff --git a/frameworks/Ruby/padrino/Gemfile b/frameworks/Ruby/padrino/Gemfile index 18cff716d85..792046310c6 100644 --- a/frameworks/Ruby/padrino/Gemfile +++ b/frameworks/Ruby/padrino/Gemfile @@ -1,4 +1,4 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' gem 'mysql2', '~> 0.4' gem "unicorn", '~> 6.1' @@ -8,3 +8,4 @@ gem 'slim', '2.0.3' gem 'dm-mysql-adapter', '1.2.0' gem 'dm-core', '1.2.1' gem 'padrino', '0.15.3' +gem 'rack', '~> 2.2' diff --git a/frameworks/Ruby/padrino/app/controllers.rb b/frameworks/Ruby/padrino/app/controllers.rb index 119d2f45f20..0d899ce97a9 100644 --- a/frameworks/Ruby/padrino/app/controllers.rb +++ b/frameworks/Ruby/padrino/app/controllers.rb @@ -1,3 +1,7 @@ +MAX_PK = 10_000 +QUERIES_MIN = 1 +QUERIES_MAX = 500 + HelloWorld::App.controllers do get '/json', :provides => [:json] do response.headers['Server'] = 'padrino' @@ -8,19 +12,17 @@ get '/db', :provides => [:json] do response.headers['Server'] = 'padrino' response.headers['Date'] = Time.now.httpdate - id = Random.rand(10000) + 1 + id = Random.rand(MAX_PK) + 1 World.get(id).attributes.to_json end get '/queries', :provides => [:json] do response.headers['Server'] = 'padrino' response.headers['Date'] = Time.now.httpdate - queries = params['queries'].to_i - queries = 1 if queries < 1 - queries = 500 if queries > 500 + queries = params['queries'].to_i.clamp(QUERIES_MIN, QUERIES_MAX) results = (1..queries).map do - World.get(Random.rand(10000) + 1).attributes + World.get(Random.rand(MAX_PK) + 1).attributes end.to_json end @@ -37,15 +39,13 @@ get '/updates', :provides => [:json] do response.headers['Server'] = 'padrino' response.headers['Date'] = Time.now.httpdate - queries = params['queries'].to_i - queries = 1 if queries < 1 - queries = 500 if queries > 500 + queries = params['queries'].to_i.clamp(QUERIES_MIN, QUERIES_MAX) worlds = (1..queries).map do # get a random row from the database, which we know has 10000 # rows with ids 1 - 10000 - world = World.get(Random.rand(10000) + 1) - world.update(:randomNumber => Random.rand(10000) + 1) + world = World.get(Random.rand(MAX_PK) + 1) + world.update(randomNumber: Random.rand(MAX_PK) + 1) world.attributes end @@ -60,4 +60,3 @@ end end - diff --git a/frameworks/Ruby/padrino/padrino-unicorn.dockerfile b/frameworks/Ruby/padrino/padrino-unicorn.dockerfile index 2ca282ab180..77e083211e9 100644 --- a/frameworks/Ruby/padrino/padrino-unicorn.dockerfile +++ b/frameworks/Ruby/padrino/padrino-unicorn.dockerfile @@ -9,7 +9,7 @@ COPY config.ru config.ru COPY Gemfile Gemfile COPY Rakefile Rakefile -RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile --path=/padrino/padrino/bundle +RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile RUN apt-get update -yqq && apt-get install -yqq nginx diff --git a/frameworks/Ruby/padrino/padrino.dockerfile b/frameworks/Ruby/padrino/padrino.dockerfile index 66605e2457d..78fd7774dea 100644 --- a/frameworks/Ruby/padrino/padrino.dockerfile +++ b/frameworks/Ruby/padrino/padrino.dockerfile @@ -9,7 +9,7 @@ COPY config.ru config.ru COPY Gemfile Gemfile COPY Rakefile Rakefile -RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile --path=/padrino/padrino/bundle +RUN bundle install --jobs=4 --gemfile=/padrino/Gemfile EXPOSE 8080 diff --git a/frameworks/Ruby/rack-sequel/Gemfile b/frameworks/Ruby/rack-sequel/Gemfile index 83d341118d0..fb4b4ad65d8 100644 --- a/frameworks/Ruby/rack-sequel/Gemfile +++ b/frameworks/Ruby/rack-sequel/Gemfile @@ -1,19 +1,19 @@ source 'https://rubygems.org' gem 'json', '~> 2.0' -gem 'passenger', '~> 5.1', :platforms=>[:ruby, :mswin], :require=>false +gem 'passenger', '~> 6.0', :platforms=>[:ruby, :mswin], :require=>false gem 'puma', '~> 6.4', :require=>false gem 'sequel', '~> 5.0' -gem 'rack', '2.0.8' -gem 'unicorn', '~> 5.2', :platforms=>[:ruby, :mswin], :require=>false +gem 'rack', '~> 3.0' +gem 'unicorn', '~> 6.1', :platforms=>[:ruby, :mswin], :require=>false group :mysql do gem 'jdbc-mysql', '~> 5.1', :platforms=>:jruby, :require=>'jdbc/mysql' - gem 'mysql2', '~> 0.4', :platforms=>[:ruby, :mswin] + gem 'mysql2', '~> 0.5', :platforms=>[:ruby, :mswin] end group :postgresql do gem 'jdbc-postgres', '~> 9.4', :platforms=>:jruby, :require=>'jdbc/postgres' - gem 'pg', '~> 0.19', :platforms=>[:ruby, :mswin] + gem 'pg', '~> 1.5', :platforms=>[:ruby, :mswin] gem 'sequel_pg', '~> 1.6', :platforms=>:ruby, :require=>false end diff --git a/frameworks/Ruby/rack-sequel/benchmark_config.json b/frameworks/Ruby/rack-sequel/benchmark_config.json index a298e84d371..30ba62a6223 100644 --- a/frameworks/Ruby/rack-sequel/benchmark_config.json +++ b/frameworks/Ruby/rack-sequel/benchmark_config.json @@ -3,17 +3,15 @@ "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": "Stripped", "classification": "Micro", "database": "MySQL", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", @@ -33,7 +31,7 @@ "approach": "Stripped", "classification": "Micro", "database": "Postgres", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", @@ -45,8 +43,6 @@ "notes": "" }, "passenger-mri": { - "json_url": "/json", - "db_url": "/db", "query_url": "/queries?queries=", "fortune_url": "/fortunes", "update_url": "/updates?queries=", @@ -55,7 +51,7 @@ "approach": "Stripped", "classification": "Micro", "database": "MySQL", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", @@ -75,7 +71,7 @@ "approach": "Stripped", "classification": "Micro", "database": "Postgres", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", @@ -87,17 +83,15 @@ "notes": "" }, "unicorn-mri": { - "json_url": "/json", "db_url": "/db", "query_url": "/queries?queries=", "fortune_url": "/fortunes", "update_url": "/updates?queries=", - "plaintext_url": "/plaintext", "port": 8080, "approach": "Stripped", "classification": "Micro", "database": "MySQL", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", @@ -117,7 +111,7 @@ "approach": "Stripped", "classification": "Micro", "database": "Postgres", - "framework": "rack-sequel", + "framework": "rack", "language": "Ruby", "orm": "Micro", "platform": "Rack", diff --git a/frameworks/Ruby/rack-sequel/benchmark_config.rb b/frameworks/Ruby/rack-sequel/benchmark_config.rb deleted file mode 100644 index 5aa58997825..00000000000 --- a/frameworks/Ruby/rack-sequel/benchmark_config.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'yaml' - -yaml = YAML.load(ARGF.read) -yaml["tests"][0].delete_if { |_, v| v["disabled"] } -puts JSON.pretty_generate(yaml) diff --git a/frameworks/Ruby/rack-sequel/benchmark_config.yaml b/frameworks/Ruby/rack-sequel/benchmark_config.yaml deleted file mode 100644 index 16ae74080e5..00000000000 --- a/frameworks/Ruby/rack-sequel/benchmark_config.yaml +++ /dev/null @@ -1,69 +0,0 @@ ---- -framework: rack-sequel -tests: - - default: &default - setup_file: run_mri_puma - json_url: /json - db_url: /db - query_url: /queries?queries= - fortune_url: /fortunes - update_url: /updates?queries= - plaintext_url: /plaintext - port: 8080 - approach: Stripped - classification: Micro - database: MySQL - framework: rack-sequel - language: Ruby - orm: Micro - platform: Rack - webserver: Puma - os: Linux - database_os: Linux - display_name: rack-sequel-puma-mri - versus: rack-puma-mri - notes: "" - postgres: - <<: *default - database: Postgres - display_name: rack-sequel-postgres-puma-mri - versus: ~ - puma-jruby: - <<: *default - setup_file: run_jruby_puma - display_name: rack-sequel-puma-jruby - versus: rack-puma-jruby - disabled: true - postgres-puma-jruby: - <<: *default - setup_file: run_jruby_puma - database: Postgres - display_name: rack-sequel-postgres-puma-jruby - versus: ~ - disabled: true - passenger-mri: - <<: *default - setup_file: run_mri_passenger - webserver: Passenger - display_name: rack-sequel-passenger-mri - versus: ~ - postgres-passenger-mri: - <<: *default - setup_file: run_mri_passenger - database: Postgres - webserver: Passenger - display_name: rack-sequel-postgres-passenger-mri - versus: ~ - unicorn-mri: - <<: *default - setup_file: run_mri_unicorn - webserver: Unicorn - display_name: rack-sequel-unicorn-mri - versus: rack-unicorn - postgres-unicorn-mri: - <<: *default - setup_file: run_mri_unicorn - database: Postgres - webserver: Unicorn - display_name: rack-sequel-postgres-unicorn-mri - versus: ~ diff --git a/frameworks/Ruby/rack-sequel/boot.rb b/frameworks/Ruby/rack-sequel/boot.rb index e012694c06a..e4de89199e9 100644 --- a/frameworks/Ruby/rack-sequel/boot.rb +++ b/frameworks/Ruby/rack-sequel/boot.rb @@ -3,9 +3,17 @@ require 'time' MAX_PK = 10_000 +ID_RANGE = (1..10_000).freeze +ALL_IDS = ID_RANGE.to_a QUERIES_MIN = 1 QUERIES_MAX = 500 SEQUEL_NO_ASSOCIATIONS = true +CONTENT_TYPE = 'Content-Type' +JSON_TYPE = 'application/json' +HTML_TYPE = 'text/html; charset=utf-8' +PLAINTEXT_TYPE = 'text/plain' +DATE_HEADER = 'Date' +SERVER_HEADER = 'Server' SERVER_STRING = if defined?(PhusionPassenger) diff --git a/frameworks/Ruby/rack-sequel/hello_world.rb b/frameworks/Ruby/rack-sequel/hello_world.rb index 8ecb1c75fca..77525d99e45 100644 --- a/frameworks/Ruby/rack-sequel/hello_world.rb +++ b/frameworks/Ruby/rack-sequel/hello_world.rb @@ -3,7 +3,7 @@ # Our Rack application to be executed by rackup class HelloWorld DEFAULT_HEADERS = {}.tap do |h| - h['Server'] = SERVER_STRING if SERVER_STRING + h[SERVER_HEADER] = SERVER_STRING if SERVER_STRING h.freeze end @@ -12,9 +12,7 @@ def bounded_queries(env) params = Rack::Utils.parse_query(env['QUERY_STRING']) queries = params['queries'].to_i - return QUERIES_MIN if queries < QUERIES_MIN - return QUERIES_MAX if queries > QUERIES_MAX - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end # Return a random number between 1 and MAX_PK @@ -31,8 +29,8 @@ def db def queries(env) DB.synchronize do - Array.new(bounded_queries(env)) do - WORLD_BY_ID.(:id=>rand1) + ALL_IDS.sample(bounded_queries(env)).map do |id| + WORLD_BY_ID.(id: id) end end end @@ -80,9 +78,9 @@ def fortunes def updates(env) DB.synchronize do - Array.new(bounded_queries(env)) do - world = WORLD_BY_ID.(:id=>rand1) - WORLD_UPDATE.(:id=>world[:id], :randomnumber=>(world[:randomnumber] = rand1)) + ALL_IDS.sample(bounded_queries(env)).map do |id| + world = WORLD_BY_ID.(id: id) + WORLD_UPDATE.(id: world[:id], randomnumber: (world[:randomnumber] = rand1)) world end end @@ -93,29 +91,29 @@ def call(env) case env['PATH_INFO'] when '/json' # Test type 1: JSON serialization - ['application/json', JSON.fast_generate(:message=>'Hello, World!')] + [JSON_TYPE, JSON.fast_generate(:message=>'Hello, World!')] when '/db' # Test type 2: Single database query - ['application/json', JSON.fast_generate(db)] + [JSON_TYPE, JSON.fast_generate(db)] when '/queries' # Test type 3: Multiple database queries - ['application/json', JSON.fast_generate(queries(env))] + [JSON_TYPE, JSON.fast_generate(queries(env))] when '/fortunes' # Test type 4: Fortunes - ['text/html; charset=utf-8', fortunes] + [HTML_TYPE, fortunes] when '/updates' # Test type 5: Database updates - ['application/json', JSON.fast_generate(updates(env))] + [JSON_TYPE, JSON.fast_generate(updates(env))] when '/plaintext' # Test type 6: Plaintext - ['text/plain', 'Hello, World!'] + [PLAINTEXT_TYPE, 'Hello, World!'] end [ 200, DEFAULT_HEADERS.merge( - 'Content-Type'=>content_type, - 'Date'=>Time.now.httpdate + CONTENT_TYPE => content_type, + DATE_HEADER => Time.now.httpdate ), body ] diff --git a/frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile index 381ea34a10b..7b82353185d 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel-passenger-mri.dockerfile @@ -4,12 +4,18 @@ ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true ENV DBTYPE=mysql -ENV RUBY_YJIT_ENABLE=1 RUN ruby -r /rack-sequel/config/auto_tune -e 'puts auto_tune.first' > instances diff --git a/frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile index d157b710c31..78053b6f376 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel-postgres-passenger-mri.dockerfile @@ -4,12 +4,18 @@ ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true ENV DBTYPE=postgresql -ENV RUBY_YJIT_ENABLE=1 RUN ruby -r /rack-sequel/config/auto_tune -e 'puts auto_tune.first' > instances diff --git a/frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile index 68f6665bf74..a3aca7b79bc 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel-postgres-unicorn-mri.dockerfile @@ -1,13 +1,19 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile ENV DBTYPE=postgresql -ENV RUBY_YJIT_ENABLE=1 EXPOSE 8080 diff --git a/frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile index 3737c034cda..8033d74c31a 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel-postgres.dockerfile @@ -1,13 +1,19 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile ENV DBTYPE=postgresql -ENV RUBY_YJIT_ENABLE=1 EXPOSE 8080 diff --git a/frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile index 846d25d0532..6df05c0c2b6 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel-unicorn-mri.dockerfile @@ -1,13 +1,19 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile ENV DBTYPE=mysql -ENV RUBY_YJIT_ENABLE=1 EXPOSE 8080 diff --git a/frameworks/Ruby/rack-sequel/rack-sequel.dockerfile b/frameworks/Ruby/rack-sequel/rack-sequel.dockerfile index 796978d6d52..470d92aa4b3 100644 --- a/frameworks/Ruby/rack-sequel/rack-sequel.dockerfile +++ b/frameworks/Ruby/rack-sequel/rack-sequel.dockerfile @@ -1,13 +1,19 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /rack-sequel WORKDIR /rack-sequel -RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile --path=/rack-sequel/rack-sequel/bundle +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +RUN bundle install --jobs=4 --gemfile=/rack-sequel/Gemfile ENV DBTYPE=mysql -ENV RUBY_YJIT_ENABLE=1 EXPOSE 8080 diff --git a/frameworks/Ruby/rack/Gemfile b/frameworks/Ruby/rack/Gemfile index 137e71e099c..af0fc5b1d04 100644 --- a/frameworks/Ruby/rack/Gemfile +++ b/frameworks/Ruby/rack/Gemfile @@ -2,13 +2,13 @@ source 'https://rubygems.org' -gem 'rack', '~>3.0' -gem 'connection_pool', '~>2.4' -gem 'falcon', '~>0.42', platforms: %i[ruby mswin] +gem 'rack', '~> 3.0' +gem 'connection_pool', '~> 2.4' +gem 'falcon', '~> 0.47', platforms: %i[ruby mswin] gem 'jdbc-postgres', '~> 42.2', platforms: :jruby, require: 'jdbc/postgres' gem 'json', '~> 2.6', platforms: :jruby gem 'oj', '~> 3.14', platforms: %i[ruby mswin] -gem 'pg', '~>1.5', platforms: %i[ruby mswin] +gem 'pg', '~> 1.5', platforms: %i[ruby mswin] gem 'puma', '~> 6.4' gem 'sequel' gem 'sequel_pg', platforms: %i[ruby mswin] diff --git a/frameworks/Ruby/rack/Gemfile.lock b/frameworks/Ruby/rack/Gemfile.lock index d8bc4105c68..75e57b3ea0e 100644 --- a/frameworks/Ruby/rack/Gemfile.lock +++ b/frameworks/Ruby/rack/Gemfile.lock @@ -2,118 +2,135 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - async (2.5.0) - console (~> 1.10) - io-event (~> 1.1) + async (2.11.0) + console (~> 1.25, >= 1.25.2) + fiber-annotation + io-event (~> 1.5, >= 1.5.1) timers (~> 4.1) - async-container (0.16.12) - async - async-io - async-http (0.60.1) - async (>= 1.25) - async-io (>= 1.28) - async-pool (>= 0.2) - protocol-http (~> 0.24.0) - protocol-http1 (~> 0.15.0) - protocol-http2 (~> 0.15.0) - traces (>= 0.8.0) + async-container (0.18.2) + async (~> 2.10) + async-http (0.66.3) + async (>= 2.10.2) + async-pool (>= 0.6.1) + io-endpoint (~> 0.10, >= 0.10.3) + io-stream (~> 0.4) + protocol-http (~> 0.26.0) + protocol-http1 (~> 0.19.0) + protocol-http2 (~> 0.17.0) + traces (>= 0.10.0) async-http-cache (0.4.3) async-http (~> 0.56) - async-io (1.34.3) - async - async-pool (0.4.0) + async-pool (0.6.1) async (>= 1.25) - build-environment (1.13.0) - concurrent-ruby (1.2.2) - connection_pool (2.4.0) - console (1.16.2) - fiber-local - falcon (0.42.3) + async-service (0.12.0) async - async-container (~> 0.16.0) - async-http (~> 0.57) + async-container (~> 0.16) + bigdecimal (3.1.8) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + console (1.25.2) + fiber-annotation + fiber-local (~> 1.1) + json + falcon (0.47.6) + async + async-container (~> 0.18) + async-http (~> 0.66, >= 0.66.3) async-http-cache (~> 0.4.0) - async-io (~> 1.22) - build-environment (~> 1.13) + async-service (~> 0.10) bundler localhost (~> 1.1) openssl (~> 3.0) process-metrics (~> 0.2.0) - protocol-rack (~> 0.1) - samovar (~> 2.1) - fiber-local (1.0.0) - io-event (1.1.7) - json (2.6.3) + protocol-rack (~> 0.5) + samovar (~> 2.3) + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (0.1.0) + io-endpoint (0.10.3) + io-event (1.5.1) + io-stream (0.4.0) + json (2.7.2) kgio (2.11.4) - localhost (1.1.10) + language_server-protocol (3.17.0.3) + localhost (1.3.1) mapping (1.1.1) - nio4r (2.7.0) - oj (3.14.2) - openssl (3.1.0) - parallel (1.23.0) - parser (3.2.2.1) + nio4r (2.7.3) + oj (3.16.3) + bigdecimal (>= 3.0) + openssl (3.2.0) + parallel (1.24.0) + parser (3.3.1.0) ast (~> 2.4.1) - pg (1.5.3) + racc + pg (1.5.6) process-metrics (0.2.1) console (~> 1.8) samovar (~> 2.1) - protocol-hpack (1.4.2) - protocol-http (0.24.7) - protocol-http1 (0.15.1) + protocol-hpack (1.4.3) + protocol-http (0.26.5) + protocol-http1 (0.19.1) protocol-http (~> 0.22) - protocol-http2 (0.15.1) + protocol-http2 (0.17.0) protocol-hpack (~> 1.4) protocol-http (~> 0.18) - protocol-rack (0.2.4) + protocol-rack (0.5.1) protocol-http (~> 0.23) rack (>= 1.0) puma (6.4.2) nio4r (~> 2.0) - rack (3.0.9.1) + racc (1.7.3) + rack (3.0.11) rack-test (2.1.0) rack (>= 1.3) rainbow (3.1.1) raindrops (0.20.1) - regexp_parser (2.8.0) - rexml (3.2.5) - rubocop (1.51.0) + regexp_parser (2.9.1) + rexml (3.2.8) + strscan (>= 3.0.9) + rubocop (1.63.5) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.1) - parser (>= 3.2.1.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) - samovar (2.1.4) + samovar (2.3.0) console (~> 1.0) mapping (~> 1.0) - sequel (5.68.0) + sequel (5.80.0) + bigdecimal sequel_pg (1.17.1) pg (>= 0.18.0, != 1.2.0) sequel (>= 4.38.0) + strscan (3.1.0) timers (4.3.5) - traces (0.9.1) + traces (0.11.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2023.3) tzinfo (>= 1.0.0) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) PLATFORMS x86_64-darwin-20 + x86_64-darwin-22 x86_64-linux DEPENDENCIES connection_pool (~> 2.4) - falcon (~> 0.42) + falcon (~> 0.47) jdbc-postgres (~> 42.2) json (~> 2.6) oj (~> 3.14) diff --git a/frameworks/Ruby/rack/config/auto_tune.rb b/frameworks/Ruby/rack/config/auto_tune.rb index 476ed1a45bd..1e075f56911 100755 --- a/frameworks/Ruby/rack/config/auto_tune.rb +++ b/frameworks/Ruby/rack/config/auto_tune.rb @@ -7,7 +7,7 @@ # MAX_THREADS, add threads per process to reach MAX_THREADS. require 'etc' -KB_PER_WORKER = 128 * 1_024 # average of peak PSS of single-threaded processes (watch smem -k) +KB_PER_WORKER = 64 * 1_024 # average of peak PSS of single-threaded processes (watch smem -k) MIN_WORKERS = 2 MAX_WORKERS_PER_VCPU = 1.25 # virtual/logical MIN_THREADS_PER_WORKER = 1 diff --git a/frameworks/Ruby/rack/config/puma.rb b/frameworks/Ruby/rack/config/puma.rb index 83118c34761..4b5a210d689 100644 --- a/frameworks/Ruby/rack/config/puma.rb +++ b/frameworks/Ruby/rack/config/puma.rb @@ -6,7 +6,7 @@ # FWBM only... use the puma_auto_tune gem in production! num_workers, num_threads = auto_tune - +num_threads = [num_threads, 32].min before_fork do Sequel::DATABASES.each(&:disconnect) diff --git a/frameworks/Ruby/rack/hello_world.rb b/frameworks/Ruby/rack/hello_world.rb index d6886797fc0..be1cfe31a3e 100644 --- a/frameworks/Ruby/rack/hello_world.rb +++ b/frameworks/Ruby/rack/hello_world.rb @@ -54,8 +54,13 @@ class HelloWorld ' def initialize - # auto_tune - max_connections = 512 + if defined?(Puma) + num_workers, num_threads = auto_tune + num_threads = [num_threads, 32].min + max_connections = num_workers * num_threads + else + max_connections = 512 + end @db = PgDb.new(DEFAULT_DATABASE_URL, max_connections) end diff --git a/frameworks/Ruby/rack/pg_db.rb b/frameworks/Ruby/rack/pg_db.rb index deeb149f0ad..e8c8634c60c 100644 --- a/frameworks/Ruby/rack/pg_db.rb +++ b/frameworks/Ruby/rack/pg_db.rb @@ -37,60 +37,44 @@ def prepare_statements end def select_random_world - @world_select.call(id: random_id)[0] + select_world(random_id) end def select_world(id) - @world_select.call(id: id)[0] + @world_select.call(id: id).first end def validate_count(count) count = count.to_i - if count < MIN_QUERIES - MIN_QUERIES - elsif count > MAX_QUERIES - MAX_QUERIES - else - count - end + count.clamp(MIN_QUERIES, MAX_QUERIES) end def select_promises(count) count = validate_count(count) - promises = [] - count.times do + ALL_IDS.sample(count).map do |id| @connection.synchronize do - promises << @connection['SELECT id, randomNumber FROM World WHERE id = ?', random_id].async.first + @connection['SELECT id, randomNumber FROM World WHERE id = ?', id].async.first end end - promises end def select_random_numbers(count) count = validate_count(count) - results = [] - count.times do - results << @world_random_select.call(randomvalue: random_id, id: random_id)[0] + ALL_IDS.sample(count).map do |id| + @world_random_select.call(randomvalue: random_id, id: id).first end - results end def select_worlds(count) count = validate_count(count) - results = [] - count.times do - results << @world_select.call(id: random_id)[0] + ALL_IDS.sample(count).map do |id| + @world_select.call(id: id).first end - results end def select_worlds_async(count) promises = select_promises(count) - results = [] - promises.each do |p| - results << p.to_hash - end - results + promises.map(&:to_hash) end def update_worlds(count, async = false) @@ -111,6 +95,7 @@ def update_worlds(count, async = false) @connection[sql].update results end + def select_fortunes @fortune_select.call end diff --git a/frameworks/Ruby/rack/rack-falcon.dockerfile b/frameworks/Ruby/rack/rack-falcon.dockerfile index a8975a65038..ef5a63a10e7 100644 --- a/frameworks/Ruby/rack/rack-falcon.dockerfile +++ b/frameworks/Ruby/rack/rack-falcon.dockerfile @@ -1,12 +1,17 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + WORKDIR /rack COPY Gemfile ./ +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle config set without 'development test' RUN bundle install --jobs=8 diff --git a/frameworks/Ruby/rack/rack-unicorn.dockerfile b/frameworks/Ruby/rack/rack-unicorn.dockerfile index 11c017d61f2..bc4807e5427 100644 --- a/frameworks/Ruby/rack/rack-unicorn.dockerfile +++ b/frameworks/Ruby/rack/rack-unicorn.dockerfile @@ -1,14 +1,17 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc -#RUN apt-get update -yqq && apt-get install -yqq nginx - -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + WORKDIR /rack COPY Gemfile ./ +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle config set without 'development test' RUN bundle install --jobs=8 diff --git a/frameworks/Ruby/rack/rack.dockerfile b/frameworks/Ruby/rack/rack.dockerfile index 4ddda8e02c5..5b51b2ef1e0 100644 --- a/frameworks/Ruby/rack/rack.dockerfile +++ b/frameworks/Ruby/rack/rack.dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 diff --git a/frameworks/Ruby/rails/Gemfile b/frameworks/Ruby/rails/Gemfile index eb36722fcfa..39eb973e700 100644 --- a/frameworks/Ruby/rails/Gemfile +++ b/frameworks/Ruby/rails/Gemfile @@ -1,11 +1,9 @@ -ruby '~> 3.2' - source 'https://rubygems.org' -gem 'trilogy', group: :mysql gem 'oj', '~> 3.16' -gem 'pg', '1.5.4', group: :postgresql +gem 'pg', '~> 1.5', group: :postgresql gem 'puma', '~> 6.4' gem 'rails', '~> 7.1.3' gem 'redis', '~> 5.0' +gem 'trilogy', '~> 2.8.1', group: :mysql gem 'tzinfo-data' diff --git a/frameworks/Ruby/rails/Gemfile.lock b/frameworks/Ruby/rails/Gemfile.lock index 334455e2ac5..9d15aecbab6 100644 --- a/frameworks/Ruby/rails/Gemfile.lock +++ b/frameworks/Ruby/rails/Gemfile.lock @@ -1,35 +1,35 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.1) - actionpack (= 7.1.3.1) - activesupport (= 7.1.3.1) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.1) - actionpack (= 7.1.3.1) - activejob (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.1) - actionpack (= 7.1.3.1) - actionview (= 7.1.3.1) - activejob (= 7.1.3.1) - activesupport (= 7.1.3.1) + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.1) - actionview (= 7.1.3.1) - activesupport (= 7.1.3.1) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -37,35 +37,35 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.1) - actionpack (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.1) - activesupport (= 7.1.3.1) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.1) - activesupport (= 7.1.3.1) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.3.1) - activesupport (= 7.1.3.1) - activerecord (7.1.3.1) - activemodel (= 7.1.3.1) - activesupport (= 7.1.3.1) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) timeout (>= 0.4.0) - activestorage (7.1.3.1) - actionpack (= 7.1.3.1) - activejob (= 7.1.3.1) - activerecord (= 7.1.3.1) - activesupport (= 7.1.3.1) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) marcel (~> 1.0) - activesupport (7.1.3.1) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -76,22 +76,21 @@ GEM mutex_m tzinfo (~> 2.0) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) builder (3.2.4) concurrent-ruby (1.2.3) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) erubi (1.12.0) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.11.2) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) loofah (2.22.0) crass (~> 1.0.2) @@ -101,36 +100,37 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.22.2) + mini_portile2 (2.8.6) + minitest (5.23.1) mutex_m (0.2.0) - net-imap (0.4.10) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - nio4r (2.7.0) - nokogiri (1.16.2) + nio4r (2.7.3) + nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.2-arm64-darwin) + nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) - oj (3.16.1) - pg (1.5.4) + oj (3.16.3) + bigdecimal (>= 3.0) + pg (1.5.6) psych (5.1.2) stringio puma (6.4.2) nio4r (~> 2.0) - racc (1.7.3) - rack (3.0.9.1) + racc (1.8.0) + rack (3.0.11) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -138,20 +138,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.1) - actioncable (= 7.1.3.1) - actionmailbox (= 7.1.3.1) - actionmailer (= 7.1.3.1) - actionpack (= 7.1.3.1) - actiontext (= 7.1.3.1) - actionview (= 7.1.3.1) - activejob (= 7.1.3.1) - activemodel (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) bundler (>= 1.15.0) - railties (= 7.1.3.1) + railties (= 7.1.3.3) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -159,37 +159,36 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.1) - actionpack (= 7.1.3.1) - activesupport (= 7.1.3.1) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) - rake (13.1.0) + rake (13.2.1) rdoc (6.6.3.1) psych (>= 4.0.0) - redis (5.0.7) - redis-client (>= 0.9.0) - redis-client (0.17.0) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.2) connection_pool - reline (0.4.3) + reline (0.5.7) io-console (~> 0.5) - ruby2_keywords (0.0.5) stringio (3.1.0) thor (1.3.1) timeout (0.4.1) - trilogy (2.6.0) + trilogy (2.8.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2021.5) + tzinfo-data (1.2024.1) tzinfo (>= 1.0.0) webrick (1.8.1) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.13) + zeitwerk (2.6.14) PLATFORMS arm64-darwin-20 @@ -198,15 +197,12 @@ PLATFORMS DEPENDENCIES oj (~> 3.16) - pg (= 1.5.4) + pg (~> 1.5) puma (~> 6.4) rails (~> 7.1.3) redis (~> 5.0) - trilogy + trilogy (~> 2.8.1) tzinfo-data -RUBY VERSION - ruby 3.2.2p53 - BUNDLED WITH 2.3.3 diff --git a/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb b/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb index cb533d57a37..bdd96953ce8 100644 --- a/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb +++ b/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb @@ -7,7 +7,7 @@ class HelloWorldController < ApplicationController MAX_QUERIES = 500 # max number of records that can be retrieved def db - render json: World.find(random_id) + render json: World.find(random_id).attributes end def query @@ -33,13 +33,13 @@ def fortune end def update - worlds = Array.new(query_count) do - world = World.find(random_id) + worlds = ALL_IDS.sample(query_count).map do |id| + world = World.find(id) new_value = random_id new_value = random_id until new_value != world.randomNumber - world.update_columns(randomNumber: new_value) - world + { id: id, randomNumber: new_value } end + World.upsert_all(worlds.sort_by!{_1[:id]}) render json: worlds end @@ -48,10 +48,7 @@ def update def query_count queries = params[:queries].to_i - return MIN_QUERIES if queries < MIN_QUERIES - return MAX_QUERIES if queries > MAX_QUERIES - - queries + queries.clamp(MIN_QUERIES, MAX_QUERIES) end def random_id diff --git a/frameworks/Ruby/rails/app/controllers/plaintext_controller.rb b/frameworks/Ruby/rails/app/controllers/plaintext_controller.rb deleted file mode 100644 index 1afe3639c4d..00000000000 --- a/frameworks/Ruby/rails/app/controllers/plaintext_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class PlaintextController < ApplicationControllerMetal - def index - add_headers - self.content_type = 'text/plain' - self.response_body = 'Hello, World!' - end -end diff --git a/frameworks/Ruby/rails/config/database.yml b/frameworks/Ruby/rails/config/database.yml index 87c1e85a2ac..e4f159e0f72 100644 --- a/frameworks/Ruby/rails/config/database.yml +++ b/frameworks/Ruby/rails/config/database.yml @@ -16,6 +16,9 @@ test: production_mysql: <<: *default adapter: trilogy + ssl: true + ssl_mode: 4 <%# Trilogy::SSL_PREFERRED_NOVERIFY %> + tls_min_version: 3 <%# Trilogy::TLS_VERSION_12 %> production_postgresql: <<: *default diff --git a/frameworks/Ruby/rails/config/routes.rb b/frameworks/Ruby/rails/config/routes.rb index 5556bc3ed17..70b58d84bfc 100644 --- a/frameworks/Ruby/rails/config/routes.rb +++ b/frameworks/Ruby/rails/config/routes.rb @@ -6,6 +6,14 @@ get "queries", to: "hello_world#query" get "fortunes", to: "hello_world#fortune" get "updates", to: "hello_world#update" - get "plaintext", to: PlaintextController.action(:index) + get "plaintext", to: ->(env) do + [200, + { + 'Content-Type' => 'text/plain', + 'Date' => Time.now.httpdate, + 'Server' => 'Rails' + }, + ['Hello, World!']] + end get "cached", to: "hello_world#cached_query" end diff --git a/frameworks/Ruby/rails/rails-mysql.dockerfile b/frameworks/Ruby/rails/rails-mysql.dockerfile index 7129e9bd6d6..370b08ba493 100644 --- a/frameworks/Ruby/rails/rails-mysql.dockerfile +++ b/frameworks/Ruby/rails/rails-mysql.dockerfile @@ -5,6 +5,13 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-se EXPOSE 8080 WORKDIR /rails +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + COPY ./Gemfile* /rails/ ENV BUNDLE_FORCE_RUBY_PLATFORM=true @@ -13,7 +20,6 @@ RUN bundle install --jobs=8 COPY . /rails/ -ENV RUBY_YJIT_ENABLE=1 ENV RAILS_ENV=production_mysql ENV PORT=8080 ENV REDIS_URL=redis://localhost:6379/0 diff --git a/frameworks/Ruby/rails/rails.dockerfile b/frameworks/Ruby/rails/rails.dockerfile index d49a378e9bf..3e02770b190 100644 --- a/frameworks/Ruby/rails/rails.dockerfile +++ b/frameworks/Ruby/rails/rails.dockerfile @@ -5,6 +5,12 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-se EXPOSE 8080 WORKDIR /rails +ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + COPY ./Gemfile* /rails/ ENV BUNDLE_FORCE_RUBY_PLATFORM=true @@ -13,7 +19,6 @@ RUN bundle install --jobs=8 COPY . /rails/ -ENV RUBY_YJIT_ENABLE=1 ENV RAILS_ENV=production_postgresql ENV PORT=8080 ENV REDIS_URL=redis://localhost:6379/0 diff --git a/frameworks/Ruby/roda-sequel/boot.rb b/frameworks/Ruby/roda-sequel/boot.rb index 44e64ce917c..eafc7bd7932 100644 --- a/frameworks/Ruby/roda-sequel/boot.rb +++ b/frameworks/Ruby/roda-sequel/boot.rb @@ -3,6 +3,8 @@ require "time" require "oj" MAX_PK = 10_000 +QUERY_RANGE = (1..MAX_PK).freeze +ALL_IDS = QUERY_RANGE.to_a QUERIES_MIN = 1 QUERIES_MAX = 500 SEQUEL_NO_ASSOCIATIONS = true @@ -24,6 +26,13 @@ Bundler.require(:default) # Load core modules +CONTENT_TYPE = 'Content-Type' +JSON_TYPE = 'application/json' +HTML_TYPE = 'text/html; charset=utf-8' +PLAINTEXT_TYPE = 'text/plain' +DATE_HEADER = 'Date' +SERVER_HEADER = 'Server' + def connect(dbtype) Bundler.require(dbtype) # Load database-specific modules diff --git a/frameworks/Ruby/roda-sequel/hello_world.rb b/frameworks/Ruby/roda-sequel/hello_world.rb index 7d290896112..abd0d5b1487 100644 --- a/frameworks/Ruby/roda-sequel/hello_world.rb +++ b/frameworks/Ruby/roda-sequel/hello_world.rb @@ -7,9 +7,7 @@ class HelloWorld < Roda def bounded_queries queries = request.params["queries"].to_i - return QUERIES_MIN if queries < QUERIES_MIN - return QUERIES_MAX if queries > QUERIES_MAX - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end # Return a random number between 1 and MAX_PK @@ -18,33 +16,36 @@ def rand1 end route do |r| - response["Date"] = Time.now.httpdate - response["Server"] = SERVER_STRING if SERVER_STRING - #default content type - response["Content-Type"] = "application/json" + response[DATE_HEADER] = Time.now.httpdate + response[SERVER_HEADER] = SERVER_STRING if SERVER_STRING # Test type 1: JSON serialization r.is "json" do + response[CONTENT_TYPE] = JSON_TYPE { message: "Hello, World!" }.to_json end # Test type 2: Single database query r.is "db" do + response[CONTENT_TYPE] = JSON_TYPE World.with_pk(rand1).values.to_json end # Test type 3: Multiple database queries r.is "queries" do + response[CONTENT_TYPE] = JSON_TYPE worlds = DB.synchronize do - Array.new(bounded_queries) { World.with_pk(rand1).values } + ALL_IDS.sample(bounded_queries).map do |id| + World.with_pk(id).values + end end worlds.to_json end # Test type 4: Fortunes r.is "fortunes" do - response["Content-Type"] = "text/html; charset=utf-8" + response[CONTENT_TYPE] = HTML_TYPE @fortunes = Fortune.all @fortunes << Fortune.new( id: 0, @@ -56,10 +57,11 @@ def rand1 # Test type 5: Database updates r.is "updates" do + response[CONTENT_TYPE] = JSON_TYPE worlds = DB.synchronize do - Array.new(bounded_queries) do - world = World.with_pk(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + world = World.with_pk(id) new_value = rand1 new_value = rand1 while new_value == world.randomnumber world.update(randomnumber: new_value) @@ -71,7 +73,7 @@ def rand1 # Test type 6: Plaintext r.is "plaintext" do - response["Content-Type"] = "text/plain" + response[CONTENT_TYPE] = PLAINTEXT_TYPE "Hello, World!" end end diff --git a/frameworks/Ruby/roda-sequel/roda-sequel-passenger-mri.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel-passenger-mri.dockerfile index 2aad19e21e1..0af00a72d36 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel-passenger-mri.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel-passenger-mri.dockerfile @@ -3,9 +3,14 @@ FROM ruby:3.3 ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 # TODO: https://github.com/phusion/passenger/issues/1916 diff --git a/frameworks/Ruby/roda-sequel/roda-sequel-postgres-passenger-mri.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel-postgres-passenger-mri.dockerfile index 74aaf520136..a24b9881d00 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel-postgres-passenger-mri.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel-postgres-passenger-mri.dockerfile @@ -3,9 +3,14 @@ FROM ruby:3.3 ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 # TODO: https://github.com/phusion/passenger/issues/1916 diff --git a/frameworks/Ruby/roda-sequel/roda-sequel-postgres-unicorn-mri.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel-postgres-unicorn-mri.dockerfile index 2a7da65809e..3cde40eaa97 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel-postgres-unicorn-mri.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel-postgres-unicorn-mri.dockerfile @@ -1,11 +1,16 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/roda-sequel/roda-sequel-postgres.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel-postgres.dockerfile index d0f073132ca..c74c9b9f0d3 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel-postgres.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel-postgres.dockerfile @@ -1,11 +1,16 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/roda-sequel/roda-sequel-unicorn-mri.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel-unicorn-mri.dockerfile index 0595393d903..cda64c5c29b 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel-unicorn-mri.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel-unicorn-mri.dockerfile @@ -1,11 +1,16 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 ENV DBTYPE=mysql diff --git a/frameworks/Ruby/roda-sequel/roda-sequel.dockerfile b/frameworks/Ruby/roda-sequel/roda-sequel.dockerfile index 0988d366a1e..efa9d35597e 100644 --- a/frameworks/Ruby/roda-sequel/roda-sequel.dockerfile +++ b/frameworks/Ruby/roda-sequel/roda-sequel.dockerfile @@ -1,11 +1,16 @@ -FROM ruby:3.3 +FROM ruby:3.4-rc ADD ./ /roda-sequel WORKDIR /roda-sequel -ENV BUNDLE_FORCE_RUBY_PLATFORM=true ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 ENV DBTYPE=mysql diff --git a/frameworks/Ruby/sinatra-sequel/Gemfile b/frameworks/Ruby/sinatra-sequel/Gemfile index 8320982e7df..649fbcfe6bf 100644 --- a/frameworks/Ruby/sinatra-sequel/Gemfile +++ b/frameworks/Ruby/sinatra-sequel/Gemfile @@ -1,20 +1,18 @@ source 'https://rubygems.org' -gem 'json', '~> 2.0' -gem 'passenger', '~> 5.1', :platforms=>[:ruby, :mswin], :require=>false +gem 'oj' +gem 'passenger', '~> 6.0', :platforms=>[:ruby, :mswin], :require=>false gem 'puma', '~> 6.4', :require=>false gem 'sequel', '~> 5.0' -gem 'sinatra', '~> 2.0', :require=>'sinatra/base' +gem 'sinatra', '~> 3.0', :require=>'sinatra/base' gem 'slim', '~> 3.0' -gem 'unicorn', '~> 5.2', :platforms=>[:ruby, :mswin], :require=>false +gem 'unicorn', '~> 6.1', :platforms=>[:ruby, :mswin], :require=>false group :mysql do - gem 'jdbc-mysql', '~> 5.1', :platforms=>:jruby, :require=>'jdbc/mysql' - gem 'mysql2', '~> 0.4', :platforms=>[:ruby, :mswin] + gem 'mysql2', '~> 0.5', :platforms=>[:ruby, :mswin] end group :postgresql do - gem 'jdbc-postgres', '~> 9.4', :platforms=>:jruby, :require=>'jdbc/postgres' gem 'pg', '~> 1.5', :platforms=>[:ruby, :mswin] gem 'sequel_pg', '~> 1.6', :platforms=>:ruby, :require=>false end diff --git a/frameworks/Ruby/sinatra-sequel/README.md b/frameworks/Ruby/sinatra-sequel/README.md index a9e8e72728b..147e20cb2ed 100644 --- a/frameworks/Ruby/sinatra-sequel/README.md +++ b/frameworks/Ruby/sinatra-sequel/README.md @@ -17,7 +17,7 @@ The tests will be run with: * [Puma 6](http://puma.io) * [Passenger 5](https://www.phusionpassenger.com) * [Unicorn 5](https://bogomips.org/unicorn/) -* [Sinatra 2](http://www.sinatrarb.com) +* [Sinatra 3](http://www.sinatrarb.com) * [Sequel 5](http://sequel.jeremyevans.net) * [Slim 3](http://slim-lang.com) * [MySQL 5.5](https://www.mysql.com) diff --git a/frameworks/Ruby/sinatra-sequel/benchmark_config.json b/frameworks/Ruby/sinatra-sequel/benchmark_config.json index 906e08a6611..c16da1e0e26 100644 --- a/frameworks/Ruby/sinatra-sequel/benchmark_config.json +++ b/frameworks/Ruby/sinatra-sequel/benchmark_config.json @@ -11,7 +11,7 @@ "approach": "Realistic", "classification": "Micro", "database": "MySQL", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", @@ -31,7 +31,7 @@ "approach": "Realistic", "classification": "Micro", "database": "Postgres", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", @@ -51,7 +51,7 @@ "approach": "Realistic", "classification": "Micro", "database": "MySQL", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", @@ -71,7 +71,7 @@ "approach": "Realistic", "classification": "Micro", "database": "Postgres", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", @@ -91,7 +91,7 @@ "approach": "Realistic", "classification": "Micro", "database": "MySQL", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", @@ -111,7 +111,7 @@ "approach": "Realistic", "classification": "Micro", "database": "Postgres", - "framework": "sinatra-sequel", + "framework": "sinatra", "language": "Ruby", "orm": "Full", "platform": "Rack", diff --git a/frameworks/Ruby/sinatra-sequel/boot.rb b/frameworks/Ruby/sinatra-sequel/boot.rb index e012694c06a..44843e48341 100644 --- a/frameworks/Ruby/sinatra-sequel/boot.rb +++ b/frameworks/Ruby/sinatra-sequel/boot.rb @@ -1,8 +1,11 @@ # frozen_string_literal: true require 'bundler/setup' require 'time' +require 'oj' MAX_PK = 10_000 +ID_RANGE = (1..MAX_PK).freeze +ALL_IDS = ID_RANGE.to_a QUERIES_MIN = 1 QUERIES_MAX = 500 SEQUEL_NO_ASSOCIATIONS = true @@ -21,6 +24,8 @@ Bundler.require(:default) # Load core modules +Oj.mimic_JSON + def connect(dbtype) Bundler.require(dbtype) # Load database-specific modules diff --git a/frameworks/Ruby/sinatra-sequel/hello_world.rb b/frameworks/Ruby/sinatra-sequel/hello_world.rb index 4008a286b42..ccad94b8303 100644 --- a/frameworks/Ruby/sinatra-sequel/hello_world.rb +++ b/frameworks/Ruby/sinatra-sequel/hello_world.rb @@ -20,9 +20,7 @@ class HelloWorld < Sinatra::Base helpers do def bounded_queries queries = params[:queries].to_i - return QUERIES_MIN if queries < QUERIES_MIN - return QUERIES_MAX if queries > QUERIES_MAX - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end def json(data) @@ -58,8 +56,8 @@ def rand1 get '/queries' do worlds = DB.synchronize do - Array.new(bounded_queries) do - World.with_pk(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + World.with_pk(id) end end @@ -82,8 +80,8 @@ def rand1 get '/updates' do worlds = DB.synchronize do - Array.new(bounded_queries) do - world = World.with_pk(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + world = World.with_pk(id) new_value = rand1 new_value = rand1 while new_value == world.randomnumber world.update(randomnumber: new_value) diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-base.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-base.dockerfile index ff757c613a3..ce6cd9b6316 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-base.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-base.dockerfile @@ -5,4 +5,4 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-jruby-base.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-jruby-base.dockerfile deleted file mode 100644 index ff858dc6388..00000000000 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-jruby-base.dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM jruby:9.4-jdk17 - -ADD ./ /sinatra-sequel -WORKDIR /sinatra-sequel - -ENV THREAD_FACTOR=2 - -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-passenger-mri.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-passenger-mri.dockerfile index 6aa9e5c3cb8..fe497718534 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-passenger-mri.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-passenger-mri.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-passenger-mri.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-passenger-mri.dockerfile index f2c31645934..74defc8326e 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-passenger-mri.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-passenger-mri.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-unicorn-mri.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-unicorn-mri.dockerfile index 4a5a7d7bb68..9ac570ebfb9 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-unicorn-mri.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-unicorn-mri.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres.dockerfile index 3094fc88cc6..ab54544763d 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-unicorn-mri.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-unicorn-mri.dockerfile index fea0aff40c0..9ab1e96bd1d 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel-unicorn-mri.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel-unicorn-mri.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile ENV DBTYPE=mysql diff --git a/frameworks/Ruby/sinatra-sequel/sinatra-sequel.dockerfile b/frameworks/Ruby/sinatra-sequel/sinatra-sequel.dockerfile index 944d8fff20c..4ea3de0b7ad 100644 --- a/frameworks/Ruby/sinatra-sequel/sinatra-sequel.dockerfile +++ b/frameworks/Ruby/sinatra-sequel/sinatra-sequel.dockerfile @@ -5,7 +5,7 @@ ENV RUBY_YJIT_ENABLE=1 ADD ./ /sinatra-sequel WORKDIR /sinatra-sequel -RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile --path=/sinatra-sequel/sinatra-sequel/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile ENV DBTYPE=mysql diff --git a/frameworks/Ruby/sinatra/Gemfile b/frameworks/Ruby/sinatra/Gemfile index e606bd250d8..22752eec379 100644 --- a/frameworks/Ruby/sinatra/Gemfile +++ b/frameworks/Ruby/sinatra/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'activerecord', '~> 7.0', :require=>'active_record' -gem 'json', '~> 2.0' +gem 'oj' gem 'passenger', '~> 6.0', :platforms=>[:ruby, :mswin], :require=>false gem 'puma', '~> 6.4', :require=>false gem 'sinatra', '~> 3.0', :require=>'sinatra/base' diff --git a/frameworks/Ruby/sinatra/boot.rb b/frameworks/Ruby/sinatra/boot.rb old mode 100755 new mode 100644 index 3b6c615f85e..355fc53df74 --- a/frameworks/Ruby/sinatra/boot.rb +++ b/frameworks/Ruby/sinatra/boot.rb @@ -1,8 +1,11 @@ # frozen_string_literal: true require 'bundler/setup' require 'time' +require 'oj' MAX_PK = 10_000 +ID_RANGE = (1..MAX_PK).freeze +ALL_IDS = ID_RANGE.to_a QUERIES_MIN = 1 QUERIES_MAX = 500 @@ -20,6 +23,8 @@ Bundler.require(:default) # Load core modules +Oj.mimic_JSON + def connect(dbtype) Bundler.require(dbtype) # Load database-specific modules @@ -61,4 +66,4 @@ class Fortune < ActiveRecord::Base self.table_name = name end -ActiveRecord::Base.clear_active_connections! +ActiveRecord::Base.connection_handler.clear_active_connections! diff --git a/frameworks/Ruby/sinatra/hello_world.rb b/frameworks/Ruby/sinatra/hello_world.rb index 44d6d3af0dd..90238498ed2 100644 --- a/frameworks/Ruby/sinatra/hello_world.rb +++ b/frameworks/Ruby/sinatra/hello_world.rb @@ -17,9 +17,7 @@ class HelloWorld < Sinatra::Base helpers do def bounded_queries queries = params[:queries].to_i - return QUERIES_MIN if queries < QUERIES_MIN - return QUERIES_MAX if queries > QUERIES_MAX - queries + queries.clamp(QUERIES_MIN, QUERIES_MAX) end def json(data) @@ -42,7 +40,7 @@ def rand1 end if SERVER_STRING after do - ActiveRecord::Base.clear_active_connections! + ActiveRecord::Base.connection_handler.clear_active_connections! end # Test type 1: JSON serialization @@ -64,12 +62,12 @@ def rand1 get '/queries' do worlds = ActiveRecord::Base.connection_pool.with_connection do - Array.new(bounded_queries) do - World.find(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + World.find(id).attributes end end - json worlds.map!(&:attributes) + json worlds end # Test type 4: Fortunes @@ -90,16 +88,16 @@ def rand1 get '/updates' do worlds = ActiveRecord::Base.connection_pool.with_connection do - Array.new(bounded_queries) do - world = World.find(rand1) + ALL_IDS.sample(bounded_queries).map do |id| + world = World.find(id) new_value = rand1 new_value = rand1 while new_value == world.randomnumber - world.update(randomnumber: new_value) - world + world.update_columns(randomnumber: new_value) + world.attributes end end - json worlds.map!(&:attributes) + json worlds end # Test type 6: Plaintext diff --git a/frameworks/Ruby/sinatra/sinatra-passenger-mri.dockerfile b/frameworks/Ruby/sinatra/sinatra-passenger-mri.dockerfile index ccab0a6feac..df0ddd1fa46 100644 --- a/frameworks/Ruby/sinatra/sinatra-passenger-mri.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra-passenger-mri.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true diff --git a/frameworks/Ruby/sinatra/sinatra-postgres-passenger-mri.dockerfile b/frameworks/Ruby/sinatra/sinatra-postgres-passenger-mri.dockerfile index c74cf454967..0ad6b16252b 100644 --- a/frameworks/Ruby/sinatra/sinatra-postgres-passenger-mri.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra-postgres-passenger-mri.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile # TODO: https://github.com/phusion/passenger/issues/1916 ENV _PASSENGER_FORCE_HTTP_SESSION=true diff --git a/frameworks/Ruby/sinatra/sinatra-postgres-unicorn-mri.dockerfile b/frameworks/Ruby/sinatra/sinatra-postgres-unicorn-mri.dockerfile index ec3e0d2f8ff..36b1c1a4625 100644 --- a/frameworks/Ruby/sinatra/sinatra-postgres-unicorn-mri.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra-postgres-unicorn-mri.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/sinatra/sinatra-postgres.dockerfile b/frameworks/Ruby/sinatra/sinatra-postgres.dockerfile index 89784eed670..14025dafb3b 100644 --- a/frameworks/Ruby/sinatra/sinatra-postgres.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra-postgres.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile ENV DBTYPE=postgresql diff --git a/frameworks/Ruby/sinatra/sinatra-unicorn-mri.dockerfile b/frameworks/Ruby/sinatra/sinatra-unicorn-mri.dockerfile index 71871552328..a767ce78bb4 100644 --- a/frameworks/Ruby/sinatra/sinatra-unicorn-mri.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra-unicorn-mri.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile ENV DBTYPE=mysql diff --git a/frameworks/Ruby/sinatra/sinatra.dockerfile b/frameworks/Ruby/sinatra/sinatra.dockerfile index 729eba869be..3ff4f1f813e 100644 --- a/frameworks/Ruby/sinatra/sinatra.dockerfile +++ b/frameworks/Ruby/sinatra/sinatra.dockerfile @@ -2,10 +2,15 @@ FROM ruby:3.3 ENV RUBY_YJIT_ENABLE=1 +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + ADD ./ /sinatra WORKDIR /sinatra -RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile --path=/sinatra/sinatra/bundle +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile ENV DBTYPE=mysql diff --git a/frameworks/Rust/actix/Cargo.lock b/frameworks/Rust/actix/Cargo.lock index 180b200226d..35e34f98efc 100644 --- a/frameworks/Rust/actix/Cargo.lock +++ b/frameworks/Rust/actix/Cargo.lock @@ -1071,9 +1071,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", diff --git a/frameworks/Rust/axum/Cargo.lock b/frameworks/Rust/axum/Cargo.lock index dbda43b6d71..3d63ad71fb7 100644 --- a/frameworks/Rust/axum/Cargo.lock +++ b/frameworks/Rust/axum/Cargo.lock @@ -1793,9 +1793,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", @@ -2849,6 +2849,12 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" version = "0.2.89" @@ -2921,11 +2927,12 @@ checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "wasm-bindgen", + "redox_syscall", + "wasite", "web-sys", ] diff --git a/frameworks/Rust/may-minihttp/Cargo.toml b/frameworks/Rust/may-minihttp/Cargo.toml index 17e2b1d92ee..019aaf898a2 100644 --- a/frameworks/Rust/may-minihttp/Cargo.toml +++ b/frameworks/Rust/may-minihttp/Cargo.toml @@ -18,8 +18,8 @@ yarte = { version = "0.15", features = ["bytes-buf", "json"] } buf-min = { version = "0.7", features = ["bytes"] } may = { version = "0.3", default-features = false } -may_minihttp = { git = "https://github.com/Xudong-Huang/may_minihttp.git", rev = "f8241e7", default-features = false } -may_postgres = { git = "https://github.com/Xudong-Huang/may_postgres.git", rev = "bf1d86e", default-features = false } +may_minihttp = { version = "0.1", default-features = false } +may_postgres = { git = "https://github.com/Xudong-Huang/may_postgres.git", rev = "5ea3fb9", default-features = false } [profile.release] opt-level = 3 diff --git a/frameworks/Rust/may-minihttp/may-minihttp.dockerfile b/frameworks/Rust/may-minihttp/may-minihttp.dockerfile index bb614e239d5..0ddda28e3eb 100644 --- a/frameworks/Rust/may-minihttp/may-minihttp.dockerfile +++ b/frameworks/Rust/may-minihttp/may-minihttp.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.72 +FROM rust:1.78 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/may-minihttp/src/main.rs b/frameworks/Rust/may-minihttp/src/main.rs index 7eab3409ed1..f6a817031c3 100644 --- a/frameworks/Rust/may-minihttp/src/main.rs +++ b/frameworks/Rust/may-minihttp/src/main.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use bytes::BytesMut; use may_minihttp::{HttpService, HttpServiceFactory, Request, Response}; -use may_postgres::{self, types::ToSql, Client, Statement}; +use may_postgres::{types::ToSql, Client, Statement}; use nanorand::{Rng, WyRand}; use smallvec::SmallVec; use yarte::{ywrite_html, Serialize}; diff --git a/frameworks/Rust/ohkami/Cargo.lock b/frameworks/Rust/ohkami/Cargo.lock index 905a89d8a8e..b0bc7617d71 100644 --- a/frameworks/Rust/ohkami/Cargo.lock +++ b/frameworks/Rust/ohkami/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -32,18 +32,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "annotate-snippets" @@ -64,27 +64,17 @@ dependencies = [ "num-traits", ] -[[package]] -name = "atomic-write-file" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" -dependencies = [ - "nix", - "rand", -] - [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -115,9 +105,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -133,9 +123,9 @@ dependencies = [ [[package]] name = "byte_reader" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "087a18fc062e9ae6d8c0fc7d9afc22e373f3eda1244379eefabff7e2b2cad206" +checksum = "0fac67f5455e694831246ed9a2d62c98dbb7586281dcfaba6621888ac9b576df" [[package]] name = "byteorder" @@ -145,18 +135,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -203,9 +190,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -243,9 +230,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -291,9 +278,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" dependencies = [ "serde", ] @@ -333,9 +320,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "finl_unicode" @@ -430,7 +417,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -474,9 +461,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -519,9 +506,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -568,9 +555,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -587,9 +574,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" @@ -641,9 +628,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "md-5" @@ -657,9 +644,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "minimal-lexical" @@ -678,9 +665,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -705,17 +692,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -794,14 +770,15 @@ dependencies = [ [[package]] name = "ohkami" -version = "0.15.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e19a311d70d741f4a08f54374df6501bc2ebde819b5a69b95763ea2335f5f19" +checksum = "d810447a32af4750a45183a4915db5ca4183bb6d44b8e7731e63f627c581d93e" dependencies = [ "byte_reader", "hmac", "ohkami_lib", "ohkami_macros", + "rustc-hash", "serde", "serde_json", "sha2", @@ -810,7 +787,7 @@ dependencies = [ [[package]] name = "ohkami_framework_benchmarks" -version = "0.15.0" +version = "0.18.2" dependencies = [ "futures-util", "ohkami", @@ -822,15 +799,20 @@ dependencies = [ [[package]] name = "ohkami_lib" -version = "0.1.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf187aa0f73c2b91d9ac5c7eb1437c8d1a015d765d4fc3db8113c90a82ae2a0" +checksum = "4433e6c4c6c67a72afc306783ca8c641e69c9d171279fcab51f1f0c2d875e121" +dependencies = [ + "byte_reader", + "percent-encoding", + "serde", +] [[package]] name = "ohkami_macros" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c09a65693c4398af64b085040fe937f7d42d9b164306b5271fc169fa276db7" +checksum = "ffed4cd7e8c12a62c077273cb0f0fedf67ca3912488e5de1b325be85ca86bb06" dependencies = [ "proc-macro2", "quote", @@ -845,11 +827,11 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -866,7 +848,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -877,9 +859,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -933,9 +915,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -988,18 +970,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1045,9 +1027,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1057,9 +1039,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1068,9 +1050,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rsa" @@ -1098,6 +1080,12 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -1109,11 +1097,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1122,9 +1110,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "schannel" @@ -1143,9 +1131,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1156,9 +1144,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -1172,29 +1160,29 @@ checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -1225,9 +1213,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1253,18 +1241,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1305,9 +1293,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", @@ -1318,9 +1306,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ "ahash", "atoi", @@ -1328,7 +1316,6 @@ dependencies = [ "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener", "futures-channel", @@ -1359,9 +1346,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -1372,11 +1359,10 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ - "atomic-write-file", "dotenvy", "either", "heck", @@ -1399,13 +1385,13 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "bytes", "crc", @@ -1441,13 +1427,13 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "crc", "dotenvy", @@ -1468,7 +1454,6 @@ dependencies = [ "rand", "serde", "serde_json", - "sha1", "sha2", "smallvec", "sqlx-core", @@ -1480,9 +1465,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" dependencies = [ "atoi", "flume", @@ -1531,9 +1516,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -1542,9 +1527,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -1554,22 +1539,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -1589,9 +1574,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -1614,14 +1599,14 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -1657,7 +1642,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] @@ -1689,9 +1674,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -1771,11 +1756,21 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +dependencies = [ + "redox_syscall", + "wasite", +] [[package]] name = "winapi" @@ -1814,7 +1809,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -1834,17 +1829,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1855,9 +1851,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1867,9 +1863,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1879,9 +1875,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1891,9 +1893,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1903,9 +1905,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1915,9 +1917,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1927,9 +1929,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "yansi-term" @@ -2042,11 +2044,11 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.60", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "63381fa6624bf92130a6b87c0d07380116f80b565c42cf0d754136f0238359ef" diff --git a/frameworks/Rust/ohkami/Cargo.toml b/frameworks/Rust/ohkami/Cargo.toml index 15475ee8cd9..8a168f5c413 100644 --- a/frameworks/Rust/ohkami/Cargo.toml +++ b/frameworks/Rust/ohkami/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "ohkami_framework_benchmarks" -version = "0.15.0" +version = "0.18.2" edition = "2021" authors = ["kanarus "] [dependencies] -ohkami = { version = "=0.15.0", features = ["rt_tokio"] } -tokio = { version = "1.36.0" , features = ["full"] } +ohkami = { version = "=0.18.2", features = ["rt_tokio"] } +tokio = { version = "1.37.0" , features = ["full"] } rand = { version = "0.8.5" , features = ["small_rng"] } -sqlx = { version = "0.7.3" , features = ["postgres", "macros", "runtime-tokio-native-tls"] } +sqlx = { version = "0.7.4" , features = ["postgres", "macros", "runtime-tokio-native-tls"] } yarte = { version = "0.15.7" } -futures-util = { version = "0.3.30" } \ No newline at end of file +futures-util = { version = "0.3.30" } diff --git a/frameworks/Rust/ohkami/README.md b/frameworks/Rust/ohkami/README.md index 2d61eb2ee76..21b85f2cc50 100644 --- a/frameworks/Rust/ohkami/README.md +++ b/frameworks/Rust/ohkami/README.md @@ -4,7 +4,7 @@ > Build web app in intuitive and declarative code > - *macro-less and type-safe* APIs for intuitive and declarative code -> - *multi runtime* support:`tokio`, `async-std` +> - *multi runtime* support:`tokio`, `async-std`, `worker` (Cloudflare Workers) - [User Guide](https://docs.rs/ohkami/latest/ohkami/) - [API Documentation](https://docs.rs/ohkami/latest/ohkami/) diff --git a/frameworks/Rust/ohkami/ohkami.dockerfile b/frameworks/Rust/ohkami/ohkami.dockerfile index e528d58373e..97a69dd07ae 100644 --- a/frameworks/Rust/ohkami/ohkami.dockerfile +++ b/frameworks/Rust/ohkami/ohkami.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.76-slim-buster +FROM rust:1.78-slim-buster WORKDIR /ohkami_framework_benchmarks ENV DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world @@ -6,7 +6,6 @@ ENV MAX_CONNECTIONS=56 ENV MIN_CONNECTIONS=56 COPY ./src ./src -COPY ./templates ./templates COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.lock ./Cargo.lock @@ -16,4 +15,4 @@ RUN apt update && apt install -y --no-install-recommends \ RUN RUSTFLAGS="-C target-cpu=native" cargo build --release EXPOSE 8000 -CMD ./target/release/ohkami_framework_benchmarks \ No newline at end of file +CMD ./target/release/ohkami_framework_benchmarks diff --git a/frameworks/Rust/ohkami/src/fangs.rs b/frameworks/Rust/ohkami/src/fangs.rs new file mode 100644 index 00000000000..46a19808f46 --- /dev/null +++ b/frameworks/Rust/ohkami/src/fangs.rs @@ -0,0 +1,50 @@ +use ohkami::prelude::*; +use crate::Postgres; + + +#[derive(Clone)] +pub struct SetServer; +impl FangAction for SetServer { + #[inline(always)] + async fn back<'a>(&'a self, res: &'a mut ohkami::Response) { + res.headers.set().Server("ohkami"); + } +} + +impl Postgres { + pub async fn init() -> impl FangAction { + #[derive(Clone)] + pub struct UsePostgres(Postgres); + impl FangAction for UsePostgres { + #[inline(always)] + async fn fore<'a>(&'a self, req: &'a mut Request) -> Result<(), Response> { + Ok(req.memorize(self.0.clone())) + } + } + + macro_rules! load_env { + ($($name:ident as $t:ty)*) => {$( + #[allow(non_snake_case)] + let $name = ::std::env::var(stringify!($name)) + .expect(concat!( + "Failed to load environment variable ", + "`", stringify!($name), "`" + )) + .parse::<$t>() + .unwrap(); + )*}; + } load_env! { + MAX_CONNECTIONS as u32 + MIN_CONNECTIONS as u32 + DATABASE_URL as String + } + + let pool = sqlx::postgres::PgPoolOptions::new() + .max_connections(MAX_CONNECTIONS) + .min_connections(MIN_CONNECTIONS) + .connect(&DATABASE_URL).await + .unwrap(); + + UsePostgres(pool.into()) + } +} diff --git a/frameworks/Rust/ohkami/src/main.rs b/frameworks/Rust/ohkami/src/main.rs index bcac0f3a2ef..7473338dc5b 100644 --- a/frameworks/Rust/ohkami/src/main.rs +++ b/frameworks/Rust/ohkami/src/main.rs @@ -1,27 +1,21 @@ +mod fangs; +use fangs::SetServer; + mod models; -pub use models::{Fortune, Message, World, WorldsQuery}; +use models::{Fortune, Message, World, WorldsQuery}; mod postgres; -pub use postgres::Postgres; +use postgres::Postgres; mod templates; -pub use templates::FortunesTemplate; +use templates::FortunesTemplate; -use ohkami::{Ohkami, Route, Memory}; +use ohkami::prelude::*; +use ohkami::Memory; #[tokio::main] async fn main() { - struct SetServer; - impl ohkami::BackFang for SetServer { - type Error = std::convert::Infallible; - #[inline(always)] - async fn bite(&self, res: &mut ohkami::Response, _req: &ohkami::Request) -> Result<(), Self::Error> { - res.headers.set().Server("ohkami"); - Ok(()) - } - } - Ohkami::with((SetServer, Postgres::init().await), ( "/json" .GET(json_serialization), "/db" .GET(single_database_query), @@ -54,7 +48,6 @@ async fn fortunes(p: Memory<'_, Postgres>) -> FortunesTemplate { id: 0, message: String::from("Additional fortune added at request time."), }); - fortunes.sort_unstable_by(|a, b| str::cmp(&a.message, &b.message)); FortunesTemplate { fortunes } diff --git a/frameworks/Rust/ohkami/src/models.rs b/frameworks/Rust/ohkami/src/models.rs index 3896cedc28a..55eb8f8fa6d 100644 --- a/frameworks/Rust/ohkami/src/models.rs +++ b/frameworks/Rust/ohkami/src/models.rs @@ -1,7 +1,8 @@ -use ohkami::typed::{ResponseBody, Query}; +use ohkami::typed::{Payload, Query}; +use ohkami::builtin::payload::JSON; -#[ResponseBody(JSONS)] +#[Payload(JSON/S)] pub struct Message { pub message: &'static str, } @@ -13,7 +14,7 @@ pub struct Fortune { } #[derive(sqlx::FromRow)] -#[ResponseBody(JSONS)] +#[Payload(JSON/S)] pub struct World { pub id: i32, #[serde(rename="randomNumber")] diff --git a/frameworks/Rust/ohkami/src/postgres.rs b/frameworks/Rust/ohkami/src/postgres.rs index 3f5a50a02ea..7f29317d1ba 100644 --- a/frameworks/Rust/ohkami/src/postgres.rs +++ b/frameworks/Rust/ohkami/src/postgres.rs @@ -6,45 +6,9 @@ use crate::models::{World, Fortune}; #[derive(Clone)] pub struct Postgres(sqlx::PgPool); -impl Postgres { - pub async fn init() -> impl ohkami::FrontFang { - pub struct UsePostgres(Postgres); - - impl ohkami::FrontFang for UsePostgres { - type Error = std::convert::Infallible; - #[inline(always)] - async fn bite(&self, req: &mut ohkami::Request) -> Result<(), Self::Error> { - req.memorize(self.0.clone()); - Ok(()) - } - } - - macro_rules! load_env { - ($($name:ident as $t:ty)*) => { - $( - #[allow(non_snake_case)] - let $name = ::std::env::var(stringify!($name)) - .expect(concat!( - "Failed to load environment variable ", - "`", stringify!($name), "`" - )) - .parse::<$t>() - .unwrap(); - )* - }; - } load_env! { - MAX_CONNECTIONS as u32 - MIN_CONNECTIONS as u32 - DATABASE_URL as String - } - - UsePostgres(Self( - sqlx::postgres::PgPoolOptions::new() - .max_connections(MAX_CONNECTIONS) - .min_connections(MIN_CONNECTIONS) - .connect(&DATABASE_URL).await - .unwrap() - )) +impl From for Postgres { + fn from(pgpool: sqlx::PgPool) -> Self { + Self(pgpool) } } diff --git a/frameworks/Rust/ohkami/src/templates.rs b/frameworks/Rust/ohkami/src/templates.rs index d52ffcb2b3a..4b7f8e06e92 100644 --- a/frameworks/Rust/ohkami/src/templates.rs +++ b/frameworks/Rust/ohkami/src/templates.rs @@ -1,18 +1,23 @@ -use ohkami::{Response, IntoResponse}; +use ohkami::{IntoResponse, Response}; +use yarte::Template; use crate::models::Fortune; -#[derive(yarte::Template)] -#[template(path="fortunes")] +#[derive(Template)] +#[template(src = r#"Fortunes + {{~# each fortunes ~}} + + {{~/each ~}} +
idmessage
{{id}}{{message}}
"#)] pub struct FortunesTemplate { pub fortunes: Vec, } + impl IntoResponse for FortunesTemplate { - #[inline(always)] fn into_response(self) -> Response { - ohkami::utils::HTML( - ::call(&self) - .expect("Failed to render fortunes template") - ).into_response() + match self.call() { + Ok(template) => Response::OK().with_html(template), + Err(_) => Response::InternalServerError(), + } } } diff --git a/frameworks/Rust/ohkami/templates/fortunes.hbs b/frameworks/Rust/ohkami/templates/fortunes.hbs deleted file mode 100644 index 988cf4fbe93..00000000000 --- a/frameworks/Rust/ohkami/templates/fortunes.hbs +++ /dev/null @@ -1,5 +0,0 @@ -Fortunes - {{~# each fortunes ~}} - - {{~/each ~}} -
idmessage
{{id}}{{message}}
\ No newline at end of file diff --git a/frameworks/Rust/pavex/Cargo.lock b/frameworks/Rust/pavex/Cargo.lock index cf9569133b4..d9f8310b9d6 100644 --- a/frameworks/Rust/pavex/Cargo.lock +++ b/frameworks/Rust/pavex/Cargo.lock @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", diff --git a/frameworks/Rust/rocket/.gitignore b/frameworks/Rust/rocket/.gitignore index 2eea525d885..b153885fd09 100644 --- a/frameworks/Rust/rocket/.gitignore +++ b/frameworks/Rust/rocket/.gitignore @@ -1 +1,3 @@ -.env \ No newline at end of file +.env + +Cargo.lock diff --git a/frameworks/Rust/rocket/Cargo.lock b/frameworks/Rust/rocket/Cargo.lock index b22dcf8b1f9..99bf76ca11b 100644 --- a/frameworks/Rust/rocket/Cargo.lock +++ b/frameworks/Rust/rocket/Cargo.lock @@ -3,129 +3,113 @@ version = 3 [[package]] -name = "aead" -version = "0.5.1" +name = "addr2line" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", + "gimli", ] [[package]] -name = "aes-gcm" -version = "0.10.1" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" dependencies = [ + "cfg-if", "getrandom", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] -name = "annotate-snippets" -version = "0.9.1" +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36" -dependencies = [ - "unicode-width", - "yansi-term", -] +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "atoi" -version = "0.4.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] [[package]] name = "atomic" -version = "0.5.1" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + +[[package]] +name = "atomic" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" dependencies = [ - "autocfg", + "bytemuck", ] [[package]] -name = "atty" -version = "0.2.14" +name = "atomic-write-file" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi 0.3.9", + "nix", + "rand", ] [[package]] @@ -135,16 +119,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "base64" -version = "0.13.1" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" -version = "0.20.0" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "binascii" @@ -158,44 +157,50 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +dependencies = [ + "serde", +] + [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] -name = "bumpalo" -version = "3.11.1" +name = "bytemuck" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" - -[[package]] -name = "cfg-if" -version = "0.1.10" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -204,82 +209,70 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cipher" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "convert_case" -version = "0.4.0" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "cookie" -version = "0.16.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" dependencies = [ - "aes-gcm", - "base64 0.20.0", - "hkdf", - "hmac", "percent-encoding", - "rand", - "sha2", - "subtle", "time", "version_check", ] [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "1.1.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] -name = "crossbeam-queue" -version = "0.3.8" +name = "crossbeam-channel" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] -name = "crossbeam-utils" -version = "0.8.14" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if 1.0.0", + "crossbeam-utils", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "crypto-common" version = "0.1.6" @@ -287,37 +280,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", "typenum", ] [[package]] -name = "ctr" -version = "0.9.2" +name = "der" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "cipher", + "const-oid", + "pem-rfc7468", + "zeroize", ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "deranged" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn", + "powerfmt", ] [[package]] name = "devise" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" +checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" dependencies = [ "devise_codegen", "devise_core", @@ -325,9 +315,9 @@ dependencies = [ [[package]] name = "devise_codegen" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" +checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" dependencies = [ "devise_core", "quote", @@ -335,104 +325,79 @@ dependencies = [ [[package]] name = "devise_core" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" +checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" dependencies = [ - "bitflags", + "bitflags 2.4.2", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn", -] - -[[package]] -name = "diesel" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d" -dependencies = [ - "bitflags", - "byteorder", - "diesel_derives", - "pq-sys", - "r2d2", -] - -[[package]] -name = "diesel_derives" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] [[package]] -name = "dirs" -version = "4.0.0" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "either" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", + "serde", ] [[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - -[[package]] -name = "dtoa" -version = "1.0.5" +name = "encoding_rs" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] [[package]] -name = "either" -version = "1.8.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "encoding_rs" -version = "0.8.31" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cfg-if 1.0.0", + "libc", + "windows-sys 0.52.0", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "etcetera" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] [[package]] name = "event-listener" @@ -442,20 +407,17 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "1.8.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "figment" -version = "0.10.8" +version = "0.10.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" +checksum = "2b6e5bc7bd59d60d0d45a6ccab6cf0f4ce28698fb4e81e750ddf229c9b824026" dependencies = [ - "atomic", + "atomic 0.6.0", "pear", "serde", "toml", @@ -465,75 +427,65 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "finl_unicode" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] -name = "form_urlencoded" -version = "1.1.0" +name = "flume" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "percent-encoding", + "futures-core", + "futures-sink", + "spin 0.9.8", ] [[package]] -name = "fsevent" -version = "0.4.0" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "fsevent-sys" -version = "2.0.1" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "libc", + "percent-encoding", ] [[package]] -name = "fuchsia-zircon" -version = "0.3.3" +name = "fsevent-sys" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ - "bitflags", - "fuchsia-zircon-sys", + "libc", ] -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -542,9 +494,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -552,15 +504,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -569,54 +521,42 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot", ] [[package]] name = "futures-io" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" - -[[package]] -name = "futures-macro" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", "futures-io", - "futures-macro", "futures-sink", "futures-task", "memchr", @@ -627,9 +567,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266041a359dfa931b370ef684cceb84b166beb14f7f0421f4a6a3d0c446d12e" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" dependencies = [ "cc", "libc", @@ -640,9 +580,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -650,24 +590,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] [[package]] -name = "ghash" -version = "0.5.0" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" -dependencies = [ - "opaque-debug", - "polyval", -] +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -677,9 +613,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -687,7 +623,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -696,9 +632,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.6" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -710,60 +646,37 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.11.2", + "hashbrown", ] [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -773,9 +686,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -789,11 +702,20 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -802,9 +724,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -819,15 +741,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -849,9 +771,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -859,23 +781,13 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.1.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", + "serde", ] [[package]] @@ -886,11 +798,11 @@ checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" [[package]] name = "inotify" -version = "0.7.1" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ - "bitflags", + "bitflags 1.3.2", "inotify-sys", "libc", ] @@ -905,64 +817,49 @@ dependencies = [ ] [[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" +name = "is-terminal" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ + "hermit-abi", "libc", + "windows-sys 0.52.0", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "js-sys" -version = "0.3.60" +name = "kqueue" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ - "wasm-bindgen", + "kqueue-sys", + "libc", ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "kqueue-sys" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "bitflags 1.3.2", + "libc", ] [[package]] @@ -970,24 +867,44 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] -name = "lazycell" -version = "1.3.0" +name = "libm" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "libc" -version = "0.2.139" +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -995,12 +912,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "loom" @@ -1008,7 +922,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "generator", "scoped-tls", "serde", @@ -1023,29 +937,30 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1054,65 +969,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "mio" -version = "0.6.23" +name = "miniz_oxide" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", + "adler", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", "wasi", - "windows-sys", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "windows-sys 0.48.0", ] [[package]] name = "multer" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed4198ce7a4cbd2a57af78d28c6fbb57d81ac5f1d6ad79ac6c5587419cbdf22" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ "bytes", "encoding_rs", @@ -1122,28 +1003,28 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.4", + "spin 0.9.8", "tokio", "tokio-util", "version_check", ] [[package]] -name = "net2" -version = "0.2.38" +name = "nix" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "cfg-if 0.1.10", + "bitflags 2.4.2", + "cfg-if", "libc", - "winapi 0.3.9", ] [[package]] name = "nom" -version = "7.1.2" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -1151,29 +1032,30 @@ dependencies = [ [[package]] name = "normpath" -version = "0.3.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04aaf5e9cb0fbf883cc0423159eacdf96a9878022084b35c462c428cab73bcaf" +checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] name = "notify" -version = "4.0.17" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags", + "bitflags 2.4.2", + "crossbeam-channel", "filetime", - "fsevent", "fsevent-sys", "inotify", + "kqueue", "libc", - "mio 0.6.23", - "mio-extras", + "log", + "mio", "walkdir", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -1183,39 +1065,86 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", + "libm", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.17.0" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -1223,17 +1152,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -1241,47 +1159,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.5", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-targets 0.48.5", ] [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pear" -version = "0.2.3" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +checksum = "4ccca0f6c17acc81df8e242ed473ec144cbf5c98037e69aa6d144780aad103c8" dependencies = [ "inlinable_string", "pear_codegen", @@ -1290,37 +1194,47 @@ dependencies = [ [[package]] name = "pear_codegen" -version = "0.2.3" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +checksum = "2e22670e8eb757cff11d6c199ca7b987f352f0346e0be4dd23869ec72cb53c77" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn", + "syn 2.0.50", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", ] [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.5.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cbd939b234e95d72bc393d51788aec68aeeb5d51e748ca08ff3aad58cb722f7" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.5.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81186863f3d0a27340815be8f2078dd8050b14cd71913db9fbda795e5f707d7" +checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" dependencies = [ "pest", "pest_generator", @@ -1328,22 +1242,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a1ef20bf3193c15ac345acb32e26b3dc3223aff4d77ae4fc5359567683796b" +checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "pest_meta" -version = "2.5.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3b284b1f13a20dc5ebc90aff59a51b8d7137c221131b52a7260c08cbc1cc80" +checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" dependencies = [ "once_cell", "pest", @@ -1352,9 +1266,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1363,84 +1277,75 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "polyval" -version = "0.6.0" +name = "pkcs1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug", - "universal-hash", + "der", + "pkcs8", + "spki", ] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] [[package]] -name = "pq-sys" -version = "0.4.7" +name = "pkg-config" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b845d6d8ec554f972a2c5298aad68953fd64e7441e846075450b44656a016d1" -dependencies = [ - "vcpkg", -] +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] -name = "prettyplease" -version = "0.1.23" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" -dependencies = [ - "proc-macro2", - "syn", -] +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "proc-macro2-diagnostics" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", "version_check", "yansi", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] -[[package]] -name = "r2d2" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" -dependencies = [ - "log", - "parking_lot 0.12.1", - "scheduled-thread-pool", -] - [[package]] name = "rand" version = "0.8.5" @@ -1473,53 +1378,43 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", + "bitflags 1.3.2", ] [[package]] name = "ref-cast" -version = "1.0.14" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" +checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.14" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" +checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "regex" -version = "1.7.0" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", ] [[package]] @@ -1528,60 +1423,67 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", - "spin 0.5.2", + "spin 0.9.8", "untrusted", - "web-sys", - "winapi 0.3.9", + "windows-sys 0.52.0", ] [[package]] name = "rocket" -version = "0.5.0-rc.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ead083fce4a405feb349cf09abdf64471c6077f14e0ce59364aa90d4b99317" +checksum = "9e7bb57ccb26670d73b6a47396c83139447b9e7878cab627fdfe9ea8da489150" dependencies = [ "async-stream", "async-trait", - "atomic", - "atty", + "atomic 0.5.3", "binascii", "bytes", "either", "figment", "futures", - "indexmap 1.9.2", + "indexmap", "log", "memchr", "multer", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "rand", "ref-cast", @@ -1602,25 +1504,26 @@ dependencies = [ [[package]] name = "rocket_codegen" -version = "0.5.0-rc.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6aeb6bb9c61e9cd2c00d70ea267bf36f76a4cc615e5908b349c2f9d93999b47" +checksum = "a2238066abf75f21be6cd7dc1a09d5414a671f4246e384e49fe3f8a4936bd04c" dependencies = [ "devise", "glob", - "indexmap 1.9.2", + "indexmap", "proc-macro2", "quote", "rocket_http", - "syn", + "syn 2.0.50", "unicode-xid", + "version_check", ] [[package]] name = "rocket_db_pools" -version = "0.1.0-rc.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc154f4f4985a136e2d59c336474a56da02103993f5e637e3a5424971ee4eff" +checksum = "f0ebde3e24cbe917062b862136fd532d1ace80e0377a2f5fed541fadd764f1e5" dependencies = [ "rocket", "rocket_db_pools_codegen", @@ -1630,9 +1533,9 @@ dependencies = [ [[package]] name = "rocket_db_pools_codegen" -version = "0.1.0-rc.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa8f9b37bb1d4827aa5cca400d74e91d30f4352713cb65d6e7427bafe21336c" +checksum = "184a6f59eed0bf3d1cccb091960a2a1c89efa829b8a41158b269985a9c1bee95" dependencies = [ "devise", "quote", @@ -1640,29 +1543,29 @@ dependencies = [ [[package]] name = "rocket_dyn_templates" -version = "0.1.0-rc.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab13df598440527c200f46fb944dc55d8d67a1818b617eb5a3981dcd8b63fd2" +checksum = "04bfc006e547e4f72b760ab861f5943b688aed8a82c4977b5500c98f5d17dbfa" dependencies = [ - "glob", "handlebars", "normpath", "notify", "rocket", + "walkdir", ] [[package]] name = "rocket_http" -version = "0.5.0-rc.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ded65d127954de3c12471630bf4b81a2792f065984461e65b91d0fdaafc17a2" +checksum = "37a1663694d059fe5f943ea5481363e48050acedd241d46deb2e27f71110389e" dependencies = [ "cookie", "either", "futures", "http", "hyper", - "indexmap 1.9.2", + "indexmap", "log", "memchr", "pear", @@ -1679,86 +1582,96 @@ dependencies = [ ] [[package]] -name = "rocket_sync_db_pools" -version = "0.1.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fa48b6ab25013e9812f1b0c592741900b3a2a83c0936292e0565c0ac842f558" +name = "rocket_techempower" +version = "0.5.0" dependencies = [ - "diesel", - "r2d2", + "rand", "rocket", - "rocket_sync_db_pools_codegen", - "serde", - "tokio", + "rocket_db_pools", + "rocket_dyn_templates", + "sqlx", ] [[package]] -name = "rocket_sync_db_pools_codegen" -version = "0.1.0-rc.2" +name = "rsa" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280ef2d232923e69cb93da156972eb5476a7cce5ba44843f6608f46a4abf7aab" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "devise", - "quote", + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", ] [[package]] -name = "rocket_techempower" -version = "0.4.0" -dependencies = [ - "async-stream", - "async-trait", - "diesel", - "dotenv", - "figment", - "futures", - "futures-util", - "proc-macro2", - "rand", - "rocket", - "rocket_db_pools", - "rocket_dyn_templates", - "rocket_sync_db_pools", - "serde", - "serde_derive", - "serde_json", - "sqlx", - "yarte", -] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustix" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "semver", + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.19.1" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ - "base64 0.13.1", - "log", "ring", + "rustls-webpki", "sct", - "webpki", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -1769,15 +1682,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scheduled-thread-pool" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" -dependencies = [ - "parking_lot 0.12.1", -] - [[package]] name = "scoped-tls" version = "1.0.1" @@ -1786,51 +1690,45 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", ] -[[package]] -name = "semver" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" - [[package]] name = "serde" -version = "1.0.152" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -1838,68 +1736,87 @@ dependencies = [ ] [[package]] -name = "sha-1" -version = "0.10.1" +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "slab" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.4.7" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -1910,15 +1827,28 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.4" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] [[package]] name = "sqlformat" -version = "0.1.8" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ "itertools", "nom", @@ -1927,94 +1857,202 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.5.13" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" +checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.5.13" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" +checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" dependencies = [ "ahash", "atoi", - "base64 0.13.1", - "bitflags", "byteorder", "bytes", "crc", "crossbeam-queue", - "dirs", + "dotenvy", "either", "event-listener", "futures-channel", "futures-core", "futures-intrusive", + "futures-io", "futures-util", "hashlink", "hex", - "hkdf", - "hmac", - "indexmap 1.9.2", - "itoa", - "libc", + "indexmap", "log", - "md-5", "memchr", "once_cell", "paste", "percent-encoding", - "rand", "rustls", + "rustls-pemfile", "serde", "serde_json", - "sha-1", "sha2", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror", + "tokio", "tokio-stream", + "tracing", "url", - "webpki", "webpki-roots", - "whoami", ] [[package]] name = "sqlx-macros" -version = "0.5.13" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" +checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" dependencies = [ - "dotenv", - "either", + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +dependencies = [ + "atomic-write-file", + "dotenvy", + "either", "heck", + "hex", "once_cell", "proc-macro2", "quote", + "serde", + "serde_json", "sha2", "sqlx-core", - "sqlx-rt", - "syn", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.5.13" +name = "sqlx-mysql" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" +checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" dependencies = [ + "atoi", + "base64", + "bitflags 2.4.2", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +dependencies = [ + "atoi", + "base64", + "bitflags 2.4.2", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", ] [[package]] @@ -2028,34 +2066,46 @@ dependencies = [ [[package]] name = "state" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" dependencies = [ "loom", ] [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ + "finl_unicode", "unicode-bidi", "unicode-normalization", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "1.0.107" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -2064,54 +2114,56 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", + "rustix", + "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.3.17" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ + "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -2119,16 +2171,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -2143,56 +2196,44 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", - "mio 0.8.5", + "mio", "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls", - "tokio", - "webpki", + "syn 2.0.50", ] [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -2201,9 +2242,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2215,11 +2256,36 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ + "indexmap", "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -2230,11 +2296,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2242,20 +2308,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.50", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -2263,20 +2329,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -2292,36 +2358,36 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ubyte" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c81f0dae7d286ad0d9366d7679a77934cfc3cf3a8d67e82669794412b2368fe6" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" dependencies = [ "serde", ] [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uncased" -version = "0.9.7" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" dependencies = [ "serde", "version_check", @@ -2329,36 +2395,30 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - -[[package]] -name = "unicode-width" -version = "0.1.10" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-xid" @@ -2372,27 +2432,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "universal-hash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2400,20 +2450,10 @@ dependencies = [ ] [[package]] -name = "v_eval" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd8b599d797eb038d0dde9a3860aacb6bbba3bffa4ac64f807c8673820cc9d9" -dependencies = [ - "regex", - "syn", -] - -[[package]] -name = "v_htmlescape" -version = "0.15.8" +name = "urlencoding" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "valuable" @@ -2435,9 +2475,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -2445,11 +2485,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -2460,347 +2499,229 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" +name = "webpki-roots" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" +name = "whoami" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "web-sys" -version = "0.3.60" +name = "winapi-util" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "js-sys", - "wasm-bindgen", + "winapi", ] [[package]] -name = "webpki" -version = "0.21.4" +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "webpki-roots" -version = "0.21.1" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "webpki", + "windows-targets 0.48.5", ] [[package]] -name = "whoami" -version = "1.3.0" +name = "windows-sys" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "wasm-bindgen", - "web-sys", + "windows-targets 0.48.5", ] [[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows-targets 0.52.0", ] [[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "winapi 0.3.9", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.39.0" +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_msvc 0.39.0", - "windows_i686_gnu 0.39.0", - "windows_i686_msvc 0.39.0", - "windows_x86_64_gnu 0.39.0", - "windows_x86_64_msvc 0.39.0", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows_aarch64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", -] +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.39.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.39.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.39.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.39.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.39.0" +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - -[[package]] -name = "yansi-term" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "yarte" -version = "0.15.7" +name = "windows_x86_64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfce1df93f3b16e5272221a559e60bbbaaa71dbc042a43996d223e51a690aab2" -dependencies = [ - "yarte_derive", - "yarte_helpers", -] +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] -name = "yarte_codegen" -version = "0.15.6" +name = "winnow" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1cf72076dbf4d39fe4779b58380d7213dcb3995d00666dd2d109f1b45879ea4" +checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" dependencies = [ - "proc-macro2", - "quote", - "syn", - "yarte_helpers", - "yarte_hir", + "memchr", ] [[package]] -name = "yarte_derive" -version = "0.15.6" +name = "yansi" +version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b296edd7e1a81717b6f794baa2de8dfe89646050847161550b2d963b3ca6fe80" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" dependencies = [ - "proc-macro2", - "quote", - "syn", - "yarte_codegen", - "yarte_helpers", - "yarte_hir", - "yarte_parser", + "is-terminal", ] [[package]] -name = "yarte_helpers" -version = "0.15.7" +name = "zerocopy" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfe1ef3558dde14b4be5387bdd41e3bd45746570743521470ec3e9cd0826679" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "dtoa", - "itoa", - "prettyplease", - "serde", - "syn", - "toml", - "v_htmlescape", + "zerocopy-derive", ] [[package]] -name = "yarte_hir" -version = "0.15.6" +name = "zerocopy-derive" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee42d2f704a3b1d8bc111d47a705d1302a0943d85e4c230f4e8300ee0dde4a6" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ - "derive_more", "proc-macro2", "quote", - "syn", - "v_eval", - "v_htmlescape", - "yarte_helpers", - "yarte_parser", + "syn 2.0.50", ] [[package]] -name = "yarte_parser" -version = "0.15.2" +name = "zeroize" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538f72049cf7104e12d5c444048d112cb8fc788a31308afd912442a381ba860c" -dependencies = [ - "annotate-snippets", - "derive_more", - "proc-macro2", - "quote", - "serde", - "syn", - "unicode-xid", - "yarte_helpers", -] +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/frameworks/Rust/rocket/Cargo.toml b/frameworks/Rust/rocket/Cargo.toml index 1863cbf4f12..9fc55725ba2 100644 --- a/frameworks/Rust/rocket/Cargo.toml +++ b/frameworks/Rust/rocket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rocket_techempower" -version = "0.4.0" +version = "0.5.0" authors = [ "Marcelo Barbosa ", "Brendan Hansknecht ", @@ -17,27 +17,15 @@ opt-level = 3 name = "rocket" path = "src/main.rs" -[[bin]] -name = "rocket-diesel" -path = "rocket-diesel/main.rs" +# The Diesel version is broken +#[[bin]] +#name = "rocket-diesel" +#path = "rocket-diesel/main.rs" [dependencies] -diesel = { version = "1.4", features = ["postgres"] } -rocket_sync_db_pools = { version = "0.1.0-rc.2", default-features = false, features = ["diesel_postgres_pool"] } -rocket_dyn_templates = { version = "0.1.0-rc.2", features = ["handlebars"] } -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -serde_derive = "1.0" -dotenv = "0.15.0" -figment = "0.10.6" +#rocket_sync_db_pools = { version = "0.1.0", default-features = false, features = ["diesel_postgres_pool"] } rand = { version = "0.8", features = ["small_rng"] } -rocket = { version = "0.5.0-rc.2", features = [ "json" ] } -rocket_db_pools = { version = "0.1.0-rc.2", features = [ "sqlx_postgres" ] } -sqlx = { version = "0.5.13", features = [ "postgres", "macros" ] } -yarte = "0.15.6" -# temp issue https://github.com/SergioBenitez/Rocket/issues/2491 -proc-macro2 = "= 1.0.51" -async-stream = "0.3.3" -async-trait = "0.1.53" -futures = "0.3.21" -futures-util = "0.3.21" +rocket = { version = "0.5.0", features = [ "json" ] } +rocket_db_pools = { version = "0.1.0", features = [ "sqlx_postgres" ] } +rocket_dyn_templates = { version = "0.1.0", features = ["handlebars"] } +sqlx = { version = "0.7", features = ["macros"] } diff --git a/frameworks/Rust/rocket/Rocket.toml b/frameworks/Rust/rocket/Rocket.toml new file mode 100644 index 00000000000..cc0ff76b043 --- /dev/null +++ b/frameworks/Rust/rocket/Rocket.toml @@ -0,0 +1,8 @@ +[default] +address = "0.0.0.0" +port = 8000 +log_level = "off" + +[default.databases.hello_world] +url = "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world" +connect_timeout = 5 diff --git a/frameworks/Rust/rocket/benchmark_config.json b/frameworks/Rust/rocket/benchmark_config.json index e4643fe6c08..2569f14f9ef 100755 --- a/frameworks/Rust/rocket/benchmark_config.json +++ b/frameworks/Rust/rocket/benchmark_config.json @@ -1,53 +1,54 @@ { "framework": "rocket", "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "fortune_url": "/fortunes", - "query_url": "/queries?q=", - "update_url": "/updates?q=", - "port": 8000, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Rocket", - "language": "Rust", - "flavor": "None", - "orm": "Full", - "platform": "Rust", - "webserver": "Hyper", - "os": "Linux", - "database_os": "Linux", - "display_name": "Rocket", - "notes": "", - "versus": "None", - "tags": ["broken"] - }, - "diesel": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "fortune_url": "/fortunes", - "query_url": "/queries?q=", - "update_url": "/updates?q=", - "port": 8000, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Rocket", - "language": "Rust", - "flavor": "None", - "orm": "Full", - "platform": "Rust", - "webserver": "Hyper", - "os": "Linux", - "database_os": "Linux", - "display_name": "Rocket (Diesel)", - "notes": "", - "versus": "None", - "tags": ["broken"] - } - }] + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "fortune_url": "/fortunes", + "query_url": "/queries?q=", + "update_url": "/updates?q=", + "port": 8000, + "approach": "Realistic", + "classification": "Fullstack", + "database": "Postgres", + "framework": "Rocket", + "language": "Rust", + "flavor": "None", + "orm": "Full", + "platform": "Rust", + "webserver": "Hyper", + "os": "Linux", + "database_os": "Linux", + "display_name": "Rocket", + "notes": "", + "versus": "None" + }, + "diesel": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "fortune_url": "/fortunes", + "query_url": "/queries?q=", + "update_url": "/updates?q=", + "port": 8000, + "approach": "Realistic", + "classification": "Fullstack", + "database": "Postgres", + "framework": "Rocket", + "language": "Rust", + "flavor": "None", + "orm": "Full", + "platform": "Rust", + "webserver": "Hyper", + "os": "Linux", + "database_os": "Linux", + "display_name": "Rocket (Diesel)", + "notes": "", + "versus": "None", + "tags": [ + "broken" + ] + } + }] } diff --git a/frameworks/Rust/rocket/rocket-diesel.dockerfile b/frameworks/Rust/rocket/rocket-diesel.dockerfile index a64eeb4fd37..e7cb90c8a3a 100644 --- a/frameworks/Rust/rocket/rocket-diesel.dockerfile +++ b/frameworks/Rust/rocket/rocket-diesel.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.63 +FROM rust:1.76-slim ENV ROCKET_BENCHMARK_DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world diff --git a/frameworks/Rust/rocket/rocket.dockerfile b/frameworks/Rust/rocket/rocket.dockerfile index 1d5cba3cd5a..c351f586c26 100644 --- a/frameworks/Rust/rocket/rocket.dockerfile +++ b/frameworks/Rust/rocket/rocket.dockerfile @@ -1,10 +1,4 @@ -FROM rust:1.60-slim - -ENV ROCKET_BENCHMARK_DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world - -RUN apt-get update && apt-get install -y --no-install-recommends \ - libpq-dev \ -&& rm -rf /var/lib/apt/lists/* +FROM rust:1.76 ADD ./ /rocket WORKDIR /rocket diff --git a/frameworks/Rust/rocket/rust-toolchain.toml b/frameworks/Rust/rocket/rust-toolchain.toml deleted file mode 100644 index 292fe499e3b..00000000000 --- a/frameworks/Rust/rocket/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "stable" diff --git a/frameworks/Rust/rocket/src/main.rs b/frameworks/Rust/rocket/src/main.rs index 6bcbb9e8bfe..017bf8bc026 100644 --- a/frameworks/Rust/rocket/src/main.rs +++ b/frameworks/Rust/rocket/src/main.rs @@ -1,24 +1,14 @@ -#[macro_use] -extern crate rocket; -extern crate dotenv; -extern crate serde_derive; - mod database; mod models; -use std::env; -use std::net::{IpAddr, Ipv4Addr}; +use std::fmt::Write; -use dotenv::dotenv; -use figment::Figment; use rand::{self, Rng}; -use rocket::{Build, Rocket}; -use rocket::config::{Config, LogLevel}; -use rocket::response::content::RawHtml; +use rocket::{launch, get, routes}; use rocket::serde::json::Json; -use rocket_db_pools::{sqlx, Connection, Database}; -use sqlx::Acquire; -use yarte::Template; +use rocket_db_pools::{Connection, Database}; +use rocket_db_pools::sqlx; +use rocket_dyn_templates::{Template, context}; use database::HelloWorld; use models::{Fortune, Message, World}; @@ -28,12 +18,11 @@ fn plaintext() -> &'static str { "Hello, World!" } +const MESSAGE: Message = Message { message: "Hello, World!" }; + #[get("/json")] fn json() -> Json { - let message = Message { - message: "Hello, World!".into(), - }; - Json(message) + Json(MESSAGE) } fn random_id() -> i32 { @@ -42,16 +31,18 @@ fn random_id() -> i32 { rng.gen_range(1..=10_000) } +async fn query_random_world(db: &mut Connection) -> World { + let world_id = random_id(); + sqlx::query_as("SELECT id, randomnumber FROM World WHERE id = $1") + .bind(world_id) + .fetch_one(db.as_mut()) + .await + .expect("Error querying world") +} + #[get("/db")] async fn db(mut db: Connection) -> Json { - let number = random_id(); - let result: World = sqlx::query_as("SELECT id, randomnumber FROM World WHERE id = $1") - .bind(number) - .fetch_one(&mut *db) - .await - .ok() - .expect("error loading world"); - Json(result) + Json(query_random_world(&mut db).await) } #[get("/queries")] @@ -65,31 +56,19 @@ async fn queries(mut db: Connection, q: u16) -> Json> { let mut results = Vec::with_capacity(q.into()); for _ in 0..q { - let query_id = random_id(); - let result: World = sqlx::query_as("SELECT * FROM World WHERE id = $1") - .bind(query_id) - .fetch_one(&mut *db) - .await - .ok() - .expect("error loading world"); - results.push(result); + let world = query_random_world(&mut db).await; + + results.push(world); } Json(results) } -#[derive(Template)] -#[template(path = "fortunes.html.hbs")] -pub struct FortunesTemplate<'a> { - pub fortunes: &'a Vec, -} - #[get("/fortunes")] -async fn fortunes(mut db: Connection) -> RawHtml { +async fn fortunes(mut db: Connection) -> Template { let mut fortunes: Vec = sqlx::query_as("SELECT * FROM Fortune") - .fetch_all(&mut *db) + .fetch_all(db.as_mut()) .await - .ok() .expect("Could not load Fortunes"); fortunes.push(Fortune { @@ -99,13 +78,9 @@ async fn fortunes(mut db: Connection) -> RawHtml { fortunes.sort_by(|a, b| a.message.cmp(&b.message)); - RawHtml( - FortunesTemplate { - fortunes: &fortunes, - } - .call() - .expect("error rendering template"), - ) + Template::render("fortunes", context! { + fortunes: fortunes + }) } #[get("/updates")] @@ -119,70 +94,57 @@ async fn updates(mut db: Connection, q: u16) -> Json> { let mut results = Vec::with_capacity(q.into()); for _ in 0..q { - let query_id = random_id(); - let mut result: World = sqlx::query_as("SELECT * FROM World WHERE id = $1") - .bind(query_id) - .fetch_one(&mut *db) - .await - .ok() - .expect("World was not found"); - - result.random_number = random_id(); - results.push(result); + let mut world = query_random_world(&mut db).await; + + world.random_number = random_id(); + results.push(world); } - let mut pool = db.into_inner(); - let mut tx = pool - .begin() - .await - .ok() - .expect("could not start transaction"); + let query_string = { + let mut query = String::new(); + + query.push_str("UPDATE World SET randomnumber = CASE id "); + + let mut pl = 1; + + for _ in 1..=q { + let _ = write!(query, "when ${pl} then ${} ", pl + 1); + pl += 2; + } + + query.push_str("ELSE randomnumber END WHERE id IN ("); + + for _ in 1..=q { + let _ = write!(query, "${pl},"); + pl += 1; + } + + query.pop(); + query.push(')'); + + query + }; + + let mut query = sqlx::query(&query_string); for w in &results { - sqlx::query("UPDATE World SET randomnumber = $1 WHERE id = $2") - .bind(w.random_number) - .bind(w.id) - .execute(&mut tx) - .await - .ok() - .expect("Could not update World"); + query = query.bind(w.id).bind(w.random_number); } - tx.commit().await.ok().expect("could not update worlds"); + for w in &results { + query = query.bind(w.id); + } + + query.execute(db.as_mut()) + .await + .expect("Could not update worlds"); Json(results) } #[launch] -pub fn launch() -> Rocket { - if cfg!(not(test)) { - dotenv().ok(); - } - - let config = Config { - address: IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), - port: 8000, - keep_alive: 0, - log_level: LogLevel::Off, - ..Default::default() - }; - - let database_url = env::var("ROCKET_BENCHMARK_DATABASE_URL") - .ok() - .expect("ROCKET_BENCHMARK_DATABASE_URL environment variable was not set"); - - let figment = Figment::from(config).merge(( - "databases.hello_world", - rocket_db_pools::Config { - url: database_url, - min_connections: None, - max_connections: 100, - connect_timeout: 3, - idle_timeout: None, - }, - )); - - rocket::custom(figment) +pub fn launch() -> _ { + rocket::build() .mount( "/", routes![ @@ -197,4 +159,5 @@ pub fn launch() -> Rocket { ], ) .attach(HelloWorld::init()) + .attach(Template::fairing()) } diff --git a/frameworks/Rust/rocket/src/models.rs b/frameworks/Rust/rocket/src/models.rs index 2e9f5b3f3bf..9f4184985ba 100644 --- a/frameworks/Rust/rocket/src/models.rs +++ b/frameworks/Rust/rocket/src/models.rs @@ -1,13 +1,12 @@ use rocket::serde::{Deserialize, Serialize}; -use sqlx::FromRow; -use std::borrow::Cow; +use rocket_db_pools::sqlx::FromRow; #[derive(Serialize)] +#[serde(crate = "rocket::serde")] pub struct Message { - pub message: Cow<'static, str>, + pub message: &'static str, } -#[allow(non_snake_case)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, FromRow)] #[serde(crate = "rocket::serde")] pub struct Fortune { @@ -15,7 +14,6 @@ pub struct Fortune { pub message: String, } -#[allow(non_snake_case)] #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, FromRow)] #[serde(crate = "rocket::serde")] pub struct World { diff --git a/frameworks/Rust/salvo/Cargo.toml b/frameworks/Rust/salvo/Cargo.toml index cbeaff5e350..0ac4ec76ee3 100644 --- a/frameworks/Rust/salvo/Cargo.toml +++ b/frameworks/Rust/salvo/Cargo.toml @@ -40,8 +40,8 @@ anyhow = "1" async-trait = "0.1" bytes = "1" diesel = { version = "2", features = ["postgres", "r2d2"] } -deadpool = { version = "0.10", features = ["rt_tokio_1", "serde", "async-trait", "managed"] } -deadpool-postgres = "0.11" +deadpool = { version = "0.11", features = ["rt_tokio_1", "serde", "managed"] } +deadpool-postgres = "0.13" futures-util = "0.3" lru = "0.12.0" markup = "0.15" @@ -49,7 +49,7 @@ markup = "0.15" mongodb = { version = "2.4.0", features = ["zstd-compression", "snappy-compression", "zlib-compression"] } once_cell = "1" rand = { version = "0.8", features = ["min_const_gen", "small_rng"] } -salvo = { version = "0.63", default-features = false, features = ["anyhow", "server", "http1", "affix"] } +salvo = { version = "0.67", default-features = false, features = ["anyhow", "server", "http1", "affix"] } serde = { version = "1", features = ["derive"] } serde_json = "1" # smallvec = "1" diff --git a/frameworks/Rust/salvo/salvo-diesel.dockerfile b/frameworks/Rust/salvo/salvo-diesel.dockerfile index 81a2dbaa0a8..a0bb3a12d8d 100644 --- a/frameworks/Rust/salvo/salvo-diesel.dockerfile +++ b/frameworks/Rust/salvo/salvo-diesel.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world ENV TECHEMPOWER_MAX_POOL_SIZE=28 diff --git a/frameworks/Rust/salvo/salvo-lru.dockerfile b/frameworks/Rust/salvo/salvo-lru.dockerfile index 8cb63d2c03e..f209991e939 100644 --- a/frameworks/Rust/salvo/salvo-lru.dockerfile +++ b/frameworks/Rust/salvo/salvo-lru.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world diff --git a/frameworks/Rust/salvo/salvo-mongo-raw.dockerfile b/frameworks/Rust/salvo/salvo-mongo-raw.dockerfile index ca7a5c8b495..4219a6534c6 100644 --- a/frameworks/Rust/salvo/salvo-mongo-raw.dockerfile +++ b/frameworks/Rust/salvo/salvo-mongo-raw.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017 ENV TECHEMPOWER_MAX_POOL_SIZE=28 diff --git a/frameworks/Rust/salvo/salvo-mongo.dockerfile b/frameworks/Rust/salvo/salvo-mongo.dockerfile index 77fccfa0a50..caac03db963 100644 --- a/frameworks/Rust/salvo/salvo-mongo.dockerfile +++ b/frameworks/Rust/salvo/salvo-mongo.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017 ENV TECHEMPOWER_MAX_POOL_SIZE=28 diff --git a/frameworks/Rust/salvo/salvo-pg-pool.dockerfile b/frameworks/Rust/salvo/salvo-pg-pool.dockerfile index 40947697908..13628c45050 100644 --- a/frameworks/Rust/salvo/salvo-pg-pool.dockerfile +++ b/frameworks/Rust/salvo/salvo-pg-pool.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world ENV TECHEMPOWER_MAX_POOL_SIZE=28 diff --git a/frameworks/Rust/salvo/salvo-pg.dockerfile b/frameworks/Rust/salvo/salvo-pg.dockerfile index b4c10866c21..0b5c075fb63 100644 --- a/frameworks/Rust/salvo/salvo-pg.dockerfile +++ b/frameworks/Rust/salvo/salvo-pg.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world diff --git a/frameworks/Rust/salvo/salvo-sqlx.dockerfile b/frameworks/Rust/salvo/salvo-sqlx.dockerfile index d3d0f56080b..5866030195a 100644 --- a/frameworks/Rust/salvo/salvo-sqlx.dockerfile +++ b/frameworks/Rust/salvo/salvo-sqlx.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ENV TECHEMPOWER_POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world ENV TECHEMPOWER_MAX_POOL_SIZE=56 diff --git a/frameworks/Rust/salvo/salvo.dockerfile b/frameworks/Rust/salvo/salvo.dockerfile index 186f5d755ee..b0d748a60ab 100644 --- a/frameworks/Rust/salvo/salvo.dockerfile +++ b/frameworks/Rust/salvo/salvo.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74 +FROM rust:1.77 ADD ./ /salvo WORKDIR /salvo diff --git a/frameworks/Rust/salvo/src/main.rs b/frameworks/Rust/salvo/src/main.rs index db6c6d704d0..1326a09b57c 100644 --- a/frameworks/Rust/salvo/src/main.rs +++ b/frameworks/Rust/salvo/src/main.rs @@ -4,7 +4,6 @@ use std::sync::Arc; use bytes::Bytes; -use salvo::conn::tcp::TcpAcceptor; use salvo::http::body::ResBody; use salvo::http::header::{self, HeaderValue}; use salvo::prelude::*; @@ -50,7 +49,8 @@ fn main() { } async fn serve(router: Arc) { - let acceptor: TcpAcceptor = utils::reuse_listener().unwrap().try_into().unwrap(); + // let acceptor: TcpAcceptor = utils::reuse_listener().unwrap().try_into().unwrap(); + let acceptor = TcpListener::new("0.0.0.0:8080").bind().await; let mut server = Server::new(acceptor); let http1 = server.http1_mut(); http1.pipeline_flush(true); diff --git a/frameworks/Rust/trillium/Cargo.lock b/frameworks/Rust/trillium/Cargo.lock index ab1aceee5e0..6875427cc51 100644 --- a/frameworks/Rust/trillium/Cargo.lock +++ b/frameworks/Rust/trillium/Cargo.lock @@ -2,11 +2,26 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -17,9 +32,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -32,15 +47,15 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -110,7 +125,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -146,23 +161,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 5.0.0", - "event-listener-strategy 0.5.0", + "event-listener 5.3.0", + "event-listener-strategy 0.5.1", "futures-core", "pin-project-lite", ] +[[package]] +name = "async-compat" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f68a707c1feb095d8c07f8a65b9f506b117d30af431cab89374357de7c11461b" +dependencies = [ + "futures-core", + "futures-io", + "once_cell", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-executor" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "5f98c37cf288e302c16ef6c8472aad1e034c6c84ce5ea7b8101c98eb4a802fee" dependencies = [ "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.0.2", + "futures-lite 2.3.0", "slab", ] @@ -174,10 +202,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.2.0", "async-executor", - "async-io 2.3.1", + "async-io 2.3.2", "async-lock 3.3.0", "blocking", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "once_cell", ] @@ -197,24 +225,24 @@ dependencies = [ "polling 2.8.0", "rustix 0.37.27", "slab", - "socket2", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-io" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.4.0", - "rustix 0.38.31", + "polling 3.6.0", + "rustix 0.38.32", "slab", "tracing", "windows-sys 0.52.0", @@ -246,9 +274,9 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io 2.3.1", + "async-io 2.3.2", "blocking", - "futures-lite 2.2.0", + "futures-lite 2.3.0", ] [[package]] @@ -296,7 +324,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -307,13 +335,13 @@ checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -338,20 +366,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "atomic-write-file" -version = "0.1.2" +name = "autocfg" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" -dependencies = [ - "nix", - "rand", -] +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] -name = "autocfg" -version = "1.1.0" +name = "backtrace" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" @@ -359,11 +392,17 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "basic-toml" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" dependencies = [ "serde", ] @@ -376,9 +415,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] [[package]] name = "block-buffer" @@ -398,24 +440,18 @@ dependencies = [ "async-channel 2.2.0", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "piper", "tracing", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytecount" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -425,49 +461,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" [[package]] name = "cfg-if" @@ -501,20 +503,10 @@ dependencies = [ ] [[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "cpufeatures" @@ -527,9 +519,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -542,9 +534,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -583,6 +575,17 @@ dependencies = [ "typenum", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -610,6 +613,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -631,9 +635,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -650,9 +654,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -677,15 +681,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] - [[package]] name = "etcetera" version = "0.8.0" @@ -716,9 +711,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.0.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", @@ -737,11 +732,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" dependencies = [ - "event-listener 5.0.0", + "event-listener 5.3.0", "pin-project-lite", ] @@ -756,9 +751,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "finl_unicode" @@ -767,20 +762,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] -name = "foreign-types" -version = "0.3.2" +name = "flume" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "foreign-types-shared", + "futures-core", + "futures-sink", + "spin 0.9.8", ] -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -820,6 +811,17 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-intrusive" version = "0.5.0" @@ -854,11 +856,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-core", "futures-io", "parking", @@ -873,7 +875,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -918,9 +920,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -928,10 +930,10 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gloo-timers" @@ -975,9 +977,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1051,9 +1053,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -1067,7 +1069,7 @@ checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -1101,9 +1103,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jemalloc-sys" @@ -1127,9 +1129,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1148,6 +1150,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "libc" @@ -1161,6 +1166,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1185,9 +1201,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ "value-bag", ] @@ -1204,9 +1220,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1230,23 +1246,43 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + [[package]] name = "moka" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "87bfd249f570638bfb0b4f9d258e6b8cddd2a5a7d0ed47e8bb8b176bfc0e7a17" dependencies = [ - "async-lock 2.8.0", + "async-lock 3.3.0", "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", + "event-listener 5.3.0", "futures-util", "once_cell", "parking_lot", "quanta", "rustc_version", - "skeptic", "smallvec", "tagptr", "thiserror", @@ -1255,49 +1291,57 @@ dependencies = [ ] [[package]] -name = "native-tls" -version = "0.2.11" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "memchr", + "minimal-lexical", ] [[package]] -name = "nix" -version = "0.27.1" +name = "num-bigint-dig" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", ] [[package]] -name = "nom" -version = "7.1.3" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "memchr", - "minimal-lexical", + "num-traits", ] [[package]] -name = "num-conv" -version = "0.1.0" +name = "num-iter" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] [[package]] name = "num-traits" @@ -1306,66 +1350,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", + "libm", ] [[package]] -name = "num_threads" -version = "0.1.7" +name = "num_cpus" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ + "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "openssl" -version = "0.10.63" +name = "num_threads" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "foreign-types", "libc", - "once_cell", - "openssl-macros", - "openssl-sys", ] [[package]] -name = "openssl-macros" -version = "0.1.1" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", + "memchr", ] [[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.99" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "ordered-float" @@ -1397,7 +1417,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -1436,36 +1456,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project" -version = "1.1.4" +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "pin-project-internal", + "base64ct", ] [[package]] -name = "pin-project-internal" -version = "1.1.4" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1480,10 +1489,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", ] +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.30" @@ -1508,14 +1538,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.31", + "rustix 0.38.32", "tracing", "windows-sys 0.52.0", ] @@ -1558,29 +1589,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.4.2", - "memchr", - "unicase", -] - [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ "crossbeam-utils", "libc", @@ -1593,9 +1613,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1636,7 +1656,7 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", ] [[package]] @@ -1650,9 +1670,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1662,9 +1682,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1673,9 +1693,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rlimit" @@ -1692,10 +1712,37 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0971d3c8943a6267d6bd0d782fdc4afa7593e7381a92a3df950ff58897e066b5" dependencies = [ + "memchr", "smartcow", "smartstring", ] +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc_version" version = "0.4.0" @@ -1721,11 +1768,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys 0.4.13", @@ -1734,27 +1781,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scopeguard" @@ -1772,14 +1801,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] name = "sea-orm" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6632f499b80cc6aaa781b302e4c9fae663e0e3dcf2640e9d80034d5b10731efe" +checksum = "c8814e37dc25de54398ee62228323657520b7f29713b8e238649385dbe473ee0" dependencies = [ "async-stream", "async-trait", @@ -1799,15 +1828,15 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec13bfb4c4aef208f68dbea970dd40d13830c868aa8dcb4e106b956e6bb4f2fa" +checksum = "5e115c6b078e013aa963cc2d38c196c2c40b05f03d0ac872fe06b6e0d5265603" dependencies = [ "heck", "proc-macro2", "quote", "sea-bae", - "syn 2.0.48", + "syn 2.0.58", "unicode-ident", ] @@ -1832,63 +1861,37 @@ dependencies = [ "sqlx", ] -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" -dependencies = [ - "serde", -] +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -1961,26 +1964,33 @@ dependencies = [ ] [[package]] -name = "size" -version = "0.4.1" +name = "signal-hook-tokio" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fed904c7fb2856d868b92464fc8fa597fce366edea1a9cbfaa8cb5fe080bd6d" +checksum = "213241f76fb1e37e27de3b6aa1b068a2c333233b59cca6634f634b80a27ecf1e" +dependencies = [ + "futures-core", + "libc", + "signal-hook", + "tokio", +] [[package]] -name = "skeptic" -version = "0.13.7" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", + "digest", + "rand_core", ] +[[package]] +name = "size" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fed904c7fb2856d868b92464fc8fa597fce366edea1a9cbfaa8cb5fe080bd6d" + [[package]] name = "slab" version = "0.4.9" @@ -1992,9 +2002,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smartcow" @@ -2026,6 +2036,41 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sqlformat" version = "0.2.3" @@ -2039,20 +2084,22 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ "ahash", "async-io 1.13.0", @@ -2062,7 +2109,6 @@ dependencies = [ "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener 2.5.3", "futures-channel", @@ -2075,7 +2121,6 @@ dependencies = [ "indexmap", "log", "memchr", - "native-tls", "once_cell", "paste", "percent-encoding", @@ -2085,15 +2130,17 @@ dependencies = [ "smallvec", "sqlformat", "thiserror", + "tokio", + "tokio-stream", "tracing", "url", ] [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -2104,12 +2151,11 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ "async-std", - "atomic-write-file", "dotenvy", "either", "heck", @@ -2121,21 +2167,66 @@ dependencies = [ "serde_json", "sha2", "sqlx-core", + "sqlx-mysql", "sqlx-postgres", + "sqlx-sqlite", "syn 1.0.109", "tempfile", + "tokio", "url", ] +[[package]] +name = "sqlx-mysql" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" +dependencies = [ + "atoi", + "base64", + "bitflags 2.5.0", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "crc", "dotenvy", @@ -2156,7 +2247,6 @@ dependencies = [ "rand", "serde", "serde_json", - "sha1", "sha2", "smallvec", "sqlx-core", @@ -2166,6 +2256,29 @@ dependencies = [ "whoami", ] +[[package]] +name = "sqlx-sqlite" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -2174,12 +2287,12 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stopper" -version = "0.2.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed8bff52ab3d70adfb76df17a225936c7676efdda1a1567ed5b11c22e3577bd3" +checksum = "66c82d03d16a1e591756e978782ce4bc4300f83048b57d44c5600dafa7337019" dependencies = [ - "event-listener 4.0.3", - "futures-lite 2.2.0", + "event-listener 5.3.0", + "futures-lite 2.3.0", "pin-project-lite", ] @@ -2219,9 +2332,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -2236,41 +2349,41 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "rustix 0.38.31", + "fastrand 2.0.2", + "rustix 0.38.32", "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -2291,9 +2404,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -2314,6 +2427,33 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.6", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tracing" version = "0.1.40" @@ -2334,7 +2474,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] [[package]] @@ -2348,12 +2488,11 @@ dependencies = [ [[package]] name = "trillium" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acca545b3933760b2b88b822d83e62ccf9aab8c24d16ae82e56df1f2a5af11c1" +checksum = "01c7180eac36666f14504c5a8606d027154a8e3a4704bd0acc69a13f56c202b6" dependencies = [ "async-trait", - "futures-lite 2.2.0", "log", "trillium-http", ] @@ -2382,14 +2521,30 @@ dependencies = [ "trillium", ] +[[package]] +name = "trillium-async-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f753f918df0a52066abc1aeb1a7c09dca60c2edcc1d0fa285a0d4fde1617392" +dependencies = [ + "async-std", + "log", + "signal-hook", + "signal-hook-async-std", + "trillium", + "trillium-http", + "trillium-macros 0.0.5", + "trillium-server-common", +] + [[package]] name = "trillium-http" -version = "0.3.14" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8afd3a7e9a46df93d81229fcd2011e089ed522c55ef633edee8893a23cb88e9" +checksum = "a18d82a9418c6fc1a872bc163fffd49320229edf783cbbb1aa62ba49f517cfad" dependencies = [ "encoding_rs", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "hashbrown", "httparse", "httpdate", @@ -2401,14 +2556,14 @@ dependencies = [ "smartstring", "stopper", "thiserror", - "trillium-macros", + "trillium-macros 0.0.6", ] [[package]] name = "trillium-logger" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d5329a0826c06cd7d36a81928345d97ab5277dcc7d1d624335eb52fa22d1a" +checksum = "da5e9b6c08a27d991b4a9c73dd7276c6f181fd4dee7218723b0fbd7fca3a1659" dependencies = [ "colored", "log", @@ -2425,14 +2580,25 @@ checksum = "916054381183f0cfed7604bf7de2044a760624a50d26eef5492468fb73083bbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", +] + +[[package]] +name = "trillium-macros" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916e37646d33632b88ca02d4b8c4e2e6376f2a89d9888de71b7d82c150ed1f6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", ] [[package]] name = "trillium-router" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71daa9c919d4b4a7afae1a846fa2e60aad712e5b924936751630a880a84e9659" +checksum = "6a7aed20d63101d7dcd165fd047141423009a7f4ccfc75db5b875312d8127dbe" dependencies = [ "log", "routefinder", @@ -2441,14 +2607,14 @@ dependencies = [ [[package]] name = "trillium-server-common" -version = "0.4.7" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f157b81051bb2630b6750d6583f648f545d241ef4b939781f4ad6a45fe700" +checksum = "a96faa60ceaf4b575886eb7d2ad3df4371acf67e0a4489585cccd4ff18966103" dependencies = [ "async-trait", "async_cell", "event-listener 4.0.3", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "log", "pin-project-lite", "rlimit", @@ -2459,22 +2625,21 @@ dependencies = [ [[package]] name = "trillium-smol" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91f9ca9fc22be687543ee24d23d9730f7370d57796adc2a2f2ccd9ce51b78199" +checksum = "3a1c196273bd6e41705150834f5771699ad9c2e38ce317aecd3f6e0ec4c2b2e6" dependencies = [ "async-global-executor", - "async-io 2.3.1", + "async-io 2.3.2", "async-net", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "log", "signal-hook", "signal-hook-async-std", "trillium", "trillium-http", - "trillium-macros", + "trillium-macros 0.0.6", "trillium-server-common", - "url", ] [[package]] @@ -2483,22 +2648,43 @@ version = "0.1.0" dependencies = [ "askama", "env_logger", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.0.2", + "futures-lite 2.3.0", "jemallocator", "moka", "sea-orm", "serde", "serde_json", + "sqlx", "trillium", "trillium-api", "trillium-askama", + "trillium-async-std", "trillium-logger", "trillium-router", "trillium-smol", + "trillium-tokio", "unicycle", ] +[[package]] +name = "trillium-tokio" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "160f07d12cc798d7de6a65e2279bb445f0606ecc4a9c594315ffff556ab7968b" +dependencies = [ + "async-compat", + "log", + "signal-hook", + "signal-hook-tokio", + "tokio", + "tokio-stream", + "trillium", + "trillium-http", + "trillium-macros 0.0.5", + "trillium-server-common", +] + [[package]] name = "triomphe" version = "0.1.11" @@ -2534,9 +2720,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -2555,22 +2741,21 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "unicycle" -version = "0.9.4" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfa5ca2452d3fbf68f7078c5e7f42b96f0c0c7def017994147f8acd8c4264d" +checksum = "6ca7c60c63c67acf573ef612b410c42b351c1028216085fd72fb43e2b1abd2fc" dependencies = [ "futures-core", "lock_api", "parking_lot", - "pin-project", "uniset", ] [[package]] name = "uniset" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c9f21fe154ca4d5d06fc2ebb8c58cc80e338eacc372ec794943f69e535c131c" +checksum = "40789245bbff5f31eb773c9ac4ee5c4e15eab9640d975e124d6ce4c34a6410d7" [[package]] name = "url" @@ -2583,6 +2768,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf8parse" version = "0.2.1" @@ -2591,18 +2782,18 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] [[package]] name = "value-bag" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" +checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" [[package]] name = "vcpkg" @@ -2622,27 +2813,23 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2650,24 +2837,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2677,9 +2864,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2687,28 +2874,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2716,9 +2903,13 @@ dependencies = [ [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +dependencies = [ + "redox_syscall", + "wasite", +] [[package]] name = "winapi" @@ -2736,15 +2927,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2766,7 +2948,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2786,17 +2968,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2807,9 +2990,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2819,9 +3002,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2831,9 +3014,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2843,9 +3032,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2855,9 +3044,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2867,9 +3056,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2879,9 +3068,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zerocopy" @@ -2900,5 +3089,11 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.58", ] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/frameworks/Rust/trillium/Cargo.toml b/frameworks/Rust/trillium/Cargo.toml index 6b31ed67ad6..25eb7edc467 100644 --- a/frameworks/Rust/trillium/Cargo.toml +++ b/frameworks/Rust/trillium/Cargo.toml @@ -5,28 +5,42 @@ edition = "2021" [features] jemallocator = ["dep:jemallocator"] +tokio = ["dep:trillium-tokio", "sea-orm/runtime-tokio", "sqlx/runtime-tokio"] +smol = [ + "dep:trillium-smol", + "sea-orm/runtime-async-std", + "sqlx/runtime-async-std", +] +async-std = [ + "dep:trillium-async-std", + "sea-orm/runtime-async-std", + "sqlx/runtime-async-std", +] [dependencies] askama = "0.12.1" -fastrand = "2.0.1" -futures-lite = "2.2.0" -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.113" -trillium = "0.2.16" +env_logger = "0.11.3" +fastrand = "2.0.2" +futures-lite = "2.3.0" +jemallocator = { version = "0.5.4", optional = true } +moka = { version = "0.12.5", features = ["future"] } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +sqlx = "0.7.4" +trillium = "0.2.19" trillium-api = "0.1.0" trillium-askama = "0.3.2" -trillium-smol = "0.3.3" -trillium-logger = "0.4.4" -trillium-router = "0.3.6" -unicycle = "0.9.4" -env_logger = "0.11.2" -moka = { version = "0.12.5", features = ["future"] } -jemallocator = {version="0.5.4", optional = true} +trillium-async-std = { version = "0.4.0", optional = true } +trillium-logger = "0.4.5" +trillium-router = "0.4.1" +trillium-smol = { version = "0.4.0", optional = true } +trillium-tokio = { version = "0.4.0", optional = true } +unicycle = "0.10.1" [dependencies.sea-orm] -version = "0.12.14" +version = "0.12.15" default-features = false -features = ["runtime-async-std-native-tls", "sqlx-postgres", "macros"] +features = ["sqlx-postgres", "macros"] [profile.release] panic = "abort" diff --git a/frameworks/Rust/trillium/benchmark_config.json b/frameworks/Rust/trillium/benchmark_config.json index a781bbabdcc..f12fc4ea218 100755 --- a/frameworks/Rust/trillium/benchmark_config.json +++ b/frameworks/Rust/trillium/benchmark_config.json @@ -23,7 +23,57 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "Trillium", + "display_name": "Trillium [smol]", + "notes": "", + "versus": "None", + "tags": ["verified"] + }, + "async-std": { + "db_url": "/db", + "json_url": "/json", + "query_url": "/queries/", + "plaintext_url": "/plaintext", + "fortune_url": "/fortunes", + "cached_query_url": "/cached-queries/", + "update_url": "/updates/", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "postgres", + "framework": "Trillium", + "language": "Rust", + "flavor": "None", + "orm": "Full", + "platform": "None", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "Trillium [async-std]", + "notes": "", + "versus": "None", + "tags": ["verified"] + }, + "tokio": { + "db_url": "/db", + "json_url": "/json", + "query_url": "/queries/", + "plaintext_url": "/plaintext", + "fortune_url": "/fortunes", + "cached_query_url": "/cached-queries/", + "update_url": "/updates/", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "postgres", + "framework": "Trillium", + "language": "Rust", + "flavor": "None", + "orm": "Full", + "platform": "None", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "Trillium [tokio]", "notes": "", "versus": "None", "tags": ["verified"] diff --git a/frameworks/Rust/trillium/src/main.rs b/frameworks/Rust/trillium/src/main.rs index 879a545e754..af8984ef208 100644 --- a/frameworks/Rust/trillium/src/main.rs +++ b/frameworks/Rust/trillium/src/main.rs @@ -8,6 +8,18 @@ mod routes; use application::application; use trillium::HttpConfig; +#[cfg(all(feature = "smol", not(feature = "tokio"), not(feature = "async-std")))] +use trillium_smol::config; + +#[cfg(all(feature = "tokio", not(feature = "smol"), not(feature = "async-std")))] +use trillium_tokio::config; + +#[cfg(all(feature = "async-std", not(feature = "smol"), not(feature = "tokio")))] +use trillium_async_std::config; + +#[cfg(not(any(feature = "async-std", feature = "smol", feature = "tokio")))] +compile_error! {"please run with one of the following --features `async-std`, `smol`, `tokio`"} + fn main() { #[cfg(debug_assertions)] env_logger::init(); @@ -17,7 +29,8 @@ fn main() { .with_request_buffer_initial_len(256) .with_response_header_initial_capacity(5); - trillium_smol::config() + config() + .with_nodelay() .with_http_config(http_config) .run(application()) } diff --git a/frameworks/Rust/trillium/src/routes/fortune.rs b/frameworks/Rust/trillium/src/routes/fortune.rs index e9ea757e7bf..c1658a64f69 100644 --- a/frameworks/Rust/trillium/src/routes/fortune.rs +++ b/frameworks/Rust/trillium/src/routes/fortune.rs @@ -34,5 +34,5 @@ pub async fn handler(conn: Conn) -> Conn { conn.render(FortuneTemplate { fortunes: &fortunes, }) - .with_header(ContentType, "text/html; charset=utf-8") + .with_response_header(ContentType, "text/html; charset=utf-8") } diff --git a/frameworks/Rust/trillium/src/routes/plaintext.rs b/frameworks/Rust/trillium/src/routes/plaintext.rs index 3742526a1be..f423ead3780 100644 --- a/frameworks/Rust/trillium/src/routes/plaintext.rs +++ b/frameworks/Rust/trillium/src/routes/plaintext.rs @@ -1,6 +1,6 @@ use trillium::{Conn, KnownHeaderName}; pub async fn handler(conn: Conn) -> Conn { - conn.with_header(KnownHeaderName::ContentType, "text/plain") + conn.with_response_header(KnownHeaderName::ContentType, "text/plain") .ok("Hello, World!") } diff --git a/frameworks/Rust/trillium/trillium-async-std.dockerfile b/frameworks/Rust/trillium/trillium-async-std.dockerfile new file mode 100644 index 00000000000..554bb671f5e --- /dev/null +++ b/frameworks/Rust/trillium/trillium-async-std.dockerfile @@ -0,0 +1,16 @@ +FROM rust:1.77 +WORKDIR /trillium +COPY src src +COPY templates templates +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock + +EXPOSE 8080 + +ENV RUSTFLAGS="-C target-cpu=native" +ENV PORT=8080 +ENV HOST=0.0.0.0 +ENV DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world + +RUN cargo build --release --features jemallocator,async-std +CMD ["./target/release/trillium-techempower"] diff --git a/frameworks/Rust/trillium/trillium-tokio.dockerfile b/frameworks/Rust/trillium/trillium-tokio.dockerfile new file mode 100644 index 00000000000..d3bf05bcb7f --- /dev/null +++ b/frameworks/Rust/trillium/trillium-tokio.dockerfile @@ -0,0 +1,16 @@ +FROM rust:1.77 +WORKDIR /trillium +COPY src src +COPY templates templates +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock + +EXPOSE 8080 + +ENV RUSTFLAGS="-C target-cpu=native" +ENV PORT=8080 +ENV HOST=0.0.0.0 +ENV DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world + +RUN cargo build --release --features jemallocator,tokio +CMD ["./target/release/trillium-techempower"] diff --git a/frameworks/Rust/trillium/trillium.dockerfile b/frameworks/Rust/trillium/trillium.dockerfile index e5e3ac910ba..667079dd84b 100644 --- a/frameworks/Rust/trillium/trillium.dockerfile +++ b/frameworks/Rust/trillium/trillium.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.76 +FROM rust:1.77 WORKDIR /trillium COPY src src COPY templates templates @@ -12,5 +12,5 @@ ENV PORT=8080 ENV HOST=0.0.0.0 ENV DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world -RUN cargo build --release --features jemallocator +RUN cargo build --release --features jemallocator,smol CMD ["./target/release/trillium-techempower"] diff --git a/frameworks/Rust/warp-rust/Cargo.lock b/frameworks/Rust/warp-rust/Cargo.lock index fbd9a71340e..abf2a98b4a9 100644 --- a/frameworks/Rust/warp-rust/Cargo.lock +++ b/frameworks/Rust/warp-rust/Cargo.lock @@ -1179,7 +1179,7 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "smallvec", "winapi", ] @@ -1345,6 +1345,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.0" @@ -1352,7 +1361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.10", ] [[package]] @@ -1805,7 +1814,7 @@ dependencies = [ "cfg-if", "libc", "rand", - "redox_syscall", + "redox_syscall 0.2.10", "remove_dir_all", "winapi", ] @@ -2249,6 +2258,12 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" version = "0.2.76" @@ -2334,11 +2349,12 @@ dependencies = [ [[package]] name = "whoami" -version = "1.1.3" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7741161a40200a867c96dfa5574544efa4178cf4c8f770b62dd1cc0362d7ae1" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "wasm-bindgen", + "redox_syscall 0.4.1", + "wasite", "web-sys", ] diff --git a/frameworks/Rust/xitca-web/.cargo/config.toml b/frameworks/Rust/xitca-web/.cargo/config.toml index bca4c6c1b26..7d3c09f8a1a 100644 --- a/frameworks/Rust/xitca-web/.cargo/config.toml +++ b/frameworks/Rust/xitca-web/.cargo/config.toml @@ -2,5 +2,5 @@ rustflags = ["-C", "target-cpu=native"] incremental = false -[target.wasm32-wasi-preview1-threads] +[target.wasm32-wasip1-threads] rustflags = ["-C", "target-feature=+simd128", "--cfg", "tokio_unstable"] diff --git a/frameworks/Rust/xitca-web/Cargo.lock b/frameworks/Rust/xitca-web/Cargo.lock index fd001345246..0bce6f973f8 100644 --- a/frameworks/Rust/xitca-web/Cargo.lock +++ b/frameworks/Rust/xitca-web/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", @@ -39,15 +39,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", @@ -67,7 +67,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tower", "tower-layer", "tower-service", @@ -88,16 +88,16 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", ] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -122,9 +122,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -143,15 +143,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -180,11 +180,11 @@ dependencies = [ [[package]] name = "diesel" -version = "2.1.4" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" +checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "diesel_derives", "itoa", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.1.2" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8337737574f55a468005a83499da720f20c65586241ffea339db9ecdfd2b44" +checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" dependencies = [ "diesel_table_macro_syntax", "proc-macro2", @@ -238,7 +238,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -299,9 +299,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -361,12 +361,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -396,9 +396,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "itoap" @@ -408,15 +408,25 @@ checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libmimalloc-sys" +version = "0.1.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7bb23d733dfcc8af652a78b7bf232f0e967710d044732185e561e47c0336b6" +dependencies = [ + "cc", + "libc", +] [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -446,9 +456,18 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mimalloc" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9186d86b79b52f4a77af65604b51225e8db1d6ee7e3f41aec1e40829c71a176" +dependencies = [ + "libmimalloc-sys", +] [[package]] name = "mime" @@ -458,17 +477,18 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" -source = "git+https://github.com/fakeshadow/mio.git?rev=52b72d372bfe5807755b7f5e3e1edf282954d6ba#52b72d372bfe5807755b7f5e3e1edf282954d6ba" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -483,9 +503,9 @@ checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -517,9 +537,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -527,15 +547,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -566,9 +586,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -622,18 +642,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -688,23 +708,32 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sailfish" @@ -765,18 +794,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", @@ -785,9 +814,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -796,9 +825,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -829,9 +858,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -847,9 +876,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -863,9 +892,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -890,9 +919,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.52" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -905,6 +934,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "tinyvec" version = "1.6.0" @@ -922,17 +957,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "libc", "mio", "num_cpus", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "windows-sys 0.48.0", ] @@ -972,7 +1008,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bytes", "http", "http-body", @@ -1096,7 +1132,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1116,17 +1152,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1137,9 +1174,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1149,9 +1186,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1161,9 +1198,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1173,9 +1216,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1185,9 +1228,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1197,9 +1240,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1209,9 +1252,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "xitca-codegen" @@ -1225,9 +1268,9 @@ dependencies = [ [[package]] name = "xitca-http" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1982607f88759de96dec5b234e9cf835d6a4995e395b65a201e656d0641974" +checksum = "6d5fd258cd6cd9d677cb94273da69fafee7460bbbd001c92a73c167149856e46" dependencies = [ "futures-core", "http", @@ -1235,7 +1278,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-uring", "tracing", @@ -1247,9 +1290,9 @@ dependencies = [ [[package]] name = "xitca-io" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7581c12bcd8b2194271da2117926a577e4e974ab840c7a3f61cc187a249335c8" +checksum = "da690dc253320dae7ffbb70e7fa9c5e52ef79476dd41f5d52b9114c8b58d7126" dependencies = [ "bytes", "tokio", @@ -1260,7 +1303,7 @@ dependencies = [ [[package]] name = "xitca-postgres" version = "0.1.0" -source = "git+https://github.com/HFQR/xitca-web.git?rev=13a28c51a2f6e23e4e6b96e508a8af1e5e79d0b6#13a28c51a2f6e23e4e6b96e508a8af1e5e79d0b6" +source = "git+https://github.com/HFQR/xitca-web.git?rev=ea1f5a2447e0969a6dff84eac9ff9ff90dbc7ed1#ea1f5a2447e0969a6dff84eac9ff9ff90dbc7ed1" dependencies = [ "fallible-iterator", "percent-encoding", @@ -1284,11 +1327,11 @@ dependencies = [ [[package]] name = "xitca-server" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48656d81909cb34fcf01288cdaf2bd77848d0f0dcbdc0c429b6ed376f78f4d5" +checksum = "4e144aca50286d05f7450045d6b6eebe2157ed11bc5821d926fc276280113c94" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-uring", "tracing", @@ -1321,6 +1364,7 @@ dependencies = [ "diesel", "futures-core", "http-body", + "mimalloc", "nanorand", "sailfish", "serde", @@ -1334,14 +1378,14 @@ dependencies = [ "xitca-server", "xitca-service", "xitca-unsafe-collection", - "xitca-web 0.4.0", + "xitca-web 0.5.0", ] [[package]] name = "xitca-web" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfae98470b0f55b978ebdccd1317a658590aa6fecec4db61522adaa8e6943747" +checksum = "bd23a9146a753f4f9e10bf4cc99b53d040a5459c32f043965d75f0c2b4a78af6" dependencies = [ "futures-core", "http-body", diff --git a/frameworks/Rust/xitca-web/Cargo.toml b/frameworks/Rust/xitca-web/Cargo.toml index 8717e681c50..b9447c3e7ea 100644 --- a/frameworks/Rust/xitca-web/Cargo.toml +++ b/frameworks/Rust/xitca-web/Cargo.toml @@ -11,7 +11,7 @@ required-features = ["io-uring", "pg", "router", "template"] [[bin]] name = "xitca-web-iou" path = "./src/main_iou.rs" -required-features = ["io-uring", "pg-iou", "template"] +required-features = ["io-uring", "perf", "pg-iou", "template"] [[bin]] name = "xitca-web-wasm" @@ -21,7 +21,7 @@ required-features = ["web"] [[bin]] name = "xitca-web-axum" path = "./src/main_axum.rs" -required-features = ["axum", "io-uring", "pg-sync", "template"] +required-features = ["axum", "io-uring", "perf", "pg-sync", "template"] [[bin]] name = "xitca-web-sync" @@ -49,11 +49,13 @@ template = ["sailfish"] io-uring = ["xitca-http/io-uring", "xitca-server/io-uring"] # axum optional axum = ["dep:axum", "http-body", "tower", "tower-http", "xitca-web/tower-http-compat" ] +# unrealistic performance optimization +perf = ["mimalloc", "tokio/parking_lot"] [dependencies] -xitca-http = "0.4" -xitca-io = "0.2" -xitca-server = "0.2" +xitca-http = "0.5" +xitca-io = "0.3" +xitca-server = "0.3" xitca-service = "0.1" xitca-unsafe-collection = "0.1.1" @@ -62,7 +64,7 @@ serde = { version = "1" } serde_json = { version = "1" } # web optional -xitca-web = { version = "0.4", features = ["json"], optional = true } +xitca-web = { version = "0.5", features = ["json"], optional = true } # raw-pg optional xitca-postgres = { version = "0.1", optional = true } @@ -79,6 +81,9 @@ http-body = { version = "1", optional = true } tower = { version = "0.4", optional = true } tower-http = { version = "0.5", features = ["set-header"], optional = true } +# perf optional +mimalloc = { version = "0.1", default-features = false, optional = true } + # stuff can not be used or not needed in wasi target [target.'cfg(not(target_family = "wasm"))'.dependencies] futures-core = { version = "0.3", default-features = false } @@ -92,5 +97,4 @@ codegen-units = 1 panic = "abort" [patch.crates-io] -xitca-postgres = { git = "https://github.com/HFQR/xitca-web.git", rev = "13a28c51a2f6e23e4e6b96e508a8af1e5e79d0b6" } -mio = { git = "https://github.com/fakeshadow/mio.git", rev = "52b72d372bfe5807755b7f5e3e1edf282954d6ba" } +xitca-postgres = { git = "https://github.com/HFQR/xitca-web.git", rev = "ea1f5a2447e0969a6dff84eac9ff9ff90dbc7ed1" } diff --git a/frameworks/Rust/xitca-web/benchmark_config.json b/frameworks/Rust/xitca-web/benchmark_config.json index f4c152eb729..5371bcd2551 100755 --- a/frameworks/Rust/xitca-web/benchmark_config.json +++ b/frameworks/Rust/xitca-web/benchmark_config.json @@ -62,7 +62,8 @@ "database_os": "linux", "display_name": "xitca-web [wasm]", "notes": "", - "versus": "" + "versus": "", + "tags": ["broken"] }, "axum": { "json_url": "/json", diff --git a/frameworks/Rust/xitca-web/src/main_axum.rs b/frameworks/Rust/xitca-web/src/main_axum.rs index 571732a897c..d15aaefdc6e 100644 --- a/frameworks/Rust/xitca-web/src/main_axum.rs +++ b/frameworks/Rust/xitca-web/src/main_axum.rs @@ -1,5 +1,8 @@ //! show case of axum running on proper thread per core server with io-uring enabled. +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + mod db; mod ser; mod util; diff --git a/frameworks/Rust/xitca-web/src/main_iou.rs b/frameworks/Rust/xitca-web/src/main_iou.rs index 789f71cf81b..83dfbc0eaab 100644 --- a/frameworks/Rust/xitca-web/src/main_iou.rs +++ b/frameworks/Rust/xitca-web/src/main_iou.rs @@ -1,6 +1,9 @@ // used as reference of if/how moving from epoll to io-uring(or mixture of the two) make sense for // network io. +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + mod db; mod ser; mod util; diff --git a/frameworks/Rust/xitca-web/src/ser.rs b/frameworks/Rust/xitca-web/src/ser.rs index 8e15ce71671..ca1c56caf70 100644 --- a/frameworks/Rust/xitca-web/src/ser.rs +++ b/frameworks/Rust/xitca-web/src/ser.rs @@ -173,6 +173,6 @@ where { serde_json::to_writer(BufMutWriter(buf), value)?; let mut res = req.into_response(buf.split().freeze()); - res.headers_mut().append(CONTENT_TYPE, JSON); + res.headers_mut().insert(CONTENT_TYPE, JSON); Ok(res) } diff --git a/frameworks/Rust/xitca-web/xitca-web-axum.dockerfile b/frameworks/Rust/xitca-web/xitca-web-axum.dockerfile index 6c0422ea4ff..2d29f5e2ffb 100644 --- a/frameworks/Rust/xitca-web/xitca-web-axum.dockerfile +++ b/frameworks/Rust/xitca-web/xitca-web-axum.dockerfile @@ -1,9 +1,9 @@ -FROM rust:1.76 +FROM rust:1.77 ADD ./ /xitca-web WORKDIR /xitca-web -RUN cargo build --release --bin xitca-web-axum --features axum,io-uring,pg-sync,template +RUN cargo build --release --bin xitca-web-axum --features axum,io-uring,perf,pg-sync,template EXPOSE 8080 diff --git a/frameworks/Rust/xitca-web/xitca-web-iou.dockerfile b/frameworks/Rust/xitca-web/xitca-web-iou.dockerfile index 35e53b29db8..43bf2b23fc5 100644 --- a/frameworks/Rust/xitca-web/xitca-web-iou.dockerfile +++ b/frameworks/Rust/xitca-web/xitca-web-iou.dockerfile @@ -1,9 +1,9 @@ -FROM rust:1.76 +FROM rust:1.77 ADD ./ /xitca-web WORKDIR /xitca-web -RUN cargo build --release --bin xitca-web-iou --features io-uring,pg-iou,template +RUN cargo build --release --bin xitca-web-iou --features io-uring,perf,pg-iou,template EXPOSE 8080 diff --git a/frameworks/Rust/xitca-web/xitca-web-sync.dockerfile b/frameworks/Rust/xitca-web/xitca-web-sync.dockerfile index 93f848de2ec..5e71fa5d649 100644 --- a/frameworks/Rust/xitca-web/xitca-web-sync.dockerfile +++ b/frameworks/Rust/xitca-web/xitca-web-sync.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.76 +FROM rust:1.77 ADD ./ /xitca-web WORKDIR /xitca-web diff --git a/frameworks/Rust/xitca-web/xitca-web-wasm.dockerfile b/frameworks/Rust/xitca-web/xitca-web-wasm.dockerfile index d5611eb092d..51aa96fd4eb 100644 --- a/frameworks/Rust/xitca-web/xitca-web-wasm.dockerfile +++ b/frameworks/Rust/xitca-web/xitca-web-wasm.dockerfile @@ -1,7 +1,7 @@ ARG WASMTIME_VERSION=15.0.0 -ARG WASM_TARGET=wasm32-wasi-preview1-threads +ARG WASM_TARGET=wasm32-wasip1-threads -FROM rust:1.76 AS compile +FROM rust:1.77 AS compile ARG WASMTIME_VERSION ARG WASM_TARGET diff --git a/frameworks/Rust/xitca-web/xitca-web.dockerfile b/frameworks/Rust/xitca-web/xitca-web.dockerfile index 88ff778663c..bed37320e72 100644 --- a/frameworks/Rust/xitca-web/xitca-web.dockerfile +++ b/frameworks/Rust/xitca-web/xitca-web.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.76 +FROM rust:1.77 ADD ./ /xitca-web WORKDIR /xitca-web diff --git a/frameworks/Swift/swift-nio/.gitignore b/frameworks/Swift/.gitignore similarity index 100% rename from frameworks/Swift/swift-nio/.gitignore rename to frameworks/Swift/.gitignore index 1f4e5903663..e638150e387 100644 --- a/frameworks/Swift/swift-nio/.gitignore +++ b/frameworks/Swift/.gitignore @@ -1,8 +1,8 @@ .DS_Store .build/ -.vscode/ /*.xcodeproj xcuserdata/ .swiftpm/ DerivedData/ Package.resolved +.vscode/ diff --git a/frameworks/Swift/README.md b/frameworks/Swift/README.md index 367e5b6b0c0..878251045c8 100644 --- a/frameworks/Swift/README.md +++ b/frameworks/Swift/README.md @@ -8,4 +8,5 @@ For further guidance, review the [documentation](https://frameworkbenchmarks.rea ### Swift Experts -[tanner0101](https://github.com/tanner0101) +[Adam Fowler](https://github.com/adam-fowler) +[Tim Condon](https://github.com/0xTim) diff --git a/frameworks/Swift/hummingbird-core/.gitignore b/frameworks/Swift/hummingbird-core/.gitignore deleted file mode 100644 index 1d982c0de86..00000000000 --- a/frameworks/Swift/hummingbird-core/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.build/ -/*.xcodeproj -xcuserdata/ -.swiftpm/ -DerivedData/ -Package.resolved diff --git a/frameworks/Swift/hummingbird-core/benchmark_config.json b/frameworks/Swift/hummingbird-core/benchmark_config.json index 8a78cb1a141..8b811b8656c 100755 --- a/frameworks/Swift/hummingbird-core/benchmark_config.json +++ b/frameworks/Swift/hummingbird-core/benchmark_config.json @@ -18,7 +18,7 @@ "database_os": "Linux", "display_name": "HummingbirdCore", "notes": "", - "versus": "None" + "versus": "swift-nio" } }] } diff --git a/frameworks/Swift/hummingbird-core/hummingbird-core.dockerfile b/frameworks/Swift/hummingbird-core/hummingbird-core.dockerfile index c384cc96fd0..eb6fccc321b 100644 --- a/frameworks/Swift/hummingbird-core/hummingbird-core.dockerfile +++ b/frameworks/Swift/hummingbird-core/hummingbird-core.dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container @@ -15,7 +15,7 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Copy build artifacts diff --git a/frameworks/Swift/hummingbird/.gitignore b/frameworks/Swift/hummingbird/.gitignore deleted file mode 100644 index 1d982c0de86..00000000000 --- a/frameworks/Swift/hummingbird/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.build/ -/*.xcodeproj -xcuserdata/ -.swiftpm/ -DerivedData/ -Package.resolved diff --git a/frameworks/Swift/hummingbird/benchmark_config.json b/frameworks/Swift/hummingbird/benchmark_config.json index 7b60aa6ec1b..91bff409efe 100755 --- a/frameworks/Swift/hummingbird/benchmark_config.json +++ b/frameworks/Swift/hummingbird/benchmark_config.json @@ -18,7 +18,7 @@ "database_os": "Linux", "display_name": "Hummingbird", "notes": "", - "versus": "None" + "versus": "swift-nio" }, "postgres": { "db_url": "/db", diff --git a/frameworks/Swift/hummingbird/hummingbird-postgres.dockerfile b/frameworks/Swift/hummingbird/hummingbird-postgres.dockerfile index 27e0d6aad07..952c3c47dbf 100644 --- a/frameworks/Swift/hummingbird/hummingbird-postgres.dockerfile +++ b/frameworks/Swift/hummingbird/hummingbird-postgres.dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container @@ -15,7 +15,7 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Copy build artifacts diff --git a/frameworks/Swift/hummingbird/hummingbird.dockerfile b/frameworks/Swift/hummingbird/hummingbird.dockerfile index c384cc96fd0..eb6fccc321b 100644 --- a/frameworks/Swift/hummingbird/hummingbird.dockerfile +++ b/frameworks/Swift/hummingbird/hummingbird.dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container @@ -15,7 +15,7 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Copy build artifacts diff --git a/frameworks/Swift/hummingbird2/README.md b/frameworks/Swift/hummingbird2/README.md new file mode 100755 index 00000000000..06f66d168c8 --- /dev/null +++ b/frameworks/Swift/hummingbird2/README.md @@ -0,0 +1,44 @@ +# Hummingbird 2 Benchmarking Test + +Hummingbird 2 is a lightweight, flexible HTTP server framework written in Swift. HUmmingbird 2 is a complete rewrite using Swift concurrency. + +### Test Type Implementation Source Code + +* [JSON](src/Sources/server/main.swift) +* [PLAINTEXT](src/Sources/server/main.swift) +* [DB](src-postgres/Sources/server/Controllers/WorldController.swift) +* [Query](src-postgres/Sources/server/Controllers/WorldController.swift) +* [Updates](src-postgres/Sources/server/Controllers/WorldController.swift) +* [Fortunes](src-postgres/Sources/server/Controllers/FortunesController.swift) + +## Important Libraries +This version of Hummingbird requires +* [Swift 5.10](https://swift.org) +* [SwiftNIO 2.x](https://github.com/apple/swift-nio/) +In these tests for database access it uses +* [PostgresKit 2.21](https://github.com/vapor/postgres-nio/) + +## Test URLs +### JSON + +http://localhost:8080/json + +### PLAINTEXT + +http://localhost:8080/plaintext + +### DB + +http://localhost:8080/db + +### Query + +http://localhost:8080/queries?queries= + +### Updates + +http://localhost:8080/updates?queries= + +### Fortunes + +http://localhost:8080/fortunes diff --git a/frameworks/Swift/hummingbird2/benchmark_config.json b/frameworks/Swift/hummingbird2/benchmark_config.json new file mode 100755 index 00000000000..c6001e41811 --- /dev/null +++ b/frameworks/Swift/hummingbird2/benchmark_config.json @@ -0,0 +1,47 @@ +{ + "framework": "hummingbird2", + "tests": [ + { + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "None", + "framework": "Hummingbird2", + "language": "Swift", + "flavor": "None", + "orm": "Raw", + "platform": "None", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "Hummingbird 2", + "notes": "", + "versus": "swift-nio" + }, + "postgres": { + "db_url": "/db", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", + "fortune_url": "/fortunes", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "postgres", + "framework": "Hummingbird2", + "language": "Swift", + "flavor": "None", + "orm": "Raw", + "platform": "None", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "Hummingbird 2", + "notes": "", + "versus": "None" + } + } + ] +} diff --git a/frameworks/Swift/vapor/vapor-mongo-fluent.dockerfile b/frameworks/Swift/hummingbird2/hummingbird2-postgres.dockerfile similarity index 62% rename from frameworks/Swift/vapor/vapor-mongo-fluent.dockerfile rename to frameworks/Swift/hummingbird2/hummingbird2-postgres.dockerfile index 792a810d8f4..952c3c47dbf 100644 --- a/frameworks/Swift/vapor/vapor-mongo-fluent.dockerfile +++ b/frameworks/Swift/hummingbird2/hummingbird2-postgres.dockerfile @@ -1,11 +1,11 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container -COPY ./vapor-mongo-fluent . +COPY ./src-postgres . # Compile with optimizations RUN swift build \ @@ -15,15 +15,15 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Copy build artifacts COPY --from=build /build/.build/release /run -# Copy Swift runtime libraries -COPY --from=build /usr/lib/swift/ /usr/lib/swift/ +ENV SERVER_PORT=8080 +ENV SERVER_HOSTNAME=0.0.0.0 EXPOSE 8080 -ENTRYPOINT ["./app", "serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8080"] +CMD ["./server"] diff --git a/frameworks/Swift/hummingbird2/hummingbird2.dockerfile b/frameworks/Swift/hummingbird2/hummingbird2.dockerfile new file mode 100644 index 00000000000..eb6fccc321b --- /dev/null +++ b/frameworks/Swift/hummingbird2/hummingbird2.dockerfile @@ -0,0 +1,29 @@ +# ================================ +# Build image +# ================================ +FROM swift:5.10 as build +WORKDIR /build + +# Copy entire repo into container +COPY ./src . + +# Compile with optimizations +RUN swift build \ + -c release \ + -Xswiftc -enforce-exclusivity=unchecked + +# ================================ +# Run image +# ================================ +FROM swift:5.10-slim +WORKDIR /run + +# Copy build artifacts +COPY --from=build /build/.build/release /run + +ENV SERVER_PORT=8080 +ENV SERVER_HOSTNAME=0.0.0.0 + +EXPOSE 8080 + +CMD ["./server"] diff --git a/frameworks/Swift/hummingbird2/src-postgres/Package.swift b/frameworks/Swift/hummingbird2/src-postgres/Package.swift new file mode 100644 index 00000000000..b8028ce6372 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Package.swift @@ -0,0 +1,32 @@ +// swift-tools-version:5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "server", + platforms: [.macOS(.v14)], + products: [ + .executable(name: "server", targets: ["server"]) + ], + dependencies: [ + .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-beta.4"), + .package(url: "https://github.com/hummingbird-project/swift-mustache.git", from: "2.0.0-beta"), + .package(url: "https://github.com/vapor/postgres-nio.git", from: "1.21.0"), + ], + targets: [ + .executableTarget(name: "server", + dependencies: [ + .product(name: "Hummingbird", package: "hummingbird"), + .product(name: "Mustache", package: "swift-mustache"), + .product(name: "PostgresNIO", package: "postgres-nio"), + ], + swiftSettings: [ + // Enable better optimizations when building in Release configuration. Despite the use of + // the `.unsafeFlags` construct required by SwiftPM, this flag is recommended for Release + // builds. See for details. + .unsafeFlags(["-cross-module-optimization"], .when(configuration: .release)) + ] + ), + ] +) diff --git a/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/FortunesController.swift b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/FortunesController.swift new file mode 100644 index 00000000000..159901dda40 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/FortunesController.swift @@ -0,0 +1,61 @@ +import Hummingbird +import Mustache +import PostgresNIO + +struct HTML: ResponseGenerator, Sendable { + let html: String + public func response(from request: Request, context: some BaseRequestContext) -> Response { + let buffer = context.allocator.buffer(string: html) + return Response(status: .ok, headers: [.contentType: "text/html; charset=utf-8"], body: .init(byteBuffer: buffer)) + } +} + +final class FortunesController: Sendable { + typealias Context = TechFrameworkRequestContext + let template: MustacheTemplate + let postgresClient: PostgresClient + + init(postgresClient: PostgresClient) { + self.postgresClient = postgresClient + self.template = try! MustacheTemplate(string: """ + Fortunes{{#.}}{{/.}}
idmessage
{{id}}{{message}}
+ """) + } + + var routes: RouteCollection { + RouteCollection(context: Context.self) + .get("fortunes", use: fortunes) + } + + /// In this test, the framework's ORM is used to fetch all rows from a database + /// table containing an unknown number of Unix fortune cookie messages (the + /// table has 12 rows, but the code cannot have foreknowledge of the table's + /// size). An additional fortune cookie message is inserted into the list at + /// runtime and then the list is sorted by the message text. Finally, the list + /// is delivered to the client using a server-side HTML template. The message + /// text must be considered untrusted and properly escaped and the UTF-8 fortune messages must be rendered properly. + @Sendable func fortunes(request: Request, context: Context) async throws -> HTML { + let rows = try await self.postgresClient.execute(SelectFortuneStatement()) + var fortunes: [Fortune] = [] + for try await fortune in rows { + fortunes.append(.init(id: fortune.0, message: fortune.1)) + } + + fortunes.append(.init(id: 0, message: "Additional fortune added at request time.")) + let sortedFortunes = fortunes.sorted { $0.message < $1.message } + return HTML(html: self.template.render(sortedFortunes) ) + + } + + struct SelectFortuneStatement: PostgresPreparedStatement { + typealias Row = (Int32, String) + + static var sql = "SELECT id, message FROM Fortune" + + func makeBindings() throws -> PostgresNIO.PostgresBindings { + return .init() + } + + func decodeRow(_ row: PostgresNIO.PostgresRow) throws -> Row { try row.decode(Row.self) } + } +} diff --git a/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/WorldController.swift b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/WorldController.swift new file mode 100644 index 00000000000..df3a74d4ac8 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Controllers/WorldController.swift @@ -0,0 +1,107 @@ +import Hummingbird +import PostgresNIO + +struct WorldController { + typealias Context = TechFrameworkRequestContext + let postgresClient: PostgresClient + + var routes: RouteCollection { + RouteCollection(context: Context.self) + .get("db", use: single) + .get("queries", use: multiple) + .get("updates", use: updates) + } + + /// In this test, each request is processed by fetching a single row from a + /// simple database table. That row is then serialized as a JSON response. + @Sendable func single(request: Request, context: Context) async throws -> World { + let id = Int32.random(in: 1...10_000) + let rows = try await self.postgresClient.execute(SelectWorldStatement(id: id)) + guard let row = try await rows.first(where: {_ in true }) else { + throw HTTPError(.notFound) + } + return World(id: row.0, randomNumber: row.1) + } + + /// In this test, each request is processed by fetching multiple rows from a + /// simple database table and serializing these rows as a JSON response. The + /// test is run multiple times: testing 1, 5, 10, 15, and 20 queries per request. + /// All tests are run at 512 concurrency. + @Sendable func multiple(request: Request, context: Context) async throws -> [World] { + let queries = (request.uri.queryParameters.get("queries", as: Int.self) ?? 1).bound(1, 500) + return try await self.postgresClient.withConnection { conn in + var result: [World] = .init() + result.reserveCapacity(queries) + for _ in 0.. [World] { + let queries = (request.uri.queryParameters.get("queries", as: Int.self) ?? 1).bound(1, 500) + return try await self.postgresClient.withConnection { conn in + var result: [World] = .init() + result.reserveCapacity(queries) + for _ in 0.. PostgresNIO.PostgresBindings { + var bindings = PostgresNIO.PostgresBindings(capacity: 1) + bindings.append(.init(int32: self.id)) + return bindings + } + + func decodeRow(_ row: PostgresNIO.PostgresRow) throws -> Row { try row.decode(Row.self) } + } + + struct UpdateWorldStatement: PostgresPreparedStatement { + typealias Row = Int32 + + let id: Int32 + let randomNumber: Int32 + + static var sql = "UPDATE World SET randomnumber = $2 WHERE id = $1" + + func makeBindings() throws -> PostgresNIO.PostgresBindings { + var bindings = PostgresNIO.PostgresBindings(capacity: 2) + bindings.append(.init(int32: self.id)) + bindings.append(.init(int32: self.randomNumber)) + return bindings + } + + func decodeRow(_ row: PostgresNIO.PostgresRow) throws -> Row { try row.decode(Row.self) } + } +} diff --git a/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/Fortune.swift b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/Fortune.swift new file mode 100644 index 00000000000..cb8ff2ee1ae --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/Fortune.swift @@ -0,0 +1,21 @@ +import Hummingbird +import Mustache + +struct Fortune: ResponseEncodable, Sendable { + var id: Int32 + var message: String +} + +// avoid using Mirror as it is expensive +extension Fortune: MustacheParent { + func child(named: String) -> Any? { + switch named { + case "id": + return id + case "message": + return message + default: + return nil + } + } +} diff --git a/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/World.swift b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/World.swift new file mode 100644 index 00000000000..03077e0aadf --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/Models/World.swift @@ -0,0 +1,7 @@ +import Hummingbird + +struct World: ResponseEncodable { + var id: Int32 + var randomNumber: Int32 +} + diff --git a/frameworks/Swift/hummingbird2/src-postgres/Sources/server/main.swift b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/main.swift new file mode 100644 index 00000000000..65e360bfab3 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src-postgres/Sources/server/main.swift @@ -0,0 +1,62 @@ +import Hummingbird +import PostgresNIO + +// postgresql.conf specifies max_connections = 2000 +// https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Environment#citrine-self-hosted +// https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/databases/postgres/postgresql.conf#L64 + +extension Int { + func bound(_ minValue: Int, _ maxValue: Int) -> Int { + return Swift.min(maxValue, Swift.max(minValue, self)) + } +} + +struct TechFrameworkRequestContext: RequestContext { + static let jsonEncoder = JSONEncoder() + static let jsonDecoder = JSONDecoder() + + var coreContext: Hummingbird.CoreRequestContext + + // Use a global JSON Encoder + var responseEncoder: JSONEncoder { Self.jsonEncoder } + // Use a global JSON Decoder + var requestDecoder: JSONDecoder { Self.jsonDecoder } + + init(channel: any Channel, logger: Logger) { + self.coreContext = .init(allocator: channel.allocator, logger: logger) + } +} + +func runApp() async throws { + let env = Environment() + let serverHostName = env.get("SERVER_HOSTNAME") ?? "127.0.0.1" + let serverPort = env.get("SERVER_PORT", as: Int.self) ?? 8080 + + var postgresConfiguration = PostgresClient.Configuration( + host: "tfb-database", + username: "benchmarkdbuser", + password: "benchmarkdbpass", + database: "hello_world", + tls: .disable + ) + postgresConfiguration.options.maximumConnections = 100 + let postgresClient = PostgresClient( + configuration: postgresConfiguration, + eventLoopGroup: MultiThreadedEventLoopGroup.singleton + ) + let router = Router(context: TechFrameworkRequestContext.self) + router.addRoutes(WorldController(postgresClient: postgresClient).routes) + router.addRoutes(FortunesController(postgresClient: postgresClient).routes) + var app = Application( + router: router, + configuration: .init( + address: .hostname(serverHostName, port: serverPort), + serverName: "HB2", + backlog: 8192 + ) + ) + app.addServices(postgresClient) + try await app.runService() +} + +try await runApp() diff --git a/frameworks/Swift/hummingbird2/src/Package.swift b/frameworks/Swift/hummingbird2/src/Package.swift new file mode 100644 index 00000000000..a033651a2c3 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "server", + platforms: [.macOS(.v14)], + products: [ + .executable(name: "server", targets: ["server"]) + ], + dependencies: [ + .package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0-beta"), + ], + targets: [ + .target(name: "server", + dependencies: [ + .product(name: "Hummingbird", package: "hummingbird"), + ], + swiftSettings: [ + // Enable better optimizations when building in Release configuration. Despite the use of + // the `.unsafeFlags` construct required by SwiftPM, this flag is recommended for Release + // builds. See for details. + .unsafeFlags(["-cross-module-optimization"], .when(configuration: .release)) + ] + ), + ] +) diff --git a/frameworks/Swift/hummingbird2/src/Sources/server/main.swift b/frameworks/Swift/hummingbird2/src/Sources/server/main.swift new file mode 100644 index 00000000000..f652046a166 --- /dev/null +++ b/frameworks/Swift/hummingbird2/src/Sources/server/main.swift @@ -0,0 +1,48 @@ +import Hummingbird +import Logging +import NIOCore + +struct Object: ResponseEncodable { + let message: String +} + +struct TechFrameworkRequestContext: RequestContext { + static let jsonEncoder = JSONEncoder() + static let jsonDecoder = JSONDecoder() + + var coreContext: Hummingbird.CoreRequestContext + + // Use a global JSON Encoder + var responseEncoder: JSONEncoder { Self.jsonEncoder } + // Use a global JSON Decoder + var requestDecoder: JSONDecoder { Self.jsonDecoder } + + init(channel: any Channel, logger: Logger) { + self.coreContext = .init(allocator: channel.allocator, logger: logger) + } +} + +func runApp() async throws { + let env = Environment() + let serverHostName = env.get("SERVER_HOSTNAME") ?? "127.0.0.1" + let serverPort = env.get("SERVER_PORT", as: Int.self) ?? 8080 + + let router = Router(context: TechFrameworkRequestContext.self) + router.get("plaintext") { _,_ in + "Hello, world!" + } + router.get("json") { _,_ in + Object(message: "Hello, world!") + } + let app = Application( + router: router, + configuration: .init( + address: .hostname(serverHostName, port: serverPort), + serverName: "HB", + backlog: 8192 + ) + ) + try await app.runService() +} + +try await runApp() diff --git a/frameworks/Swift/kitura/.gitignore b/frameworks/Swift/kitura/.gitignore deleted file mode 100644 index 94822102415..00000000000 --- a/frameworks/Swift/kitura/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -.build -build_gcd -.swiftenv -Packages -*.xcodeproj diff --git a/frameworks/Swift/kitura/.swift-version b/frameworks/Swift/kitura/.swift-version deleted file mode 100644 index 4d0dcda01c4..00000000000 --- a/frameworks/Swift/kitura/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.1.2 diff --git a/frameworks/Swift/kitura/Package.swift b/frameworks/Swift/kitura/Package.swift deleted file mode 100644 index 89164e6e02d..00000000000 --- a/frameworks/Swift/kitura/Package.swift +++ /dev/null @@ -1,51 +0,0 @@ -// swift-tools-version:4.0 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "Kitura-TechEmpower", - dependencies: [ - .package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.6.0")), - .package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.8.0"), - .package(url: "https://github.com/IBM-Swift/HeliumLogger.git", from: "1.8.0"), - .package(url: "https://github.com/IBM-Swift/Configuration.git", from: "3.0.0"), - .package(url: "https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL.git", from: "2.0.0"), - .package(url: "https://github.com/IBM-Swift/Swift-Kuery-ORM.git", from: "0.4.0"), - .package(url: "https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git", from: "1.9.0"), - .package(url: "https://github.com/IBM-Swift/Kitura-MustacheTemplateEngine.git", from: "1.7.2"), - .package(url: "https://github.com/OpenKitten/MongoKitten.git", from: "4.1.3"), - ], - targets: [ - .target( - name: "TechEmpowerCommon", - dependencies: []), - .target( - name: "KueryPostgres", - dependencies: [.target(name: "TechEmpowerCommon"), "Configuration", "SwiftKueryPostgreSQL"]), - .target( - name: "KueryPostgresRaw", - dependencies: [.target(name: "KueryPostgres"), "LoggerAPI"]), - .target( - name: "KueryPostgresORM", - dependencies: [.target(name: "KueryPostgres"), "LoggerAPI", "SwiftKueryORM"]), - .target( - name: "TechEmpower", - dependencies: ["Kitura"]), - .target( - name: "TechEmpowerPostgres", - dependencies: [.target(name: "KueryPostgresRaw"), "Kitura", "HeliumLogger", "KituraStencil"]), - .target( - name: "TechEmpowerPostgresORM", - dependencies: [.target(name: "KueryPostgresORM"), "Kitura", "HeliumLogger", "KituraStencil"]), - .target( - name: "TechEmpowerPostgresORMCodable", - dependencies: [.target(name: "KueryPostgresORM"), "Kitura", "HeliumLogger", "KituraStencil"]), - .target( - name: "TechEmpowerPostgresMustache", - dependencies: [.target(name: "KueryPostgresRaw"), "Kitura", "HeliumLogger", "KituraMustache"]), - .target( - name: "TechEmpowerMongoKitten", - dependencies: [.target(name: "TechEmpowerCommon"), "Kitura", "HeliumLogger", "Configuration", "MongoKitten", "KituraStencil"]), - ] -) diff --git a/frameworks/Swift/kitura/README.md b/frameworks/Swift/kitura/README.md deleted file mode 100644 index aacadafd94b..00000000000 --- a/frameworks/Swift/kitura/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# [Kitura](https://kitura.io) Benchmark Test - -This is the [Kitura](https://kitura.io) portion of a [benchmarking test suite](https://www.techempower.com/benchmarks/) comparing a variety of web development platforms. - -## Variants - -The benchmark is split up into multiple executable targets, demonstrating different database backends and uses of the Kitura routing APIs: -- `kitura`: Implementations of Plaintext and JSON using 'raw' (Express-style) routing -- `kitura-postgres`: Implementation of database tests, using Postgres with Swift-Kuery (no ORM) -- `kitura-postgres-orm`: Equivalent implementation with Postgres and Swift-Kuery-ORM -- `kitura-postgres-orm-codable`: Equivalent implementation with Postgres, using [Codable Routing together with Swift-Kuery-ORM](https://developer.ibm.com/swift/2018/03/01/introducing-swift-kuery-orm/) -- `kitura-mongodb`: Implementation of database tests, using MongoDB with MongoKitten (no ORM) -- `kitura-nio`: `kitura` implementations of Plaintext and JSON run on [Kitura-NIO](https://github.com/IBM-Swift/Kitura-NIO) -- `kitura-nio-postgres`: Testing `kitura` implementations of database tests using Postgres on [Kitura-NIO](https://github.com/IBM-Swift/Kitura-NIO) - -There are additional variants for each of the above implementations, with the '-gcd' suffix: These are compiled from the same source, but use the Grand Central Dispatch threading model (used by default on macOS) instead of a direct epoll implementation (the default on Linux). - -Each listens on port 8080, and uses the common URLs described below. - -## Versions and Dependencies - -This version of the benchmark requires Swift 4.0.3 or higher, and uses the following versions of Kitura and dependencies: - -- [Kitura 2.5](https://github.com/IBM-Swift/Kitura) -- [HeliumLogger 1.x](https://github.com/IBM-Swift/HeliumLogger) -- [Configuration 3.x](https://github.com/IBM-Swift/Configuration) -- [SwiftKueryPostgreSQL 1.x](https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL) -- [SwiftKueryORM 0.x](https://github.com/IBM-Swift/Swift-Kuery-ORM) -- [KituraStencil 1.x](https://github.com/IBM-Swift/Kitura-StencilTemplateEngine) -- [KituraMustache 1.x](https://github.com/IBM-Swift/Kitura-MustacheTemplateEngine) -- [MongoKitten 4.x](https://github.com/OpenKitten/MongoKitten) - -## Test URLs -### JSON serialization - -http://localhost:8080/json - -### Single database query - -http://localhost:8080/db - -### Multiple database queries - -http://localhost:8080/queries?queries=n - -### Fortunes - -http://localhost:8080/fortunes - -### Database updates - -http://localhost:8080/updates?queries=n - -### Plaintext - -http://localhost:8080/plaintext diff --git a/frameworks/Swift/kitura/Sources/KueryPostgres/Postgres.swift b/frameworks/Swift/kitura/Sources/KueryPostgres/Postgres.swift deleted file mode 100644 index a1c35e631df..00000000000 --- a/frameworks/Swift/kitura/Sources/KueryPostgres/Postgres.swift +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import SwiftKuery -import SwiftKueryPostgreSQL -import Configuration - -#if os(Linux) - import Glibc -#else - import Darwin -#endif - -// We will load our database configuration from config.json, but this can be -// overridden with the TFB_DB_CONFIG environment variable. -let configurationFilename: String = ProcessInfo.processInfo.environment["TFB_DB_CONFIG"] ?? "config.json" -let manager = ConfigurationManager().load(file: configurationFilename, relativeFrom: .pwd).load(.environmentVariables) - -let dbHost = manager["DB_HOST"] as? String ?? manager["db:host"] as? String ?? "localhost" -let dbPort = Int32(manager["DB_PORT"] as? String != nil ? Int(manager["DB_PORT"] as! String) ?? 5432 : manager["db:port"] as? Int ?? 5432) -let dbName = manager["db:name"] as? String ?? "hello_world" -let dbUser = manager["db:user"] as? String ?? "benchmarkdbuser" -let dbPass = manager["db:password"] as? String ?? "benchmarkdbpass" - -let dbConnPoolOpts = ConnectionPoolOptions(initialCapacity: 20, maxCapacity: 50) - -public let dbConnPool = PostgreSQLConnection.createPool(host: dbHost, port: dbPort, options: [.databaseName(dbName), .userName(dbUser), .password(dbPass)], poolOptions: dbConnPoolOpts) - diff --git a/frameworks/Swift/kitura/Sources/KueryPostgresORM/PostgresORM.swift b/frameworks/Swift/kitura/Sources/KueryPostgresORM/PostgresORM.swift deleted file mode 100644 index a267e9d4121..00000000000 --- a/frameworks/Swift/kitura/Sources/KueryPostgresORM/PostgresORM.swift +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import Dispatch -import LoggerAPI -import SwiftKuery -import SwiftKueryORM -import KueryPostgres -import TechEmpowerCommon - -// ORM conformance -extension RandomRow: Model { - public static var tableName: String { return "world" } -} - -// ORM conformance -extension Fortune: Model { - public static var tableName: String { return "fortune" } -} - -// Configure our ORM Database connection pool as dbConnPool created by KueryPostgres -public func setupORM() { - Database.default = Database(dbConnPool) -} - -/// Get a list of Fortunes from the database. -/// -/// - Parameter callback: The callback that will be invoked once the DB query -/// has completed and results are available, passing an -/// optional [Fortune] (on success) or RequestError on -/// failure. -/// -public func getFortunes(callback: @escaping ([Fortune]?, RequestError?) -> Void) -> Void { - Fortune.findAll { (fortunes, err) in - if let err = err { - return callback(nil, err) - } else { - callback(fortunes, nil) - } - } -} - -/// Get a random row (range 1 to 10,000) from the database. -/// -/// - Parameter callback: The callback that will be invoked once the DB query -/// has completed and results are available, passing an -/// optional RandomRow (on success) or RequestError on -/// failure. -/// -public func getRandomRow(callback: @escaping (RandomRow?, RequestError?) -> Void) -> Void { - // Select random row from database range - let rnd = RandomRow.randomId - RandomRow.find(id: rnd, callback) -} - -/// Updates a row of World to a new value. -/// -/// - Parameter callback: The callback that will be invoked once the DB update -/// has completed, passing an optional RequestError if the -/// update failed. -/// -public func updateRow(id: Int, callback: @escaping (RequestError?) -> Void) -> Void { - // Generate a random number for this row - let row = RandomRow(id: id, randomNumber: RandomRow.randomValue) - row.update(id: id) { (resultRow, err) in - if let err = err { - return callback(err) - } else { - callback(nil) - } - } -} - -/// Get `count` random rows from the database, and pass the resulting array -/// to a completion handler (or a RequestError, in the event that a row could -/// not be retrieved). -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter result: The intermediate result array being built -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func getRandomRows(count: Int, result: [RandomRow] = [], completion: @escaping ([RandomRow]?, RequestError?) -> Void) { - if count > 0 { - // Select random row from database range - RandomRow.find(id: RandomRow.randomId) { (resultRow, err) in - if let resultRow = resultRow { - var result = result - result.append(resultRow) - getRandomRows(count: count-1, result: result, completion: completion) - } else { - if let err = err { - completion(nil, err) - } else { - fatalError("Unexpected: result and error both nil") - } - } - } - } else { - completion(result, nil) - } -} - -/// A parallel version of `getRandomRows` that invokes each get in parallel, builds an -/// array of results and waits for each get to complete before returning. -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func getRandomRowsParallel(count: Int, completion: @escaping ([RandomRow]?, RequestError?) -> Void) { - var results: [RandomRow] = [] - guard count > 0 else { - return completion(results, nil) - } - // Used to protect result array from concurrent modification - let updateLock = DispatchSemaphore(value: 1) - // Execute each query. Each callback will append its result to `results` - for _ in 1...count { - RandomRow.find(id: RandomRow.randomId) { (resultRow, err) in - guard let resultRow = resultRow else { - Log.error("\(err ?? .internalServerError)") - completion(nil, err ?? .internalServerError) - return - } - updateLock.wait() - results.append(resultRow) - if results.count == count { - completion(results, nil) - } - updateLock.signal() - } - } -} - -/// Update and retrieve `count` random rows from the database, and pass the -/// resulting array to a completion handler (or a RequestError, in the event -/// that a row could not be retrieved or updated). -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter result: The intermediate result array being built -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func updateRandomRows(count: Int, result: [RandomRow] = [], completion: @escaping ([RandomRow]?, RequestError?) -> Void) { - if count > 0 { - // Select random row from database range - RandomRow.find(id: RandomRow.randomId) { (resultRow, err) in - if let resultRow = resultRow { - var result = result - let row = RandomRow(id: resultRow.id, randomNumber: RandomRow.randomValue) - row.update(id: row.id) { (resultRow, err) in - if let resultRow = resultRow { - result.append(resultRow) - updateRandomRows(count: count-1, result: result, completion: completion) - } else { - completion(nil, err) - } - } - } else { - if let err = err { - completion(nil, err) - } else { - fatalError("Unexpected: result and error both nil") - } - } - } - } else { - completion(result, nil) - } -} - -/// A parallel version of `updateRandomRows` that invokes each get/update operation -/// in parallel, builds an array of results and waits for each get to complete before -/// returning. -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func updateRandomRowsParallel(count: Int, completion: @escaping ([RandomRow]?, RequestError?) -> Void) { - var results: [RandomRow] = [] - guard count > 0 else { - return completion(results, nil) - } - // Used to protect result array from concurrent modification - let updateLock = DispatchSemaphore(value: 1) - // Execute each query. Each callback will append its result to `results` - for _ in 1...count { - RandomRow.find(id: RandomRow.randomId) { (resultRow, err) in - guard let resultRow = resultRow else { - Log.error("\(err ?? .internalServerError)") - completion(nil, err ?? .internalServerError) - return - } - let row = RandomRow(id: resultRow.id, randomNumber: RandomRow.randomValue) - row.update(id: row.id) { (resultRow, err) in - if let resultRow = resultRow { - updateLock.wait() - results.append(resultRow) - if results.count == count { - completion(results, nil) - } - updateLock.signal() - } else { - Log.error("\(err ?? .internalServerError)") - completion(nil, err ?? .internalServerError) - return - } - } - } - } -} diff --git a/frameworks/Swift/kitura/Sources/KueryPostgresRaw/PostgresRaw.swift b/frameworks/Swift/kitura/Sources/KueryPostgresRaw/PostgresRaw.swift deleted file mode 100644 index c32d6784933..00000000000 --- a/frameworks/Swift/kitura/Sources/KueryPostgresRaw/PostgresRaw.swift +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import LoggerAPI -import SwiftKuery -import KueryPostgres -import TechEmpowerCommon - -let dbRows = 10000 -let maxValue = 10000 - -// Kuery table definition for World -class World: Table { - let tableName = "world" - - let id = Column("id") - let randomNumber = Column("randomnumber") -} - -// Kuery table definition for Fortune -class Fortunes: Table { - let tableName = "fortune" - - let id = Column("id") - let message = Column("message") -} - -let world = World() -let fortunes = Fortunes() - -// Kuery update statement for Updates -var update = Update(world, set: [(world.randomNumber, RandomRow.randomValue)]) - .where(world.id == RandomRow.randomId) - -/// Get a list of Fortunes from the database. -/// -/// - Parameter callback: The callback that will be invoked once the DB query -/// has completed and results are available, passing an -/// optional [Fortune] (on success) or AppError on -/// failure. -/// -public func getFortunes(callback: @escaping ([Fortune]?, AppError?) -> Void) -> Void { - // Get a dedicated connection object for this transaction from the pool - dbConnPool.getConnection { (dbConn, dbConnErr) in - guard let dbConn = dbConn else { - guard let err = dbConnErr else { - return callback(nil, AppError.OtherError("Unknown error getting connection from pool")) - } - return callback(nil, AppError.OtherError("Error getting connection from pool: \(err)")) - } - // Initiate database query - let query = Select(from: fortunes) - dbConn.execute(query: query) { result in - var resultFortunes: [Fortune] = [] - // Retrieve all rows from the query result - result.asRows { - results, err in - guard let results = results else { - guard let err = err else { - return callback(nil, AppError.DBKueryError("Query failed, and no error was returned")) - } - return callback(nil, AppError.DBKueryError("Query failed: \(err)")) - } - do { - // Transform the result rows into an array of Fortune objects - resultFortunes = try results.map { try Fortune.init(row: $0) } - } catch { - return callback(nil, AppError.DataFormatError("\(error)")) - } - // Invoke callback with results - callback(resultFortunes, nil) - } - } - } -} - -/// Alternate implementation of getFortunes that uses ResultSet.forEach to fetch each -/// database row sequentially, rather than QueryResult.asRows (which produces an array -/// of rows). The benefit of forEach is that we do not need to hold two copies of the -/// entire result set in memory. -/// -/// - Parameter callback: The callback that will be invoked once the DB query -/// has completed and results are available, passing an -/// optional [Fortune] (on success) or AppError on -/// failure. -/// -public func getFortunes_forEach(callback: @escaping ([Fortune]?, AppError?) -> Void) -> Void { - // Get a dedicated connection object for this transaction from the pool - dbConnPool.getConnection { (dbConn, dbConnErr) in - guard let dbConn = dbConn else { - guard let err = dbConnErr else { - return callback(nil, AppError.OtherError("Unknown error getting connection from pool")) - } - return callback(nil, AppError.OtherError("Error getting connection from pool: \(err)")) - } - // Initiate database query - let query = Select(from: fortunes) - dbConn.execute(query: query) { result in - var resultFortunes: [Fortune] = [] - guard let results = result.asResultSet else { - guard let queryErr = result.asError else { - return callback(nil, AppError.DBKueryError("Expected a result set, but result was \(result)")) - } - return callback(nil, AppError.DBKueryError("Query failed: \(queryErr)")) - } - // Build an array of Fortune objects - results.forEach { (values, rowErr, next) in - guard let values = values else { - // Reached the final row - call back with the results - return callback(resultFortunes, nil) - } - // Append this Fortune to the list - do { - resultFortunes.append(try Fortune(values: values)) - // Process the next column - next() - } catch { - return callback(nil, AppError.DataFormatError("\(error)")) - } - } - } - } -} - -/// Get a random row (range 1 to 10,000) from the database. -/// -/// - Parameter callback: The callback that will be invoked once the DB query -/// has completed and results are available, passing an -/// optional RandomRow (on success) or AppError on -/// failure. -/// -public func getRandomRow_Raw(callback: @escaping (RandomRow?, AppError?) -> Void) -> Void { - // Get a dedicated connection object for this transaction from the pool - dbConnPool.getConnection { (dbConn, dbConnErr) in - guard let dbConn = dbConn else { - guard let dbConnErr = dbConnErr else { - return callback(nil, AppError.OtherError("Unknown error getting connection from pool")) - } - return callback(nil, AppError.OtherError("Error getting connection from pool: \(dbConnErr)")) - } - // Select random row from database range - let rnd = RandomRow.randomId - let query = Select(world.randomNumber, from: world) - .where(world.id == rnd) - // Initiate database query - dbConn.execute(query: query) { result in - guard let resultSet = result.asResultSet else { - guard let queryErr = result.asError else { - return callback(nil, AppError.DBKueryError("Expected a result set, but result was \(result)")) - } - return callback(nil, AppError.DBKueryError("Query failed: \(queryErr)")) - } - resultSet.nextRow { - values, nextErr in - guard let values = values else { - guard let nextErr = nextErr else { - return callback(nil, AppError.DBKueryError("Query failed, and no error was returned")) - } - return callback(nil, AppError.DBKueryError("Query failed: \(nextErr)")) - } - // There should be exactly one value - guard values.count == 1 else { - return callback(nil, AppError.DBKueryError("\(values.count) values returned, expected 1, for query '\(query)'")) - } - // The value should be an Int32 - guard let randomNumber = values[0] as? Int32 else { - return callback(nil, AppError.DBKueryError("Could not convert \(String(describing: values[0])) to Int32")) - } - let resultRow = RandomRow(id: rnd, randomNumber: Int(randomNumber)) - // Invoke callback with results - callback(resultRow, nil) - } - } - } -} - -/// Updates a row of World to a new value. -/// -/// - Parameter callback: The callback that will be invoked once the DB update -/// has completed, passing an optional AppError if the -/// update failed. -/// -public func updateRow_Raw(id: Int, callback: @escaping (AppError?) -> Void) -> Void { - // Get a dedicated connection object for this transaction from the pool - dbConnPool.getConnection { (dbConn, err) in - guard let dbConn = dbConn else { - guard let err = err else { - return callback(AppError.OtherError("Unknown error getting connection from pool")) - } - return callback(AppError.OtherError("Error getting connection from pool: \(err)")) - } - // Generate a random number for this row - let rndValue = RandomRow.randomValue - let query = Update(world, set: [(world.randomNumber, rndValue)]) - .where(world.id == id) - // Initiate database query - dbConn.execute(query: query) { result in - guard result.success else { - return callback(AppError.DBKueryError("Update failed: \(String(describing: result.asError))")) - } - // Invoke callback once done - callback(nil) - } - } -} - -/// Get `count` random rows from the database, and pass the resulting array -/// to a completion handler (or an AppError, in the event that a row could -/// not be retrieved). -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter result: The intermediate result array being built -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func getRandomRows_Raw(count: Int, result: [RandomRow] = [], completion: @escaping ([RandomRow]?, AppError?) -> Void) { - if count > 0 { - // Select random row from database range - getRandomRow_Raw { (resultRow, err) in - if let resultRow = resultRow { - var result = result - result.append(resultRow) - // Call recursively to get remaining rows - getRandomRows_Raw(count: count-1, result: result, completion: completion) - } else { - if let err = err { - completion(nil, err) - } else { - fatalError("Unexpected: result and error both nil") - } - } - } - } else { - completion(result, nil) - } -} - -/// Update and retrieve `count` random rows from the database, and pass the -/// resulting array to a completion handler (or an AppError, in the event -/// that a row could not be retrieved or updated). -/// -/// - Parameter count: The number of rows to retrieve -/// - Parameter result: The intermediate result array being built -/// - Parameter completion: The closure to invoke with the result array, or error -/// -public func updateRandomRows_Raw(count: Int, result: [RandomRow] = [], completion: @escaping ([RandomRow]?, AppError?) -> Void) { - if count > 0 { - // Select random row from database range - getRandomRow_Raw { (resultRow, err) in - if let resultRow = resultRow { - var result = result - // Execute inner callback for updating the row - updateRow_Raw(id: resultRow.id) { (err) in - if let err = err { - return completion(nil, err) - } - result.append(resultRow) - // Call recursively to update remaining rows - updateRandomRows_Raw(count: count-1, result: result, completion: completion) - } - } else { - if let err = err { - completion(nil, err) - } else { - fatalError("Unexpected: result and error both nil") - } - } - } - } else { - completion(result, nil) - } -} diff --git a/frameworks/Swift/kitura/Sources/TechEmpower/main.swift b/frameworks/Swift/kitura/Sources/TechEmpower/main.swift deleted file mode 100644 index 83a9f083fc5..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpower/main.swift +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import Kitura -import TechEmpowerCommon - -let router = Router() - -// -// TechEmpower test 6: plaintext -// -router.get("/plaintext") { - request, response, next in - response.headers["Server"] = "Kitura" - response.headers["Content-Type"] = "text/plain" - try response.status(.OK).send("Hello, world!").end() -} - -// -// TechEmpower test 1: JSON serialization -// -router.get("/json") { - request, response, next in - response.headers["Server"] = "Kitura" - let result = ["message":"Hello, World!"] - try response.status(.OK).send(json: result).end() -} - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Error.swift b/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Error.swift deleted file mode 100644 index d8b1b78614f..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Error.swift +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/// Represents various errors that can occur with the Kitura TechEmpower benchmark. -public enum AppError: Error { - - /// An error occurring when executing a raw SQL query against a database. - case DBError(String, query: String) - - /// An error occurring when executing a Kuery operation against a database. - case DBKueryError(String) - - /// An error occurring when the format of the data retrieved by a database - /// operation was not as expected. - case DataFormatError(String) - - /// An error occurring when a connection to the database cannot be established. - case ConnectionError(String) - - /// Any other type of error - case OtherError(String) -} diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Fortune.swift b/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Fortune.swift deleted file mode 100644 index 182c3a95d61..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/Fortune.swift +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation - -public struct Fortune: Codable { - - /// The id of this Fortune - public let id: Int - - /// The message contained within this Fortune - public let message: String - - public init(id: Int, message: String) { - self.id = id - self.message = message - } - - /// Create a Fortune instance from a [String: Any?] dictionary, - /// such as that retrieved by Kuery using `QueryResult.asRows()`. - /// - /// - Parameter row: A dictionary representing the fields of a - /// Fortune database row. - /// - throws: if the fields and types contained in the dictionary - /// do not match those expected. - public init(row: [String:Any?]) throws { - guard let idField = row["id"] else { - throw AppError.DataFormatError("Missing 'id' field") - } - guard let msgField = row["message"] else { - throw AppError.DataFormatError("Missing 'message' field") - } - guard let message = msgField as? String else { - throw AppError.DataFormatError("'message' field not a String") - } - guard let id = idField as? Int32 else { - throw AppError.DataFormatError("'id' field not an Int32") - } - self.init(id: Int(id), message: message) - } - - /// Create a Fortune instance from an [Any?] array, such as that retrieved - /// by Kuery using `ResultSet.forEach()`. - /// - /// - Parameter row: An array representing the fields of a Fortune - /// database row. - /// - throws: if the fields and types contained in the array do not match - /// those expected. - public init(values: [Any?]) throws { - // There should be two columns - guard values.count == 2 else { - throw AppError.DBKueryError("Expected 2 values but found \(values.count)") - } - // First should be an Int32 - guard let id = values[0] as? Int32 else { - throw AppError.DataFormatError("Fortune id '\(String(describing: values[0]))' is not an Int") - } - // Second should be a String - guard let msg = values[1] as? String else { - throw AppError.DataFormatError("Fortune message '\(String(describing: values[1]))' is not a String") - } - self.init(id: Int(id), message: msg) - } - -} - -extension Fortune: Comparable { - - public static func == (lhs: Fortune, rhs: Fortune) -> Bool { - return lhs.id == rhs.id && lhs.message == rhs.message - } - - public static func < (lhs: Fortune, rhs: Fortune) -> Bool { - return lhs.message < rhs.message || (lhs.message == rhs.message && lhs.id < rhs.id) - } - -} diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/RandomRow.swift b/frameworks/Swift/kitura/Sources/TechEmpowerCommon/RandomRow.swift deleted file mode 100644 index 053dc6cba11..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerCommon/RandomRow.swift +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation - -// Return a random number within the range of rows in the database -private func randomNumberGenerator(_ maxVal: Int) -> Int { - #if os(Linux) - return Int(random() % maxVal) + 1 - #else - return Int(arc4random_uniform(UInt32(maxVal))) + 1 - #endif -} - -public struct RandomRow: Codable { - - /// The number of rows in the World table - public static let dbRows = 10000 - - /// The maximum value for randomNumber - public static let maxValue = 10000 - - /// A generated random row id suitable for retrieving - /// or creating a RandomRow instance. - public static var randomId: Int { - return randomNumberGenerator(dbRows) - } - - /// A generated random value suitable for assigning as the - /// `randomNumber` for a RandomRow instance. - public static var randomValue: Int { - return randomNumberGenerator(maxValue) - } - - /// The id for this RandomRow, ranging from 1 to dbRows - public let id: Int - - /// A random number ranging from 1 to maxValue - public let randomNumber: Int - - public init(id: Int, randomNumber: Int) { - self.id = id - self.randomNumber = randomNumber - } - - /// Map the properties of this type to their corresponding database - /// column names (required by the ORM). - enum CodingKeys: String, CodingKey { - case id - case randomNumber = "randomnumber" - } - - /// Returns a JSON-convertible dictionary representation of this RandomRow. - public func asDictionary() -> [String: Int] { - return ["id": self.id, "randomNumber": self.randomNumber] - } -} diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/Mongo.swift b/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/Mongo.swift deleted file mode 100644 index b4398d0523b..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/Mongo.swift +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import LoggerAPI -import Configuration -import MongoKitten -import TechEmpowerCommon - -#if os(Linux) - import Glibc -#else - import Darwin -#endif - -public enum MongoAppError: Error { - case MongoError(String) -} - -// We will load our database configuration from config.json, but this can be -// overridden with the TFB_DB_CONFIG environment variable. -let configurationFilename: String = ProcessInfo.processInfo.environment["TFB_DB_CONFIG"] ?? "config.json" -let manager = ConfigurationManager().load(file: configurationFilename, relativeFrom: .pwd).load(.environmentVariables) - -let dbHost = manager["DB_HOST"] as? String ?? manager["mongodb:host"] as? String ?? "localhost" -let dbPort = Int32(manager["DB_PORT"] as? String != nil ? Int(manager["DB_PORT"] as! String) ?? 27017 : manager["mongodb:port"] as? Int ?? 27017) -let dbName = manager["mongodb:name"] as? String ?? "hello_world" -let dbUser = manager["mongodb:user"] as? String ?? "benchmarkdbuser" -let dbPass = manager["mongodb:password"] as? String ?? "benchmarkdbpass" - -let dbRows = 10000 -let maxValue = 10000 - -var myDatabase: MongoKitten.Database? -var world: MongoKitten.Collection? -var fortune: MongoKitten.Collection? - -func connectToDB() throws { - let connectString = "mongodb://\(dbHost):\(dbPort)/\(dbName)" - Log.info("Connect string = \(connectString)") - //myDatabase = try MongoKitten.Database("mongodb://\(dbUser):\(dbPass)@\(dbHost):\(dbPort)/\(dbName)") - myDatabase = try MongoKitten.Database(connectString) - guard let myDatabase = myDatabase else { - throw AppError.ConnectionError("Nil MongoDB connection to \(connectString)") - } - guard myDatabase.server.isConnected else { - throw AppError.ConnectionError("Not connected to \(connectString)") - } - world = myDatabase["world"] - fortune = myDatabase["fortune"] -} - -// Allow construction of a Fortune from a MongoKitten Document -extension Fortune { - init(document: Document) throws { - if let id = Int(document["_id"]), let message = String(document["message"]) { - self.init(id: id, message: message) - } else { - throw AppError.DataFormatError("Expected fields of Fortune document could not be retreived") - } - } -} - -func getFortunes() throws -> [Fortune] { - guard let fortune = fortune else { - throw MongoAppError.MongoError("Fortune collection not initialized") - } - -// let allFortunes: [Document] = Array(try fortune.find()) - let allFortunes = try fortune.find() - let resultFortunes: [Fortune] = try allFortunes.map { try Fortune.init(document: $0) } - return resultFortunes -} - -// Get a random row (range 1 to 10,000) from DB: id(int),randomNumber(int) -// Convert to object using object-relational mapping (ORM) tool -// Serialize object to JSON - example: {"id":3217,"randomNumber":2149} -func getRandomRow() throws -> [String:Int] { - guard let world = world else { - throw MongoAppError.MongoError("World collection not initialized") - } - - let rnd = RandomRow.randomId - let result = try world.findOne("_id" == rnd) - guard let document = result else { - throw AppError.DataFormatError("World entry id=\(rnd) not found") - } - guard let id = Int(document["_id"]), let randomNumber = Int(document["randomNumber"]) else { - throw AppError.DataFormatError("Expected fields of World document could not be retreived") - } - return ["id":id, "randomNumber":Int(randomNumber)] -} - -// Updates a row of World to a new value. -func updateRandomRow() throws -> [String:Int] { - guard let world = world else { - throw MongoAppError.MongoError("World collection not initialized") - } - - let rnd = RandomRow.randomId - let rndValue = RandomRow.randomValue - let document = try world.findAndUpdate("_id" == rnd, with: ["randomNumber": rndValue]) - guard let id = Int(document["_id"]), let randomNumber = Int(document["randomNumber"]) else { - throw AppError.DataFormatError("Expected fields of World document could not be retreived") - } - return ["id":id, "randomNumber":Int(randomNumber)] -} - - - diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/main.swift b/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/main.swift deleted file mode 100644 index d57d3a7937f..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerMongoKitten/main.swift +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Kitura -import LoggerAPI -import HeliumLogger -import MongoKitten -import KituraStencil -import Stencil -//import KituraMustache -import TechEmpowerCommon - -Log.logger = HeliumLogger(.info) - -// Stencil stuff -let ext = Extension() - -// Stencil does not yet support automatic HTML escaping: -// https://github.com/kylef/Stencil/pull/80 -// -ext.registerFilter("htmlencode") { (value: Any?) in - if let value = value as? String { - return value - .replacingOccurrences(of: "&", with: "&") - .replacingOccurrences(of: "<", with: "<") - .replacingOccurrences(of: ">", with: ">") - .replacingOccurrences(of: "'", with: "'") - .replacingOccurrences(of: "\"", with: """) - } - return value -} - -let router = Router() -router.add(templateEngine: StencilTemplateEngine(extension: ext)) -//router.add(templateEngine: MustacheTemplateEngine()) - -// -// TechEmpower test 2: Single database query (raw, no ORM) -// -router.get("/db") { - request, response, next in - response.headers["Server"] = "Kitura" - let dict = try getRandomRow() - try response.status(.OK).send(json: dict).end() -} - -// -// TechEmpower test 3: Multiple database queries (raw, no ORM) -// Get param provides number of queries: /queries?queries=N -// -router.get("/queries") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - var results: [[String:Int]] = [] - for _ in 1...numQueries { - let dict = try getRandomRow() - results.append(dict) - } - // Return JSON representation of array of results - try response.status(.OK).send(json: results).end() -} - -// -// TechEmpower test 4: fortunes (raw, no ORM) -// -router.get("/fortunes") { - request, response, next in - response.headers["Server"] = "Kitura" - response.headers["Content-Type"] = "text/html; charset=UTF-8" - var fortunes = try getFortunes() - fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time.")) - - try response.render("fortunes.stencil", context: ["fortunes": fortunes.sorted()]).end() - //try response.render("fortunes.mustache", context: ["fortunes": fortunes.sorted()]).end() -} - -// -// TechEmpower test 5: updates (raw, no ORM) -// -router.get("/updates") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - var results: [[String:Int]] = [] - for _ in 1...numQueries { - let dict = try updateRandomRow() - results.append(dict) - } - - // Return JSON representation of array of results - try response.status(.OK).send(json: results).end() -} - -// Initialize MongoDB connection -do { - try connectToDB() -} catch { - print("Error connecting to database: \(error)") -} - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerPostgres/main.swift b/frameworks/Swift/kitura/Sources/TechEmpowerPostgres/main.swift deleted file mode 100644 index e6bfed0b8b7..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerPostgres/main.swift +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import Kitura -import LoggerAPI -import HeliumLogger -import KituraStencil -import Stencil -import TechEmpowerCommon -import KueryPostgresRaw - -Log.logger = HeliumLogger(.info) - -// Stencil stuff -let ext = Extension() - -// Stencil does not yet support automatic HTML escaping: -// https://github.com/kylef/Stencil/pull/80 -// -ext.registerFilter("htmlencode") { (value: Any?) in - if let value = value as? String { - return value - .replacingOccurrences(of: "&", with: "&") - .replacingOccurrences(of: "<", with: "<") - .replacingOccurrences(of: ">", with: ">") - .replacingOccurrences(of: "'", with: "'") - .replacingOccurrences(of: "\"", with: """) - } - return value -} - -let router = Router() -router.add(templateEngine: StencilTemplateEngine(extension: ext)) - -// -// TechEmpower test 2: Single database query (raw, no ORM) -// -router.get("/db") { - request, response, next in - response.headers["Server"] = "Kitura" - getRandomRow_Raw { (row, err) in - guard let row = row else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - try? response.status(.OK).send(json: row.asDictionary()).end() - } -} - -// -// TechEmpower test 3: Multiple database queries (raw, no ORM) -// Get param provides number of queries: /queries?queries=N -// -router.get("/queries") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - getRandomRows_Raw(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - -router.get("/queriesParallel") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - var results: [[String:Int]] = [] - // Used to protect result array from concurrent modification - let updateLock = DispatchSemaphore(value: 1) - // Execute each query. Each callback will append its result to `results` - for _ in 1...numQueries { - getRandomRow_Raw { (row, err) in - guard let row = row else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - updateLock.wait() - results.append(row.asDictionary()) - if results.count == numQueries { - // Return JSON representation of array of results - try? response.status(.OK).send(json: results).end() - } - updateLock.signal() - } - } -} - -// -// TechEmpower test 4: fortunes (raw, no ORM) -// -router.get("/fortunes") { - request, response, next in - response.headers["Server"] = "Kitura" - response.headers["Content-Type"] = "text/html; charset=UTF-8" - getFortunes { (fortunes, err) in - guard var fortunes = fortunes else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time.")) - do { - try response.render("fortunes.stencil", context: ["fortunes": fortunes.sorted()]).end() - } catch { - print("Error: \(error)") - } - } -} - -// -// TechEmpower test 5: updates (raw, no ORM) -// -router.get("/updates") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - updateRandomRows_Raw(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - - -router.get("/updatesParallel") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - var results: [[String:Int]] = [] - // Used to protect result array from concurrent modification - let updateLock = DispatchSemaphore(value: 1) - // Execute each query. Each callback will append its result to `results` - for _ in 1...numQueries { - getRandomRow_Raw { (row, err) in - guard let row = row else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - // Execute inner callback for updating the row - updateRow_Raw(id: row.id) { (err) in - if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - updateLock.wait() - results.append(row.asDictionary()) - if results.count == numQueries { - // Return JSON representation of array of results - try? response.status(.OK).send(json: results).end() - } - updateLock.signal() - } - } - } -} - - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/Fortune+Mustache.swift b/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/Fortune+Mustache.swift deleted file mode 100644 index ba747436c06..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/Fortune+Mustache.swift +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Mustache -import TechEmpowerCommon - -extension Fortune: MustacheBoxable { - public var mustacheBox: MustacheBox { - return Box(["id": self.id, "message": self.message]) - } -} diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/main.swift b/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/main.swift deleted file mode 100644 index 6fa6531c56d..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresMustache/main.swift +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Kitura -import LoggerAPI -import HeliumLogger -import KituraMustache -import TechEmpowerCommon -import KueryPostgresRaw - -Log.logger = HeliumLogger(.info) - -let router = Router() -router.add(templateEngine: MustacheTemplateEngine()) - -// -// TechEmpower test 4: fortunes (raw, no ORM) -// -router.get("/fortunes") { - request, response, next in - response.headers["Server"] = "Kitura" - response.headers["Content-Type"] = "text/html; charset=UTF-8" - getFortunes { (fortunes, err) in - guard var fortunes = fortunes else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time.")) - do { - try response.render("fortunes.mustache", context: ["fortunes": fortunes.sorted()]).end() - } catch { - print("Error: \(error)") - } - } -} - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORM/main.swift b/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORM/main.swift deleted file mode 100644 index 56c1cdd9cb6..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORM/main.swift +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import Kitura -import LoggerAPI -import HeliumLogger -import KituraStencil -import Stencil -import TechEmpowerCommon -import KueryPostgresORM - -Log.logger = HeliumLogger(.info) - -// Stencil stuff -let ext = Extension() - -// Stencil does not yet support automatic HTML escaping: -// https://github.com/kylef/Stencil/pull/80 -// -ext.registerFilter("htmlencode") { (value: Any?) in - if let value = value as? String { - return value - .replacingOccurrences(of: "&", with: "&") - .replacingOccurrences(of: "<", with: "<") - .replacingOccurrences(of: ">", with: ">") - .replacingOccurrences(of: "'", with: "'") - .replacingOccurrences(of: "\"", with: """) - } - return value -} - -let router = Router() -router.add(templateEngine: StencilTemplateEngine(extension: ext)) - -setupORM() - -// -// TechEmpower test 2: Single database query (full ORM) -// -router.get("/db") { - request, response, next in - response.headers["Server"] = "Kitura" - getRandomRow { (row, err) in - guard let row = row else { - guard let err = err else { - Log.error("Unknown Error") - try? response.status(.badRequest).send("Unknown error").end() - return - } - Log.error("\(err)") - try? response.status(.badRequest).send("Error: \(err)").end() - return - } - try? response.status(.OK).send(json: row.asDictionary()).end() - } -} - -// -// TechEmpower test 3: Multiple database queries (full ORM) -// Get param provides number of queries: /queries?queries=N -// -router.get("/queries") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - getRandomRows(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - -router.get("/queriesParallel") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - getRandomRowsParallel(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - -// -// TechEmpower test 4: fortunes (full ORM) -// -router.get("/fortunes") { - request, response, next in - response.headers["Server"] = "Kitura" - response.headers["Content-Type"] = "text/html; charset=UTF-8" - Fortune.findAll { (fortunes, err) in - if var fortunes = fortunes { - fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time.")) - do { - try response.render("fortunes.stencil", context: ["fortunes": fortunes.sorted()]).end() - } catch { - try? response.status(.internalServerError).send("Error: \(error)").end() - } - } else { - try? response.status(.internalServerError).send("Error: \(err ?? .internalServerError)").end() - } - } -} - -// -// TechEmpower test 5: updates (full ORM) -// -router.get("/updates") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - updateRandomRows(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - -router.get("/updatesParallel") { - request, response, next in - response.headers["Server"] = "Kitura" - let queriesParam = request.queryParameters["queries"] ?? "1" - let numQueries = max(1, min(Int(queriesParam) ?? 1, 500)) // Snap to range of 1-500 as per test spec - updateRandomRowsParallel(count: numQueries) { (rows, err) in - if let rows = rows { - try? response.status(.OK).send(json: rows).end() - } else if let err = err { - try? response.status(.badRequest).send("Error: \(err)").end() - } else { - fatalError("Unexpected: rows and err both nil") - } - } -} - - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORMCodable/main.swift b/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORMCodable/main.swift deleted file mode 100644 index 1e3cd6b05cd..00000000000 --- a/frameworks/Swift/kitura/Sources/TechEmpowerPostgresORMCodable/main.swift +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright IBM Corporation 2018 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Foundation -import Kitura -import LoggerAPI -import HeliumLogger -import KituraStencil -import Stencil -import TechEmpowerCommon -import KueryPostgres -import SwiftKueryORM -import KueryPostgresORM - -Log.logger = HeliumLogger(.info) - -// Stencil stuff -let ext = Extension() - -// Stencil does not yet support automatic HTML escaping: -// https://github.com/kylef/Stencil/pull/80 -// -ext.registerFilter("htmlencode") { (value: Any?) in - if let value = value as? String { - return value - .replacingOccurrences(of: "&", with: "&") - .replacingOccurrences(of: "<", with: "<") - .replacingOccurrences(of: ">", with: ">") - .replacingOccurrences(of: "'", with: "'") - .replacingOccurrences(of: "\"", with: """) - } - return value -} - -let router = Router() -router.add(templateEngine: StencilTemplateEngine(extension: ext)) - -// Configure our ORM Database connection pool as dbConnPool created by KueryPostgres -Database.default = Database(dbConnPool) - -// Define the query parameters we can receive -struct TFBParams: QueryParams { - let queries: Int - - // Override default decode to cater for the query parameter specification: - // If the parameter is missing, is not an integer, or is an integer less - // than 1, the value should be interpreted as 1. - // This means that rather than failing to decode on a non-integer value, we - // should fall back to a value of 1. - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - if let value = try? container.decode(Int.self, forKey: CodingKeys.queries) { - self.queries = value - } else { - self.queries = 1 - } - } -} - -// Set Server header on all responses as per TechEmpower spec -router.all("/*") { - _, response, next in - response.headers["Server"] = "Kitura" - next() -} - -// -// TechEmpower test 2: Single database query (full ORM) -// -router.get("/db") { (respondWith: @escaping (RandomRow?, RequestError?) -> Void) in - // Select random row from database range - RandomRow.find(id: RandomRow.randomId, respondWith) -} - -// -// TechEmpower test 3: Multiple database queries (full ORM) -// Get param provides number of queries: /queries?queries=N -// -router.get("/queries") { (params: TFBParams, respondWith: @escaping ([RandomRow]?, RequestError?) -> Void) in - let numQueries = max(1, min(params.queries, 500)) // Snap to range of 1-500 as per test spec - getRandomRows(count: numQueries, completion: respondWith) -} -router.get("/queriesParallel") { (params: TFBParams, respondWith: @escaping ([RandomRow]?, RequestError?) -> Void) in - let numQueries = max(1, min(params.queries, 500)) // Snap to range of 1-500 as per test spec - getRandomRowsParallel(count: numQueries, completion: respondWith) -} - -// -// TechEmpower test 4: fortunes (full ORM) -// TODO: convert to Codable once templating support is available -// -router.get("/fortunes") { - request, response, next in - response.headers["Content-Type"] = "text/html; charset=UTF-8" - Fortune.findAll { (fortunes, err) in - if var fortunes = fortunes { - fortunes.append(Fortune(id: 0, message: "Additional fortune added at request time.")) - do { - try response.render("fortunes.stencil", context: ["fortunes": fortunes.sorted()]).end() - } catch { - try? response.status(.internalServerError).send("Error: \(error)").end() - } - } else { - try? response.status(.internalServerError).send("Error: \(err ?? .internalServerError)").end() - } - } -} - -// -// TechEmpower test 5: updates (full ORM) -// -router.get("/updates") { (params: TFBParams, respondWith: @escaping ([RandomRow]?, RequestError?) -> Void) in - let numQueries = max(1, min(params.queries, 500)) // Snap to range of 1-500 as per test spec - updateRandomRows(count: numQueries, completion: respondWith) -} -router.get("/updatesParallel") { (params: TFBParams, respondWith: @escaping ([RandomRow]?, RequestError?) -> Void) in - let numQueries = max(1, min(params.queries, 500)) // Snap to range of 1-500 as per test spec - updateRandomRowsParallel(count: numQueries, completion: respondWith) -} - - -Kitura.addHTTPServer(onPort: 8080, with: router) -Kitura.run() diff --git a/frameworks/Swift/kitura/Views/fortunes.mustache b/frameworks/Swift/kitura/Views/fortunes.mustache deleted file mode 100644 index b0b428ad908..00000000000 --- a/frameworks/Swift/kitura/Views/fortunes.mustache +++ /dev/null @@ -1,12 +0,0 @@ - - -Fortunes - - - -{{#fortunes}} - -{{/fortunes}} -
idmessage
{{id}}{{message}}
- - diff --git a/frameworks/Swift/kitura/Views/fortunes.stencil b/frameworks/Swift/kitura/Views/fortunes.stencil deleted file mode 100644 index 8076e082f24..00000000000 --- a/frameworks/Swift/kitura/Views/fortunes.stencil +++ /dev/null @@ -1,10 +0,0 @@ - - -Fortunes - - -{% for fortune in fortunes %} -{% endfor %} -
idmessage
{{ fortune.id }}{{ fortune.message | htmlencode }}
- - diff --git a/frameworks/Swift/kitura/benchmark_config.json b/frameworks/Swift/kitura/benchmark_config.json deleted file mode 100644 index e623175df5d..00000000000 --- a/frameworks/Swift/kitura/benchmark_config.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "framework": "kitura", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "none", - "framework": "Kitura", - "language": "Swift", - "orm": "none", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "postgres": { - "db_url": "/db", - "query_url": "/queries?queries=", - "fortune_url": "/fortunes", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Raw", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "postgres-orm": { - "db_url": "/db", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "postgres-orm-codable": { - "db_url": "/db", - "query_url": "/queries?queries=", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "mongodb": { - "db_url": "/db", - "query_url": "/queries?queries=", - "fortune_url": "/fortunes", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "MongoDB", - "framework": "Kitura", - "language": "Swift", - "orm": "Raw", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "gcd": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "none", - "framework": "Kitura", - "language": "Swift", - "orm": "none", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "nio": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "none", - "framework": "Kitura", - "language": "Swift", - "orm": "none", - "platform": "KituraNIO", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "gcd-postgres": { - "db_url": "/db", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Raw", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "nio-postgres": { - "db_url": "/db", - "query_url": "/queries?queries=", - "fortune_url": "/fortunes", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Raw", - "platform": "KituraNIO", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "gcd-postgres-orm": { - "db_url": "/db", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "nio-postgres-orm": { - "db_url": "/db", - "fortune_url": "/fortunes", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNIO", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "gcd-postgres-orm-codable": { - "db_url": "/db", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNet", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - }, - "nio-postgres-orm-codable": { - "db_url": "/db", - "query_url": "/queries?queries=", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "Postgres", - "framework": "Kitura", - "language": "Swift", - "orm": "Full", - "platform": "KituraNIO", - "webserver": "Kitura", - "os": "Linux", - "database_os": "Linux", - "display_name": "Kitura", - "notes": "", - "tags": ["broken"] - } - }] -} diff --git a/frameworks/Swift/kitura/config.json b/frameworks/Swift/kitura/config.json deleted file mode 100644 index 1c8e7fe38c3..00000000000 --- a/frameworks/Swift/kitura/config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db": { - "host": "tfb-database", - "port": 5432, - "name": "hello_world", - "user": "benchmarkdbuser", - "password": "benchmarkdbpass" - }, - "mongodb": { - "host": "tfb-database", - "port": 27017, - "name": "hello_world", - "user": "benchmarkdbuser", - "password": "benchmarkdbpass" - } -} diff --git a/frameworks/Swift/kitura/config.toml b/frameworks/Swift/kitura/config.toml deleted file mode 100644 index 774e2f69587..00000000000 --- a/frameworks/Swift/kitura/config.toml +++ /dev/null @@ -1,178 +0,0 @@ -[framework] -name = "kitura" - -[postgres-orm] -urls.db = "/db" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[gcd-postgres-orm-codable] -urls.db = "/db" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[gcd] -urls.plaintext = "/plaintext" -urls.json = "/json" -approach = "Realistic" -classification = "Fullstack" -database = "none" -database_os = "Linux" -os = "Linux" -orm = "none" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -approach = "Realistic" -classification = "Fullstack" -database = "none" -database_os = "Linux" -os = "Linux" -orm = "none" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[mongodb] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Fullstack" -database = "MongoDB" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[nio] -urls.plaintext = "/plaintext" -urls.json = "/json" -approach = "Realistic" -classification = "Fullstack" -database = "none" -database_os = "Linux" -os = "Linux" -orm = "none" -platform = "KituraNIO" -webserver = "Kitura" -versus = "None" - -[gcd-postgres-orm] -urls.db = "/db" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[nio-postgres-orm] -urls.db = "/db" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNIO" -webserver = "Kitura" -versus = "None" - -[nio-postgres] -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 = "Raw" -platform = "KituraNIO" -webserver = "Kitura" -versus = "None" - -[postgres-orm-codable] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[nio-postgres-orm-codable] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "KituraNIO" -webserver = "Kitura" -versus = "None" - -[gcd-postgres] -urls.db = "/db" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Fullstack" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" - -[postgres] -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 = "Raw" -platform = "KituraNet" -webserver = "Kitura" -versus = "None" diff --git a/frameworks/Swift/kitura/kitura-gcd-postgres-orm-codable.dockerfile b/frameworks/Swift/kitura/kitura-gcd-postgres-orm-codable.dockerfile deleted file mode 100644 index 2947f1ac419..00000000000 --- a/frameworks/Swift/kitura/kitura-gcd-postgres-orm-codable.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release -Xswiftc -DGCD_ASYNCH - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORMCodable diff --git a/frameworks/Swift/kitura/kitura-gcd-postgres-orm.dockerfile b/frameworks/Swift/kitura/kitura-gcd-postgres-orm.dockerfile deleted file mode 100644 index 8a76a84f73c..00000000000 --- a/frameworks/Swift/kitura/kitura-gcd-postgres-orm.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release -Xswiftc -DGCD_ASYNCH - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORM diff --git a/frameworks/Swift/kitura/kitura-gcd-postgres.dockerfile b/frameworks/Swift/kitura/kitura-gcd-postgres.dockerfile deleted file mode 100644 index 8f0a3f598dd..00000000000 --- a/frameworks/Swift/kitura/kitura-gcd-postgres.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release -Xswiftc -DGCD_ASYNCH - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgres diff --git a/frameworks/Swift/kitura/kitura-gcd.dockerfile b/frameworks/Swift/kitura/kitura-gcd.dockerfile deleted file mode 100644 index 11f0c6a8674..00000000000 --- a/frameworks/Swift/kitura/kitura-gcd.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release -Xswiftc -DGCD_ASYNCH - -EXPOSE 8080 - -CMD .build/release/TechEmpower diff --git a/frameworks/Swift/kitura/kitura-mongodb.dockerfile b/frameworks/Swift/kitura/kitura-mongodb.dockerfile deleted file mode 100644 index 8c8a7943d9b..00000000000 --- a/frameworks/Swift/kitura/kitura-mongodb.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerMongoKitten diff --git a/frameworks/Swift/kitura/kitura-nio-postgres-orm-codable.dockerfile b/frameworks/Swift/kitura/kitura-nio-postgres-orm-codable.dockerfile deleted file mode 100644 index dca3f44804e..00000000000 --- a/frameworks/Swift/kitura/kitura-nio-postgres-orm-codable.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -ENV KITURA_NIO=1 -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORMCodable diff --git a/frameworks/Swift/kitura/kitura-nio-postgres-orm.dockerfile b/frameworks/Swift/kitura/kitura-nio-postgres-orm.dockerfile deleted file mode 100644 index 37808bba760..00000000000 --- a/frameworks/Swift/kitura/kitura-nio-postgres-orm.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -ENV KITURA_NIO=1 -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORM diff --git a/frameworks/Swift/kitura/kitura-nio-postgres.dockerfile b/frameworks/Swift/kitura/kitura-nio-postgres.dockerfile deleted file mode 100644 index 0254fda2bdc..00000000000 --- a/frameworks/Swift/kitura/kitura-nio-postgres.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -ENV KITURA_NIO=1 -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgres diff --git a/frameworks/Swift/kitura/kitura-nio.dockerfile b/frameworks/Swift/kitura/kitura-nio.dockerfile deleted file mode 100644 index c19a4d71cf4..00000000000 --- a/frameworks/Swift/kitura/kitura-nio.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -ENV KITURA_NIO=1 -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpower diff --git a/frameworks/Swift/kitura/kitura-postgres-orm-codable.dockerfile b/frameworks/Swift/kitura/kitura-postgres-orm-codable.dockerfile deleted file mode 100644 index 39f69975b95..00000000000 --- a/frameworks/Swift/kitura/kitura-postgres-orm-codable.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORMCodable diff --git a/frameworks/Swift/kitura/kitura-postgres-orm.dockerfile b/frameworks/Swift/kitura/kitura-postgres-orm.dockerfile deleted file mode 100644 index 628a987c72f..00000000000 --- a/frameworks/Swift/kitura/kitura-postgres-orm.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgresORM diff --git a/frameworks/Swift/kitura/kitura-postgres.dockerfile b/frameworks/Swift/kitura/kitura-postgres.dockerfile deleted file mode 100644 index b7075dce6a2..00000000000 --- a/frameworks/Swift/kitura/kitura-postgres.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpowerPostgres diff --git a/frameworks/Swift/kitura/kitura.dockerfile b/frameworks/Swift/kitura/kitura.dockerfile deleted file mode 100644 index b720d4aa1b6..00000000000 --- a/frameworks/Swift/kitura/kitura.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD ./ /kitura -WORKDIR /kitura -RUN apt-get update -yqq && apt-get install -yqq libpq-dev -RUN swift build -c release - -EXPOSE 8080 - -CMD .build/release/TechEmpower diff --git a/frameworks/Swift/perfect/.gitignore b/frameworks/Swift/perfect/.gitignore deleted file mode 100644 index 94822102415..00000000000 --- a/frameworks/Swift/perfect/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.DS_Store -.build -build_gcd -.swiftenv -Packages -*.xcodeproj diff --git a/frameworks/Swift/perfect/Package.swift b/frameworks/Swift/perfect/Package.swift deleted file mode 100644 index 1735285d618..00000000000 --- a/frameworks/Swift/perfect/Package.swift +++ /dev/null @@ -1,25 +0,0 @@ -// swift-tools-version:4.0 - -import PackageDescription - -let package = Package( - name: "Perfect-TechEmpower", - products: [ - .executable(name: "Perfect", targets: ["Perfect"]), - .executable(name: "Perfect-MySQL", targets: ["Perfect-MySQL"]), - .executable(name: "Perfect-PostgreSQL", targets: ["Perfect-PostgreSQL"]), - .executable(name: "Perfect-MongoDB", targets: ["Perfect-MongoDB"]) - ], - dependencies: [ - .package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"), - .package(url:"https://github.com/PerfectlySoft/Perfect-MySQL.git", from: "3.0.0"), - .package(url: "https://github.com/PerfectlySoft/Perfect-PostgreSQL.git", from: "3.0.0"), - .package(url:"https://github.com/PerfectlySoft/Perfect-MongoDB.git", from: "3.0.0") - ], - targets: [ - .target(name: "Perfect", dependencies: ["PerfectHTTPServer"]), - .target(name: "Perfect-MySQL", dependencies: ["PerfectHTTPServer", "PerfectMySQL"]), - .target(name: "Perfect-PostgreSQL", dependencies: ["PerfectHTTPServer", "PerfectPostgreSQL"]), - .target(name: "Perfect-MongoDB", dependencies: ["PerfectHTTPServer", "PerfectMongoDB"]) - ] -) diff --git a/frameworks/Swift/perfect/README.md b/frameworks/Swift/perfect/README.md deleted file mode 100644 index ee78448860f..00000000000 --- a/frameworks/Swift/perfect/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# [Perfect](https://www.perfect.org) Benchmark Test - -This is the [Perfect](https://www.perfect.org) portion of a [benchmarking test suite](https://www.techempower.com/benchmarks/) comparing a variety of web development platforms. - -## Variants - -There is are four versions of the benchmark, three of which use databases: -- `Perfect`: No DB -- `Perfect-MySQL`: Using MySQL -- `Perfect-PostgreSQL`: Using PostgreSQL -- `Perfect-MongoDB`: Using MongoDB - -Each listens on port 8080, and use common URLs described below. - -## Versions and Dependencies - -This version of the benchmark requires Swift 4.1, and uses the following versions of Perfect and dependencies: - -- [Perfect 3.0](https://github.com/PerfectlySoft/Perfect-HTTPServer.git) -- [Perfect-MySQL 3.0](https://github.com/PerfectlySoft/Perfect-MySQL.git) -- [Perfect-PostgreSQL 3.0](https://github.com/PerfectlySoft/Perfect-PostgreSQL.git) -- [Perfect-MongoDB 3.0](https://github.com/PerfectlySoft/Perfect-MongoDB.git) - -## Test URLs -### JSON serialization - -http://localhost:8080/json - -### Plaintext - -http://localhost:8080/plaintext - -### DB Store - on all configurations - -http://localhost:8080/db - -### Queries - on all configurations - -http://localhost:8080/queries/queries=2 - -### Updates - on all configurations - -http://localhost:8080/updates/queries=2 \ No newline at end of file diff --git a/frameworks/Swift/perfect/Sources/Perfect-MongoDB/main.swift b/frameworks/Swift/perfect/Sources/Perfect-MongoDB/main.swift deleted file mode 100644 index 73c8460a17e..00000000000 --- a/frameworks/Swift/perfect/Sources/Perfect-MongoDB/main.swift +++ /dev/null @@ -1,316 +0,0 @@ -import PerfectHTTP -import PerfectHTTPServer -import PerfectLib -import PerfectMongoDB -import Foundation - -let tfbHost = "tfb-database" -let database = "hello_world" -let username = "benchmarkdbuser" -let password = "benchmarkdbpass" - -let client = try! MongoClient(uri: "mongodb://\(tfbHost)") -let db = client.getDatabase(name: database) -let World = db.getCollection(name: "world") -let Fortune = db.getCollection(name: "fortune") - -class LinearCongruntialGenerator { - - var state = 0 //seed of 0 by default - let a, c, m, shift: Int - - init() { - self.a = 214013 - self.c = 2531011 - self.m = Int(pow(2.0, 31.0)) //2^31 or 2147483648 - self.shift = 16 - } - - func random() -> Int { - state = (a * state + c) % m - return state >> shift - } -} - -let numGenerator = LinearCongruntialGenerator() - -func fetchFromWorld(id: String?) -> [String: Any] { - - var rand:Int = 0 - - if id == nil { - rand = numGenerator.random() % 10000 + 1 - } else { - rand = Int(id!)! - } - - if let world = World { - - var json = [String:Any]() - json["id"] = rand - - var fields = [String: Any]() - fields["id"] = 1 - fields["randomNumber"] = 1 - fields["_id"] = 0 - - var fieldString: String = "" - - do { - fieldString = try fields.jsonEncodedString() - } catch { - fieldString = String(describing: fields) - } - - do { - let jsonString = try json.jsonEncodedString() - do { - let results = try world.find(query: BSON( json: jsonString ), fields: BSON( json: fieldString )) - - if let res = results { - for item in res { - let itemString = String(describing: item) - return convertStringToDictionary(str: itemString) - } - } else { - print("results couldn't be unwrapped: ", rand) - } - } catch { - // - } - } catch { - // empty on purpose - } - } else { - // - } - - let emptyObj = [String: Any]() - return emptyObj -} - -func updateOneFromWorld() -> [String: Any] { - - let worldToUpdate = fetchFromWorld(id: nil) - var id = Int() - if worldToUpdate["id"] != nil { - id = worldToUpdate["id"] as! Int - } else { - id = 1 - print("Error trying to fetch a world to update") - } - let newRandom = numGenerator.random() % 10000 - var errorObj = [String: Any]() - - if let world = World { - - var json = [String: Any]() - json["id"] = id - - var fields = [String: Any]() - fields["id"] = 1 - fields["randomNumber"] = 1 - fields["_id"] = 0 - - var update = [String: Any]() - update["randomNumber"] = newRandom - - var fieldString: String = "" - - do { - fieldString = try fields.jsonEncodedString() - } catch { - fieldString = String(describing: fields) - } - - var updateString: String = "" - var jsonString: String = "" - - do { - updateString = try update.jsonEncodedString() - } catch { - updateString = String(describing: update) - } - - do { - jsonString = try json.jsonEncodedString() - } catch { - jsonString = String(describing: json) - } - - do { - let results = try world.findAndModify(query: BSON( json: jsonString ), sort: nil, update: BSON( json: updateString ), fields: BSON( json: fieldString ), remove: false, upsert: false, new: true) - let resultsStr = String(describing: results) - return convertUpdateStringToDictionary(str: resultsStr, id: id) - } catch { - errorObj["id"] = "Error running query findAndModify" - return errorObj - } - } else { - errorObj["id"] = "world is empty" - return errorObj - } -} - -func updatesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var updateArr: Array = [[String: Any]]() - - while 0 < totalQueries { - updateArr.append(updateOneFromWorld()) - totalQueries -= 1 - } - - do { - - response.appendBody(string: try updateArr.jsonEncodedString()) - } catch { - - response.appendBody(string: String(describing: updateArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func multipleDatabaseQueriesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var queryArr = [[String: Any]]() - - while 0 < totalQueries { - - queryArr.append(fetchFromWorld(id: nil)) - totalQueries -= 1 - } - - do { - response.appendBody(string: try queryArr.jsonEncodedString()) - } catch { - response.appendBody(string: String(describing: queryArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func singleDatabaseQueryHandler(request: HTTPRequest, response: HTTPResponse) { - - let res = fetchFromWorld(id: nil) - - do { - response.appendBody(string: try res.jsonEncodedString()) - } catch { - response.appendBody(string: String(describing: res)) - } - - setHeaders(response: response, contentType: "application/json") - response.completed() -} - -// Helpers - -func setHeaders(response: HTTPResponse, contentType: String) { - - response.setHeader(.contentType, value: contentType) - response.setHeader(.custom(name: "Server"), value: "Perfect") - - let currDate: String = getCurrDate() - - response.setHeader(.custom(name: "Date"), value: currDate) -} - -func getCurrDate() -> String { - - let now = getNow() - - do { - let formatted = try formatDate(now, format: "%a, %d %b %Y %H:%M:%S %Z", timezone: nil, locale: nil) - return formatted - } catch { - return "error formatting date string" - } -} - -func returnCorrectTuple(queryArr: [(String, String)]) -> String { - - for tup in queryArr { - if String(describing: tup.0) == "queries" { - return String(describing: tup.1) - } - } - - return "nil" -} - -func sanitizeQueryValue(queryString: String) -> Int { - - if let queryNum = Int(queryString) { - - if queryNum > 0 && queryNum < 500 { - return queryNum - } else if queryNum > 500 { - return 500 - } else { - return 1 - } - } else { - return 1 - } -} - -func spoofHTML(fortunesArr: [[String: Any]]) -> String { - - var htmlToRet = "Fortunes" - - for fortune in fortunesArr { - - htmlToRet += "" - } - - htmlToRet += "
idmessage
\(fortune["id"]!)\(fortune["message"]!)
"; - - return htmlToRet -} - -func convertStringToDictionary(str: String) -> [String: Any] { - - let strOfWordsArray = str.components(separatedBy: " ") - - var returnObj = [String: Any]() - - returnObj["id"] = Int(strOfWordsArray[3].dropLast()) - returnObj["randomNumber"] = Int(strOfWordsArray[6]) - - return returnObj -} - -func convertUpdateStringToDictionary(str: String, id: Int) -> [String: Any] { - - let strOfWordsArray = str.components(separatedBy: " ") - - var returnObj = [String: Any]() - returnObj["id"] = id - returnObj["randomNumber"] = Int(strOfWordsArray[16]) - - return returnObj -} - -var routes = Routes() -routes.add(method: .get, uri: "/updates", handler: updatesHandler) -routes.add(method: .get, uri: "/queries", handler: multipleDatabaseQueriesHandler) -routes.add(method: .get, uri: "/db", handler: singleDatabaseQueryHandler) -routes.add(method: .get, uri: "/**", - handler: StaticFileHandler(documentRoot: "./webroot", allowResponseFilters: true).handleRequest) -try HTTPServer.launch(name: "localhost", - port: 8080, - routes: routes, - responseFilters: [ - (PerfectHTTPServer.HTTPFilter.contentCompression(data: [:]), HTTPFilterPriority.high)]) diff --git a/frameworks/Swift/perfect/Sources/Perfect-MySQL/main.swift b/frameworks/Swift/perfect/Sources/Perfect-MySQL/main.swift deleted file mode 100644 index 0fc5d5cdc92..00000000000 --- a/frameworks/Swift/perfect/Sources/Perfect-MySQL/main.swift +++ /dev/null @@ -1,313 +0,0 @@ -import PerfectHTTP -import PerfectHTTPServer -import PerfectLib -import PerfectMySQL -import Foundation - -let tfbHost = "tfb-database" -let database = "hello_world" -let username = "benchmarkdbuser" -let password = "benchmarkdbpass" - -let mysql = MySQL() -let connected = mysql.connect(host: tfbHost, user: username, password: password) -let _ = mysql.selectDatabase(named: database) - -class LinearCongruntialGenerator { - - var state = 0 - let a, c, m, shift: Int - - init() { - self.a = 214013 - self.c = 2531011 - self.m = Int(pow(2.0, 31.0)) - self.shift = 16 - } - - func random() -> Int { - state = (a * state + c) % m - return state >> shift - } -} - -let numGenerator = LinearCongruntialGenerator() - -func fetchFromFortune() -> [[String: String]] { - - var arrOfFortunes = [[String: String]]() - let querySuccess = mysql.query(statement: "SELECT id, message FROM fortune") - - guard querySuccess else { - - let errorObject = ["id": "Failed to execute query"] - arrOfFortunes.append(errorObject) - - return arrOfFortunes - } - - let results = mysql.storeResults()! - - results.forEachRow { row in - if let id = row[0], let message = row[1] { - - let resObj = ["id": String(describing: id), "message": message] - arrOfFortunes.append(resObj) - } else { - print("not correct values returned: ", row) - } - } - - return arrOfFortunes -} - -func fetchFromWorld(id: String?) -> [String:Any] { - - var returnObj = [String: Any]() - var errorObject = [String: Any]() - var rand:Int = 0 - - if id == nil { - rand = numGenerator.random() % 10000 + 1 - } else { - rand = Int(id!)! - } - - let querySuccess = mysql.query(statement: "SELECT id, randomNumber FROM World WHERE id = \(rand)") - - guard querySuccess else { - - errorObject["id"] = "Failed to execute query" - - return errorObject - } - - let results = mysql.storeResults()! - - results.forEachRow { row in - - if let id = row[0], let randomNumber = row[1] { - - returnObj["id"] = id - returnObj["randomNumber"] = randomNumber - } else { - - returnObj["id"] = "No return value" - returnObj["randomNumber"] = "what happened?" - } - } - - return returnObj -} - -func updateOneFromWorld() -> [String: Any] { - - var returnObj = [String: Any]() - var errorObject = [String: Any]() - let worldToUpdate = fetchFromWorld(id: nil) - let id: String = worldToUpdate["id"] as! String - let newRandom = numGenerator.random() % 10000 - - let querySuccess = mysql.query(statement: "UPDATE World SET randomNumber = \(newRandom) WHERE id = \(id)") - - guard querySuccess else { - errorObject["id"] = "Failed to execute query" - return errorObject - } - - if let results = mysql.storeResults() { - - results.forEachRow { row in - if let id = row[0], let randomNumber = row[1] { - returnObj["id"] = id - returnObj["randomNumber"] = randomNumber - } else { - returnObj["id"] = "No return value" - returnObj["randomNumber"] = "what happened?" - } - } - return returnObj - } else { - returnObj["id"] = id - returnObj["randomNumber"] = newRandom - return returnObj - } -} - -func fortunesHandler(request: HTTPRequest, response: HTTPResponse) { - - var arrOfFortunes = fetchFromFortune() - - let newObj: [String: String] = ["id": "0", "message": "Additional fortune added at request time."] - - arrOfFortunes.append(newObj) - - let sortedArr = arrOfFortunes.sorted(by: ({ $0["message"]! < $1["message"]! })) - - let htmlToRet = spoofHTML(fortunesArr: sortedArr) - - response.appendBody(string: htmlToRet) - - setHeaders(response: response, contentType: "text/html") - response.setHeader(.custom(name: "CustomLength"), value: String(describing: htmlToRet.count + 32)) - - response.completed() -} - -func updatesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var updateArr: Array = [[String: Any]]() - - while 0 < totalQueries { - updateArr.append(updateOneFromWorld()) - totalQueries -= 1 - } - - do { - - response.appendBody(string: try updateArr.jsonEncodedString()) - } catch { - - response.appendBody(string: String(describing: updateArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func multipleDatabaseQueriesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var queryArr: Array = [[String: Any]]() - - while 0 < totalQueries { - - queryArr.append(fetchFromWorld(id: nil)) - totalQueries -= 1 - } - - do { - - response.appendBody(string: try queryArr.jsonEncodedString()) - } catch { - - response.appendBody(string: String(describing: queryArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func singleDatabaseQueryHandler(request: HTTPRequest, response: HTTPResponse) { - - let res = fetchFromWorld(id: nil) - - let errorPayload: [String: Any] = [ - "error": "Could not set body!" - ] - - var responseString: String = "" - var errorString: String = "" - do { - errorString = try errorPayload.jsonEncodedString() - } catch { - // Nothing to do here - we already have an empty value - } - - do { - responseString = try res.jsonEncodedString() - response.appendBody(string: responseString) - } catch { - response.status = HTTPResponseStatus.internalServerError - response.appendBody(string: errorString) - } - - - setHeaders(response: response, contentType: "application/json") - response.completed() -} - -// Helpers - -func setHeaders(response: HTTPResponse, contentType: String) { - - response.setHeader(.contentType, value: contentType) - response.setHeader(.custom(name: "Server"), value: "Perfect") - - let currDate: String = getCurrDate() - - response.setHeader(.custom(name: "Date"), value: currDate) -} - -func getCurrDate() -> String { - - let now = getNow() - - do { - let formatted = try formatDate(now, format: "%a, %d %b %Y %H:%M:%S %Z", timezone: nil, locale: nil) - return formatted - } catch { - return "error formatting date string" - } -} - -func returnCorrectTuple(queryArr: [(String, String)]) -> String { - - for tup in queryArr { - if String(describing: tup.0) == "queries" { - return String(describing: tup.1) - } - } - - return "nil" -} - -func sanitizeQueryValue(queryString: String) -> Int { - - if let queryNum = Int(queryString) { - - if queryNum > 0 && queryNum < 500 { - return queryNum - } else if queryNum > 500 { - return 500 - } else { - return 1 - } - } else { - return 1 - } -} - -func spoofHTML(fortunesArr: [[String: Any]]) -> String { - - var htmlToRet = "Fortunes" - - for fortune in fortunesArr { - - htmlToRet += "" - } - - htmlToRet += "
idmessage
\(fortune["id"]!)\(fortune["message"]!)
"; - - return htmlToRet -} - -var routes = Routes() -routes.add(method: .get, uri: "/fortunes", handler: fortunesHandler) -routes.add(method: .get, uri: "/updates", handler: updatesHandler) -routes.add(method: .get, uri: "/queries", handler: multipleDatabaseQueriesHandler) -routes.add(method: .get, uri: "/db", handler: singleDatabaseQueryHandler) -routes.add(method: .get, uri: "/**", - handler: StaticFileHandler(documentRoot: "./webroot", allowResponseFilters: true).handleRequest) -try HTTPServer.launch(name: "localhost", - port: 8080, - routes: routes, - responseFilters: [ - (PerfectHTTPServer.HTTPFilter.contentCompression(data: [:]), HTTPFilterPriority.high)]) diff --git a/frameworks/Swift/perfect/Sources/Perfect-PostgreSQL/main.swift b/frameworks/Swift/perfect/Sources/Perfect-PostgreSQL/main.swift deleted file mode 100644 index bbb10b19b26..00000000000 --- a/frameworks/Swift/perfect/Sources/Perfect-PostgreSQL/main.swift +++ /dev/null @@ -1,224 +0,0 @@ -import PerfectHTTP -import PerfectHTTPServer -import PerfectLib -import PerfectPostgreSQL -import Foundation - -let tfbHost = "tfb-database" -let database = "hello_world" -let username = "benchmarkdbuser" -let password = "benchmarkdbpass" - -let p = PGConnection() -let status = p.connectdb("postgresql://\(username):\(password)@\(tfbHost):5432/\(database)") - -class LinearCongruntialGenerator { - - var state = 0 //seed of 0 by default - let a, c, m, shift: Int - - init() { - self.a = 214013 - self.c = 2531011 - self.m = Int(pow(2.0, 31.0)) //2^31 or 2147483648 - self.shift = 16 - } - - func random() -> Int { - state = (a * state + c) % m - return state >> shift - } -} - -let numGenerator = LinearCongruntialGenerator() - -func fetchFromWorld(id: String?) -> [String:Any] { - - var returnObj = [String: Any]() - var rand:Int = 0 - - if id == nil { - rand = numGenerator.random() % 10000 - } else { - rand = Int(id!)! - } - - let results = p.exec(statement: "select id, randomNumber from world where id = \(rand)") - - returnObj["id"] = results.getFieldString(tupleIndex: 0, fieldIndex: 0)! - returnObj["randomNumber"] = results.getFieldString(tupleIndex: 0, fieldIndex: 1)! - - return returnObj -} - -func updateOneFromWorld() -> [String: Any] { - - var returnObj = [String: Any]() - let worldToUpdate = fetchFromWorld(id: nil) - let rand = numGenerator.random() % 10000 + 1 - let id: String = worldToUpdate["id"] as! String - - let _ = p.exec(statement: "UPDATE world SET randomNumber = \(rand) WHERE id = \(id)") - - returnObj["id"] = id - returnObj["randomNumber"] = rand - - return returnObj -} - -func updatesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var updateArr: Array = [[String: Any]]() - - while 0 < totalQueries { - updateArr.append(updateOneFromWorld()) - totalQueries -= 1 - } - - do { - - response.appendBody(string: try updateArr.jsonEncodedString()) - } catch { - - response.appendBody(string: String(describing: updateArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func multipleDatabaseQueriesHandler(request: HTTPRequest, response: HTTPResponse) { - - let queryStr = returnCorrectTuple(queryArr: request.queryParams) - var totalQueries = sanitizeQueryValue(queryString: queryStr) - - var queryArr: Array = [[String: Any]]() - - while 0 < totalQueries { - - queryArr.append(fetchFromWorld(id: nil)) - totalQueries -= 1 - } - - do { - - response.appendBody(string: try queryArr.jsonEncodedString()) - } catch { - - response.appendBody(string: String(describing: queryArr)) - } - - setHeaders(response: response, contentType: "application/json") - - response.completed() -} - -func singleDatabaseQueryHandler(request: HTTPRequest, response: HTTPResponse) { - - let res = fetchFromWorld(id: nil) - - let errorPayload: [String: Any] = [ - "error": "Could not set body!" - ] - - var responseString: String = "" - var errorString: String = "" - do { - errorString = try errorPayload.jsonEncodedString() - } catch { - // Nothing to do here - we already have an empty value - } - - do { - responseString = try res.jsonEncodedString() - response.appendBody(string: responseString) - } catch { - response.status = HTTPResponseStatus.internalServerError - response.appendBody(string: errorString) - } - - - setHeaders(response: response, contentType: "application/json") - response.completed() -} - -// Helpers - -func setHeaders(response: HTTPResponse, contentType: String) { - - response.setHeader(.contentType, value: contentType) - response.setHeader(.custom(name: "Server"), value: "Perfect") - - let currDate: String = getCurrDate() - - response.setHeader(.custom(name: "Date"), value: currDate) -} - -func getCurrDate() -> String { - - let now = getNow() - - do { - let formatted = try formatDate(now, format: "%a, %d %b %Y %H:%M:%S %Z", timezone: nil, locale: nil) - return formatted - } catch { - return "error formatting date string" - } -} - -func returnCorrectTuple(queryArr: [(String, String)]) -> String { - - for tup in queryArr { - if String(describing: tup.0) == "queries" { - return String(describing: tup.1) - } - } - - return "nil" -} - -func sanitizeQueryValue(queryString: String) -> Int { - - if let queryNum = Int(queryString) { - - if queryNum > 0 && queryNum < 500 { - return queryNum - } else if queryNum > 500 { - return 500 - } else { - return 1 - } - } else { - return 1 - } -} - -func spoofHTML(fortunesArr: [[String: Any]]) -> String { - - var htmlToRet = "Fortunes" - - for fortune in fortunesArr { - - htmlToRet += "" - } - - htmlToRet += "
idmessage
\(fortune["id"]!)\(fortune["message"]!)
"; - - return htmlToRet -} - -var routes = Routes() -routes.add(method: .get, uri: "/updates", handler: updatesHandler) -routes.add(method: .get, uri: "/queries", handler: multipleDatabaseQueriesHandler) -routes.add(method: .get, uri: "/db", handler: singleDatabaseQueryHandler) -routes.add(method: .get, uri: "/**", - handler: StaticFileHandler(documentRoot: "./webroot", allowResponseFilters: true).handleRequest) -try HTTPServer.launch(name: "localhost", - port: 8080, - routes: routes, - responseFilters: [ - (PerfectHTTPServer.HTTPFilter.contentCompression(data: [:]), HTTPFilterPriority.high)]) diff --git a/frameworks/Swift/perfect/Sources/Perfect/main.swift b/frameworks/Swift/perfect/Sources/Perfect/main.swift deleted file mode 100644 index 2df4bb928e5..00000000000 --- a/frameworks/Swift/perfect/Sources/Perfect/main.swift +++ /dev/null @@ -1,78 +0,0 @@ -import PerfectHTTP -import PerfectHTTPServer -import PerfectLib -import Foundation - -func plaintextHandler(request: HTTPRequest, response: HTTPResponse) { - - response.appendBody(string: "Hello, World!") - - setHeaders(response: response, contentType: "text/plain") - - response.completed() -} - -func jsonHandler(request: HTTPRequest, response: HTTPResponse) { - - var helloDictionary: [String: String] = [:] - helloDictionary["message"] = "Hello, World!" - - let errorPayload: [String: Any] = [ - "error": "Could not set body!" - ] - - var responseString: String = "" - var errorString: String = "" - do { - errorString = try errorPayload.jsonEncodedString() - } catch { - // Nothing to do here - we already have an empty value - } - - do { - responseString = try helloDictionary.jsonEncodedString() - response.appendBody(string: responseString) - } catch { - response.status = HTTPResponseStatus.internalServerError - response.appendBody(string: errorString) - } - - - setHeaders(response: response, contentType: "application/json") - response.completed() -} - -// Helpers - -func setHeaders(response: HTTPResponse, contentType: String) { - - response.setHeader(.contentType, value: contentType) - response.setHeader(.custom(name: "Server"), value: "Perfect") - - let currDate: String = getCurrDate() - - response.setHeader(.custom(name: "Date"), value: currDate) -} - -func getCurrDate() -> String { - - let now = getNow() - - do { - let formatted = try formatDate(now, format: "%a, %d %b %Y %H:%M:%S %Z", timezone: nil, locale: nil) - return formatted - } catch { - return "error formatting date string" - } -} - -var routes = Routes() -routes.add(method: .get, uri: "/json", handler: jsonHandler) -routes.add(method: .get, uri: "/plaintext", handler: plaintextHandler) -routes.add(method: .get, uri: "/**", - handler: StaticFileHandler(documentRoot: "./webroot", allowResponseFilters: true).handleRequest) -try HTTPServer.launch(name: "localhost", - port: 8080, - routes: routes, - responseFilters: [ - (PerfectHTTPServer.HTTPFilter.contentCompression(data: [:]), HTTPFilterPriority.high)]) diff --git a/frameworks/Swift/perfect/benchmark_config.json b/frameworks/Swift/perfect/benchmark_config.json deleted file mode 100644 index 28fdd30639e..00000000000 --- a/frameworks/Swift/perfect/benchmark_config.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "framework": "perfect", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "None", - "framework": "Perfect", - "language": "Swift", - "orm": "Raw", - "platform": "Perfect", - "webserver": "Perfect", - "os": "Linux", - "database_os": "Linux", - "display_name": "Perfect", - "notes": "", - "tags": ["broken"] - }, - "mysql": { - "update_url": "/updates?queries=", - "query_url": "/queries?queries=", - "db_url": "/db", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "MySQL", - "framework": "Perfect", - "language": "Swift", - "orm": "Raw", - "platform": "Perfect", - "webserver": "Perfect", - "os": "Linux", - "database_os": "Linux", - "display_name": "Perfect", - "notes": "", - "tags": ["broken"] - }, - "postgresql": { - "update_url": "/updates?queries=", - "query_url": "/queries?queries=", - "db_url": "/db", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "Postgres", - "framework": "Perfect", - "language": "Swift", - "orm": "Raw", - "platform": "Perfect", - "webserver": "Perfect", - "os": "Linux", - "database_os": "Linux", - "display_name": "Perfect", - "notes": "", - "tags": ["broken"] - }, - "mongodb": { - "update_url": "/updates?queries=", - "query_url": "/queries?queries=", - "db_url": "/db", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "MongoDB", - "framework": "Perfect", - "language": "Swift", - "orm": "Raw", - "platform": "Perfect", - "webserver": "Perfect", - "os": "Linux", - "database_os": "Linux", - "display_name": "Perfect", - "notes": "", - "tags": ["broken"] - } - }] -} diff --git a/frameworks/Swift/perfect/config.toml b/frameworks/Swift/perfect/config.toml deleted file mode 100644 index ca5f8416743..00000000000 --- a/frameworks/Swift/perfect/config.toml +++ /dev/null @@ -1,57 +0,0 @@ -[framework] -name = "perfect" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -approach = "Realistic" -classification = "Micro" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "Perfect" -webserver = "Perfect" -versus = "None" - -[mongodb] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -approach = "Realistic" -classification = "Micro" -database = "MongoDB" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "Perfect" -webserver = "Perfect" -versus = "None" - -[postgresql] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -approach = "Realistic" -classification = "Micro" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "Perfect" -webserver = "Perfect" -versus = "None" - -[mysql] -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -approach = "Realistic" -classification = "Micro" -database = "MySQL" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "Perfect" -webserver = "Perfect" -versus = "None" diff --git a/frameworks/Swift/perfect/perfect-mongodb.dockerfile b/frameworks/Swift/perfect/perfect-mongodb.dockerfile deleted file mode 100644 index c56325691a6..00000000000 --- a/frameworks/Swift/perfect/perfect-mongodb.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD . /perfect -WORKDIR /perfect -RUN apt-get update -yqq && apt-get install -yqq libpq-dev && apt-get install -y xsltproc docbook-xsl uuid-dev clang pkg-config libicu-dev libpython2.7 libxml2-dev wget git libssl-dev uuid-dev libsqlite3-dev libpq-dev libmysqlclient-dev libbson-dev libmongoc-dev libcurl4-openssl-dev && apt-get -y install libmysqlclient-dev libmongoc-1.0-0 libbson-1.0 -RUN swift build - -EXPOSE 8080 - -CMD .build/debug/Perfect-MongoDB diff --git a/frameworks/Swift/perfect/perfect-mysql.dockerfile b/frameworks/Swift/perfect/perfect-mysql.dockerfile deleted file mode 100644 index dfc23b3745b..00000000000 --- a/frameworks/Swift/perfect/perfect-mysql.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD . /perfect -WORKDIR /perfect -RUN apt-get update -yqq && apt-get install -yqq libpq-dev && apt-get install -y xsltproc docbook-xsl uuid-dev clang pkg-config libicu-dev libpython2.7 libxml2-dev wget git libssl-dev uuid-dev libsqlite3-dev libpq-dev libmysqlclient-dev libbson-dev libmongoc-dev libcurl4-openssl-dev && apt-get -y install libmysqlclient-dev libmongoc-1.0-0 libbson-1.0 -RUN swift build - -EXPOSE 8080 - -CMD .build/debug/Perfect-MySQL diff --git a/frameworks/Swift/perfect/perfect-postgresql.dockerfile b/frameworks/Swift/perfect/perfect-postgresql.dockerfile deleted file mode 100644 index 11c863eac8a..00000000000 --- a/frameworks/Swift/perfect/perfect-postgresql.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD . /perfect -WORKDIR /perfect -RUN apt-get update -yqq && apt-get install -yqq libpq-dev && apt-get install -y xsltproc docbook-xsl uuid-dev clang pkg-config libicu-dev libpython2.7 libxml2-dev wget git libssl-dev uuid-dev libsqlite3-dev libpq-dev libmysqlclient-dev libbson-dev libmongoc-dev libcurl4-openssl-dev && apt-get -y install libmysqlclient-dev libmongoc-1.0-0 libbson-1.0 -RUN swift build - -EXPOSE 8080 - -CMD .build/debug/Perfect-PostgreSQL diff --git a/frameworks/Swift/perfect/perfect.dockerfile b/frameworks/Swift/perfect/perfect.dockerfile deleted file mode 100644 index f597873a513..00000000000 --- a/frameworks/Swift/perfect/perfect.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM swift:4.1 - -ADD . /perfect -WORKDIR /perfect -RUN apt-get update -yqq && apt-get install -yqq libpq-dev && apt-get install -y xsltproc docbook-xsl uuid-dev clang pkg-config libicu-dev libpython2.7 libxml2-dev wget git libssl-dev uuid-dev libsqlite3-dev libpq-dev libmysqlclient-dev libbson-dev libmongoc-dev libcurl4-openssl-dev && apt-get -y install libmysqlclient-dev libmongoc-1.0-0 libbson-1.0 -RUN swift build - -EXPOSE 8080 - -CMD .build/debug/Perfect diff --git a/frameworks/Swift/swift-nio/config.toml b/frameworks/Swift/swift-nio/config.toml deleted file mode 100644 index 495bb4f6d2f..00000000000 --- a/frameworks/Swift/swift-nio/config.toml +++ /dev/null @@ -1,15 +0,0 @@ -[framework] -name = "swift-nio" - -[main] -urls.plaintext = "/p" -urls.json = "/j" -approach = "Realistic" -classification = "Platform" -database = "None" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "None" -versus = "" diff --git a/frameworks/Swift/swift-nio/swift-nio.dockerfile b/frameworks/Swift/swift-nio/swift-nio.dockerfile index 5b54a7a210f..54a2050f09e 100644 --- a/frameworks/Swift/swift-nio/swift-nio.dockerfile +++ b/frameworks/Swift/swift-nio/swift-nio.dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container @@ -15,7 +15,7 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Install Swift dependencies diff --git a/frameworks/Swift/vapor/.gitignore b/frameworks/Swift/vapor/.gitignore deleted file mode 100644 index 1d982c0de86..00000000000 --- a/frameworks/Swift/vapor/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.build/ -/*.xcodeproj -xcuserdata/ -.swiftpm/ -DerivedData/ -Package.resolved diff --git a/frameworks/Swift/vapor/benchmark_config.json b/frameworks/Swift/vapor/benchmark_config.json index 65ea06b8726..1bd0d8e2242 100755 --- a/frameworks/Swift/vapor/benchmark_config.json +++ b/frameworks/Swift/vapor/benchmark_config.json @@ -16,7 +16,7 @@ "database_os": "Linux", "display_name": "Vapor", "notes": "", - "versus": "None" + "versus": "swift-nio" }, "fluent": { "db_url": "/db", diff --git a/frameworks/Swift/vapor/vapor-fluent.dockerfile b/frameworks/Swift/vapor/vapor-fluent.dockerfile index 5b883e65713..4a9d3782f6a 100644 --- a/frameworks/Swift/vapor/vapor-fluent.dockerfile +++ b/frameworks/Swift/vapor/vapor-fluent.dockerfile @@ -1,7 +1,7 @@ # ================================ # Build image # ================================ -FROM swift:5.9 as build +FROM swift:5.10 as build WORKDIR /build # Copy entire repo into container @@ -15,7 +15,7 @@ RUN swift build \ # ================================ # Run image # ================================ -FROM swift:5.9-slim +FROM swift:5.10-slim WORKDIR /run # Copy build artifacts diff --git a/frameworks/Swift/vapor/vapor-mongo-fluent/Package.swift b/frameworks/Swift/vapor/vapor-mongo-fluent/Package.swift deleted file mode 100644 index 88ae0f29ed9..00000000000 --- a/frameworks/Swift/vapor/vapor-mongo-fluent/Package.swift +++ /dev/null @@ -1,29 +0,0 @@ -// swift-tools-version:5.5 -import PackageDescription - -let package = Package( - name: "vapor-fluent", - platforms: [ - .macOS(.v12) - ], - products: [ - .executable(name: "app", targets: ["App"]) - ], - dependencies: [ - .package(url: "https://github.com/vapor/vapor.git", from: "4.52.2"), - .package(url: "https://github.com/vapor/fluent.git", from: "4.4.0"), - .package(url: "https://github.com/vapor/fluent-mongo-driver.git", from: "1.0.2"), - .package(url: "https://github.com/orlandos-nl/MongoKitten.git", from: "6.7.1") - ], - targets: [ - .executableTarget( - name: "App", - dependencies: [ - .product(name: "Fluent", package: "fluent"), - .product(name: "FluentMongoDriver", package: "fluent-mongo-driver"), - .product(name: "Vapor", package: "vapor"), - .product(name: "MongoKitten", package: "MongoKitten"), - ], - path: "Sources"), - ] -) \ No newline at end of file diff --git a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/Utilities.swift b/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/Utilities.swift deleted file mode 100644 index 7b5bb1c2878..00000000000 --- a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/Utilities.swift +++ /dev/null @@ -1,25 +0,0 @@ -import Vapor - -extension Int { - func bounded(to range: ClosedRange) -> Int { - switch self { - case ...range.lowerBound: - return range.lowerBound - case range.upperBound...: - return range.upperBound - default: - return self - } - } -} - -extension System { - // tfb-server (aka, citrine) uses 28 hyper-threaded cores - // postgresql.conf specifies max_connections = 2000 - // - // 2000 / (28 * 2) = 35.7 (theoretical max) - // - // https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Environment#citrine-self-hosted - // https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/databases/postgres/postgresql.conf#L64 - static var maxConnectionsPerEventLoop: Int { 32 } -} diff --git a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/World.swift b/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/World.swift deleted file mode 100644 index ef7f1314013..00000000000 --- a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/World.swift +++ /dev/null @@ -1,14 +0,0 @@ -import Fluent -import Vapor - -final class World: Model, Content { - static let schema = "world" - - @ID(custom: "id") - var id: Float? - - @Field(key: "randomNumber") - var randomNumber: Float - - init() { } -} diff --git a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/main.swift b/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/main.swift deleted file mode 100644 index a7beb273bce..00000000000 --- a/frameworks/Swift/vapor/vapor-mongo-fluent/Sources/main.swift +++ /dev/null @@ -1,52 +0,0 @@ -import Fluent -import FluentMongoDriver -import Vapor - -var env = try Environment.detect() -try LoggingSystem.bootstrap(from: &env) - -let connectionString = "mongodb://tfb-database:27017/hello_world" - -let app = Application(env) - -app.http.server.configuration.serverName = "Vapor" - -app.logger.notice("💧 VAPOR") -app.logger.notice("System.coreCount: \(System.coreCount)") -app.logger.notice("System.maxConnectionsPerEventLoop: \(System.maxConnectionsPerEventLoop)") - -try app.databases.use(.mongo( - connectionString: connectionString), - as: .mongo) - -app.get("db") { req async throws -> World in - guard let world = try await World.find(Float(.random(in: 1...10_000)), on: req.db) else { - throw Abort(.notFound) - } - - return world -} - -app.get("queries") { req async throws -> [World] in - let queries = (req.query["queries"] ?? 1).bounded(to: 1...500) - - var worlds: [World] = [] - - for _ in queries { - guard let world = try await World.find(Float(.random(in: 1...10_000)), on: req.db) else { - throw Abort(.notFound) - } - - worlds.append(world) - } - - return worlds -} - -extension Int: Sequence { - public func makeIterator() -> CountableRange.Iterator { - return (0.. Promise | Response; - -const handlers: Record = { - "/json": () => Response.json({ message: "Hello, World!" }, options), - "/plaintext": () => new Response("Hello, World!", options), -}; +const HELLO_WORLD_STR = "Hello, World!"; +const options: ResponseInit = { headers: { "Server": "Deno" } }; Deno.serve({ + reusePort: true, handler: (req: Request) => { const path = req.url.slice(req.url.indexOf("/", 8)); - const fn = handlers[path]; - return fn - ? fn(req) - : new Response("404 Not Found", { status: 404, ...options }); + if (path == "/plaintext") { + return new Response(HELLO_WORLD_STR, options); + } else if (path == "/json") { + return Response.json({ message: HELLO_WORLD_STR }, options); + } else { + return new Response("404 Not Found", { status: 404, ...options }); + } }, onError(err) { console.error(err); diff --git a/frameworks/TypeScript/deno/src/spawn.ts b/frameworks/TypeScript/deno/src/spawn.ts new file mode 100644 index 00000000000..cc56c4543b6 --- /dev/null +++ b/frameworks/TypeScript/deno/src/spawn.ts @@ -0,0 +1,13 @@ +import os from "node:os"; +import process from "node:process"; + +const numCPUs = os.cpus().length; +for (let i = 0; i < numCPUs; i++) { + new Deno.Command(Deno.execPath(), { + args: ["run", "-A", "--unstable-net", "main.ts"], + stdin: "inherit", + stdout: "inherit", + stderr: "inherit", + env: { ...process.env }, + }).spawn(); +} diff --git a/frameworks/TypeScript/nest/benchmark_config.json b/frameworks/TypeScript/nest/benchmark_config.json index bf98c12c49e..bb13940c076 100644 --- a/frameworks/TypeScript/nest/benchmark_config.json +++ b/frameworks/TypeScript/nest/benchmark_config.json @@ -20,6 +20,7 @@ "database": "Postgres", "database_os": "Linux", "display_name": "nestjs", + "platform": "nodejs", "versus": "nodejs" }, "mysql": { @@ -38,6 +39,7 @@ "database": "MySQL", "database_os": "Linux", "display_name": "nestjs mysql", + "platform": "nodejs", "versus": "nodejs" }, "mongo": { @@ -56,6 +58,7 @@ "database": "MongoDB", "database_os": "Linux", "display_name": "nestjs", + "platform": "nodejs", "versus": "nodejs" }, "fastify": { @@ -76,6 +79,7 @@ "os": "Linux", "database_os": "Linux", "display_name": "nestjs fastify", + "platform": "nodejs", "versus": "nodejs" }, "fastify-mysql": { @@ -94,6 +98,7 @@ "os": "Linux", "database_os": "Linux", "display_name": "nestjs fastify mysql", + "platform": "nodejs", "versus": "nodejs" }, "fastify-mongo": { @@ -112,6 +117,7 @@ "os": "Linux", "database_os": "Linux", "display_name": "nestjs fastify mongo", + "platform": "nodejs", "versus": "nodejs" } } diff --git a/frameworks/TypeScript/nest/nestjs-fastify-mongo.dockerfile b/frameworks/TypeScript/nest/nestjs-fastify-mongo.dockerfile index 687e3662d7d..c7d40f6c6ab 100644 --- a/frameworks/TypeScript/nest/nestjs-fastify-mongo.dockerfile +++ b/frameworks/TypeScript/nest/nestjs-fastify-mongo.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE mongodb ENV FRAMEWORK fastify EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/nestjs-fastify-mysql.dockerfile b/frameworks/TypeScript/nest/nestjs-fastify-mysql.dockerfile index 55f3872b71d..d5e7f4a0165 100644 --- a/frameworks/TypeScript/nest/nestjs-fastify-mysql.dockerfile +++ b/frameworks/TypeScript/nest/nestjs-fastify-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE mysql ENV FRAMEWORK fastify EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/nestjs-fastify.dockerfile b/frameworks/TypeScript/nest/nestjs-fastify.dockerfile index 6eb139b3d2c..1b3dc806754 100644 --- a/frameworks/TypeScript/nest/nestjs-fastify.dockerfile +++ b/frameworks/TypeScript/nest/nestjs-fastify.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE postgres ENV FRAMEWORK fastify EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/nestjs-mongo.dockerfile b/frameworks/TypeScript/nest/nestjs-mongo.dockerfile index 7b2e842f411..09fab943ed3 100644 --- a/frameworks/TypeScript/nest/nestjs-mongo.dockerfile +++ b/frameworks/TypeScript/nest/nestjs-mongo.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE mongodb ENV FRAMEWORK express EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/nestjs-mysql.dockerfile b/frameworks/TypeScript/nest/nestjs-mysql.dockerfile index 42865fe49c9..80147df547d 100644 --- a/frameworks/TypeScript/nest/nestjs-mysql.dockerfile +++ b/frameworks/TypeScript/nest/nestjs-mysql.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE mysql ENV FRAMEWORK express EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/nestjs.dockerfile b/frameworks/TypeScript/nest/nestjs.dockerfile index 8c97367cc10..d2382bf8999 100644 --- a/frameworks/TypeScript/nest/nestjs.dockerfile +++ b/frameworks/TypeScript/nest/nestjs.dockerfile @@ -1,4 +1,4 @@ -FROM node:18.12.1-slim +FROM node:20.12.2-slim COPY ./ ./ @@ -10,4 +10,4 @@ ENV DATABASE_CONFIGURATION_PROFILE postgres ENV FRAMEWORK express EXPOSE 8080 -CMD ["node", "dist/main"] \ No newline at end of file +CMD ["node", "dist/main"] diff --git a/frameworks/TypeScript/nest/package.json b/frameworks/TypeScript/nest/package.json index 09416024d1b..fe27e6fc40b 100644 --- a/frameworks/TypeScript/nest/package.json +++ b/frameworks/TypeScript/nest/package.json @@ -26,13 +26,13 @@ "handlebars": "4.7.3", "hbs": "4.1.0", "mongodb": "3.5.4", - "mysql2": "2.1.0", + "mysql2": "3.9.8", "pg": "8.5.1", "point-of-view": "3.7.2", "reflect-metadata": "0.1.13", "rimraf": "3.0.2", "rxjs": "6.5.4", - "typeorm": "0.3.0" + "typeorm": "0.2.29" }, "devDependencies": { "@nestjs/cli": "7.5.3", diff --git a/frameworks/Ur/urweb/bench.ur b/frameworks/Ur/urweb/bench.ur index d181a79c81c..fed47ba1132 100644 --- a/frameworks/Ur/urweb/bench.ur +++ b/frameworks/Ur/urweb/bench.ur @@ -133,3 +133,9 @@ fun updates s = fun plaintext () = returnText "Hello, World!" + +(** * Test type 7: Cached queries *) + +val cached_queries = queries +(* It's really the same code as the uncached queries test! + * We just compile with a different flag to enable caching. *) diff --git a/frameworks/Ur/urweb/bench.urs b/frameworks/Ur/urweb/bench.urs index 83b12c39ae2..a363ac346c3 100644 --- a/frameworks/Ur/urweb/bench.urs +++ b/frameworks/Ur/urweb/bench.urs @@ -4,3 +4,4 @@ val queries : string -> transaction page val fortunes : unit -> transaction page val updates : string -> transaction page val plaintext : unit -> transaction page +val cached_queries : string -> transaction page diff --git a/frameworks/Ur/urweb/benchmark_config.json b/frameworks/Ur/urweb/benchmark_config.json index 389b8517ce2..23aca3bb682 100644 --- a/frameworks/Ur/urweb/benchmark_config.json +++ b/frameworks/Ur/urweb/benchmark_config.json @@ -1,5 +1,6 @@ { "framework": "urweb", + "maintainers": ["achlipala"], "tests": [{ "default": { "display_name": "urweb", @@ -42,7 +43,7 @@ }, "cache": { "setup_file": "setup-postgresql", - "cached_query_url": "/queries/", + "cached_query_url": "/cached_queries/", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -53,12 +54,11 @@ "platform": "Ur/Web", "webserver": "None", "os": "Linux", - "database_os": "Linux", - "tags": ["broken"] + "database_os": "Linux" }, "mysql-cache": { "setup_file": "setup-mysql", - "cached_query_url": "/queries/", + "cached_query_url": "/cached_queries/", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -69,8 +69,7 @@ "platform": "Ur/Web", "webserver": "None", "os": "Linux", - "database_os": "Linux", - "tags": ["broken"] + "database_os": "Linux" } }] } diff --git a/frameworks/Ur/urweb/config.toml b/frameworks/Ur/urweb/config.toml index cf30140d712..26827637aa3 100644 --- a/frameworks/Ur/urweb/config.toml +++ b/frameworks/Ur/urweb/config.toml @@ -19,7 +19,7 @@ webserver = "None" versus = "None" [mysql-cache] -urls.cached_query = "/queries/" +urls.cached_query = "/cached_queries/" approach = "Realistic" classification = "Fullstack" database = "MySQL" @@ -31,7 +31,7 @@ webserver = "None" versus = "None" [cache] -urls.cached_query = "/queries/" +urls.cached_query = "/cached_queries/" approach = "Realistic" classification = "Fullstack" database = "Postgres" diff --git a/frameworks/Ur/urweb/urweb-cache.dockerfile b/frameworks/Ur/urweb/urweb-cache.dockerfile index 762f7cb1c36..69bfbafd60e 100644 --- a/frameworks/Ur/urweb/urweb-cache.dockerfile +++ b/frameworks/Ur/urweb/urweb-cache.dockerfile @@ -1,9 +1,9 @@ -FROM ubuntu:18.04 +FROM ubuntu:23.10 ADD ./ /urweb WORKDIR /urweb -RUN apt-get update -yqq && apt-get install -yqq urweb +RUN apt-get update -yqq && apt-get install -yqq sudo git gcc make autoconf automake libtool mlton libpq-dev libssl-dev uthash-dev libicu-dev && git clone https://github.com/urweb/urweb.git && cd urweb && ./autogen.sh && ./configure && make -j && sudo make install RUN urweb -sqlcache -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=tfb-database" bench diff --git a/frameworks/Ur/urweb/urweb-mysql-cache.dockerfile b/frameworks/Ur/urweb/urweb-mysql-cache.dockerfile index 5655af62e58..4bec91de9d8 100644 --- a/frameworks/Ur/urweb/urweb-mysql-cache.dockerfile +++ b/frameworks/Ur/urweb/urweb-mysql-cache.dockerfile @@ -1,9 +1,9 @@ -FROM ubuntu:18.04 +FROM ubuntu:23.10 ADD ./ /urweb WORKDIR /urweb -RUN apt-get update -yqq && apt-get install -yqq urweb +RUN apt-get update -yqq && apt-get install -yqq sudo git gcc make autoconf automake libtool mlton libmysqlclient-dev libssl-dev uthash-dev libicu-dev && git clone https://github.com/urweb/urweb.git && cd urweb && ./autogen.sh && ./configure && make -j && sudo make install RUN urweb -sqlcache -dbms mysql -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=tfb-database" bench diff --git a/frameworks/Ur/urweb/urweb-mysql.dockerfile b/frameworks/Ur/urweb/urweb-mysql.dockerfile index cfa770970c0..bee66b290b0 100644 --- a/frameworks/Ur/urweb/urweb-mysql.dockerfile +++ b/frameworks/Ur/urweb/urweb-mysql.dockerfile @@ -1,9 +1,9 @@ -FROM ubuntu:18.04 +FROM ubuntu:23.10 ADD ./ /urweb WORKDIR /urweb -RUN apt-get update -yqq && apt-get install -yqq urweb +RUN apt-get update -yqq && apt-get install -yqq sudo git gcc make autoconf automake libtool mlton libmysqlclient-dev libssl-dev uthash-dev libicu-dev && git clone https://github.com/urweb/urweb.git && cd urweb && ./autogen.sh && ./configure && make -j && sudo make install RUN urweb -dbms mysql -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=tfb-database" bench diff --git a/frameworks/Ur/urweb/urweb.dockerfile b/frameworks/Ur/urweb/urweb.dockerfile index 998ee242cd1..6bbba474104 100644 --- a/frameworks/Ur/urweb/urweb.dockerfile +++ b/frameworks/Ur/urweb/urweb.dockerfile @@ -1,9 +1,9 @@ -FROM ubuntu:18.04 +FROM ubuntu:23.10 ADD ./ /urweb WORKDIR /urweb -RUN apt-get update -yqq && apt-get install -yqq urweb +RUN apt-get update -yqq && apt-get install -yqq sudo git gcc make autoconf automake libtool mlton libpq-dev libssl-dev uthash-dev libicu-dev && git clone https://github.com/urweb/urweb.git && cd urweb && ./autogen.sh && ./configure && make -j && sudo make install RUN urweb -db "dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass host=tfb-database" bench diff --git a/frameworks/VB/aspnetcore/Benchmarks/Benchmarks.vbproj b/frameworks/VB/aspnetcore/Benchmarks/Benchmarks.vbproj index fe9d3cbf5b6..59613d54879 100644 --- a/frameworks/VB/aspnetcore/Benchmarks/Benchmarks.vbproj +++ b/frameworks/VB/aspnetcore/Benchmarks/Benchmarks.vbproj @@ -11,7 +11,7 @@ - + diff --git a/toolset/benchmark/benchmarker.py b/toolset/benchmark/benchmarker.py index 3d6f1533ced..84e6be29912 100644 --- a/toolset/benchmark/benchmarker.py +++ b/toolset/benchmark/benchmarker.py @@ -29,7 +29,8 @@ def __init__(self, config): # a list of all tests for this run self.tests = self.metadata.tests_to_run() - + if self.config.reverse_order: + self.tests.reverse() self.results = Results(self) self.docker_helper = DockerHelper(self) diff --git a/toolset/continuous/tfb-shutdown.sh b/toolset/continuous/tfb-shutdown.sh index d257182b623..db96b07941b 100644 --- a/toolset/continuous/tfb-shutdown.sh +++ b/toolset/continuous/tfb-shutdown.sh @@ -30,4 +30,10 @@ ssh techempower@$TFB_DATABASE_HOST "$(typeset -f docker_clean); docker_clean" echo "running docker_clean on client host" ssh techempower@$TFB_CLIENT_HOST "$(typeset -f docker_clean); docker_clean" +if [ -z "$TFB_RUN_ORDER" ]; then + export TFB_RUN_ORDER="reverse" +else + unset TFB_RUN_ORDER +fi + echo "done with tfb-shutdown script" diff --git a/toolset/continuous/tfb-startup.sh b/toolset/continuous/tfb-startup.sh index 6a92e506f97..866d68135cc 100644 --- a/toolset/continuous/tfb-startup.sh +++ b/toolset/continuous/tfb-startup.sh @@ -25,6 +25,12 @@ docker build -t techempower/tfb \ --build-arg USER_ID=$(id -u) \ --build-arg GROUP_ID=$(id -g) . +if [ -z "$TFB_RUN_ORDER" ]; then + export TFB_RUN_ORDER="reverse" +else + unset TFB_RUN_ORDER +fi + echo "running tfb docker image" docker run \ -e USER_ID=$(id -u) \ @@ -38,6 +44,7 @@ docker run \ --results-name "$TFB_RUN_NAME" \ --results-environment "$TFB_ENVIRONMENT" \ --results-upload-uri "$TFB_UPLOAD_URI" \ + $(if [ "$TFB_RUN_ORDER" = "reverse" ]; then echo "--reverse-order"; fi) \ --quiet echo "zipping the results" diff --git a/toolset/databases/__init__.py b/toolset/databases/__init__.py index c70a972bf9e..e474436b3ec 100644 --- a/toolset/databases/__init__.py +++ b/toolset/databases/__init__.py @@ -1,4 +1,4 @@ -import imp +import importlib import re from colorama import Fore @@ -14,14 +14,16 @@ # regex that grabs the characters between "toolset/database/" # and the final "/" in the db folder string to get the db name db_name = re.findall(r'.+\/(.+)\/$', folder, re.M)[0] - # ignore generate __pycache__ folder + # ignore generated __pycache__ folder if db_name == '__pycache__': continue - db = imp.load_source("Database", "%s%s.py" % (folder, db_name)) + spec = importlib.util.spec_from_file_location("Database", "%s%s.py" % (folder, db_name)) + db = importlib.util.module_from_spec(spec) + spec.loader.exec_module(db) if not hasattr(db.Database, "get_current_world_table")\ or not hasattr(db.Database, "test_connection"): - log("Database %s does not implement the required methods" + db_name, + log("Database %s does not implement the required methods" % (db_name), color=Fore.RED) databases[db_name] = db.Database diff --git a/toolset/databases/abstract_database.py b/toolset/databases/abstract_database.py index 8f7b4d83e2c..27be6107edb 100644 --- a/toolset/databases/abstract_database.py +++ b/toolset/databases/abstract_database.py @@ -11,7 +11,7 @@ class AbstractDatabase: ''' #margin of tolerance on the results (rows read or updated only) margin = 1.011 - + @classmethod @abc.abstractmethod def get_connection(cls, config): @@ -94,13 +94,13 @@ def verify_queries(cls, config, table_name, url, concurrency=512, count=2, check process = subprocess.run(shlex.split( "siege -c %s -r %s %s -R %s/.siegerc" % (concurrency, count, url, path)), stdout = subprocess.PIPE, stderr = subprocess.STDOUT, timeout=20, text=True - ) + ) except subprocess.TimeoutExpired as e: print("Verification failed: %s" % (e)) else: output = process.stdout #Search for failed transactions - match = re.search('Failed transactions:.*?(\d+)\n', output, re.MULTILINE) + match = re.search(r'Failed transactions:.*?(\d+)\n', output, re.MULTILINE) if match: trans_failures = int(match.group(1)) print(output) diff --git a/toolset/databases/mongodb/create.js b/toolset/databases/mongodb/create.js index c34e2530232..2ef4f9f589a 100644 --- a/toolset/databases/mongodb/create.js +++ b/toolset/databases/mongodb/create.js @@ -1,4 +1,3 @@ -disableTelemetry() db = db.getSiblingDB('hello_world') db.world.drop() for (var i = 1; i <= 10000; i++) { diff --git a/toolset/databases/mongodb/mongodb.py b/toolset/databases/mongodb/mongodb.py index 0fdc005bbf5..f6ddcad3b29 100644 --- a/toolset/databases/mongodb/mongodb.py +++ b/toolset/databases/mongodb/mongodb.py @@ -1,3 +1,4 @@ +import bson import pymongo import traceback @@ -44,7 +45,7 @@ def test_connection(cls, config): connection = cls.get_connection(config) db = connection.hello_world db.world.find() - db.close() + connection.close() return True except: return False @@ -52,19 +53,19 @@ def test_connection(cls, config): @classmethod def get_queries(cls, config): co = cls.get_connection(config) - status = co.admin.command(pymongo.son_manipulator.SON([('serverStatus', 1)])) + status = co.admin.command(bson.son.SON([('serverStatus', 1)])) return int(status["opcounters"]["query"]) + int(status["opcounters"]["update"]) #get_queries returns all the queries @classmethod def get_rows(cls, config): co = cls.get_connection(config) - status = co.admin.command(pymongo.son_manipulator.SON([('serverStatus', 1)])) + status = co.admin.command(bson.son.SON([('serverStatus', 1)])) return int(status["opcounters"]["query"]) * cls.get_rows_per_query(co) @classmethod def get_rows_updated(cls, config): co = cls.get_connection(config) - status = co.admin.command(pymongo.son_manipulator.SON([('serverStatus', 1)])) + status = co.admin.command(bson.son.SON([('serverStatus', 1)])) return int(status["opcounters"]["update"]) * cls.get_rows_per_query(co) @classmethod diff --git a/toolset/databases/mysql/my.cnf b/toolset/databases/mysql/my.cnf index 9cf0b18c5e1..40ffa8dd9eb 100644 --- a/toolset/databases/mysql/my.cnf +++ b/toolset/databases/mysql/my.cnf @@ -16,7 +16,8 @@ default-character-set=utf8 # * Basic Settings # default-storage-engine = innodb -default_authentication_plugin = mysql_native_password +mysql_native_password = ON +#default_authentication_plugin = mysql_native_password user = mysql pid-file = /var/run/mysqld/mysqld.pid diff --git a/toolset/databases/mysql/mysql.dockerfile b/toolset/databases/mysql/mysql.dockerfile index 196085811a1..1aae5eb7d38 100644 --- a/toolset/databases/mysql/mysql.dockerfile +++ b/toolset/databases/mysql/mysql.dockerfile @@ -1,4 +1,4 @@ -FROM mysql:8.3 +FROM mysql:8.4 ENV MYSQL_ROOT_PASSWORD=root ENV MYSQL_USER=benchmarkdbuser diff --git a/toolset/run-tests.py b/toolset/run-tests.py index 153a2b029bd..c226edece26 100644 --- a/toolset/run-tests.py +++ b/toolset/run-tests.py @@ -67,6 +67,11 @@ def main(argv=None): ''') # Suite options + # CPU set options + parser.add_argument( + '--cpuset-cpus', + default=None, + help='The cpu set to run framework container on') parser.add_argument( '--audit', action='store_true', @@ -84,6 +89,13 @@ def main(argv=None): help= 'Only print a limited set of messages to stdout, keep the bulk of messages in log files only' ) + parser.add_argument( + '--reverse-order', + action='store_true', + default=False, + help= + 'Run the tests in reverse order, starting with the last test in the list' + ) parser.add_argument( '--results-name', help='Gives a name to this set of results, formatted as a date', diff --git a/toolset/test_types/__init__.py b/toolset/test_types/__init__.py index 604df6682f7..9b5ea627fd0 100644 --- a/toolset/test_types/__init__.py +++ b/toolset/test_types/__init__.py @@ -1,4 +1,4 @@ -import imp +import importlib import re from glob import glob @@ -14,5 +14,7 @@ # ignore generated __pycache__ folder if test_type_name == '__pycache__': continue - test_type = imp.load_source("TestType", "%s%s.py" % (folder, test_type_name)) + spec = importlib.util.spec_from_file_location("TestType", "%s%s.py" % (folder, test_type_name)) + test_type = importlib.util.module_from_spec(spec) + spec.loader.exec_module(test_type) test_types[test_type_name] = test_type.TestType diff --git a/toolset/utils/benchmark_config.py b/toolset/utils/benchmark_config.py index a64ca87af4f..48755e9f460 100755 --- a/toolset/utils/benchmark_config.py +++ b/toolset/utils/benchmark_config.py @@ -25,6 +25,7 @@ def __init__(self, args): self.duration = args.duration self.exclude = args.exclude self.quiet = args.quiet + self.reverse_order = args.reverse_order self.server_host = args.server_host self.database_host = args.database_host self.client_host = args.client_host @@ -51,6 +52,7 @@ def __init__(self, args): self.database_docker_host = None self.client_docker_host = None self.network = None + self.cpuset_cpus = args.cpuset_cpus self.test_container_memory = args.test_container_memory self.extra_docker_runtime_args = args.extra_docker_runtime_args diff --git a/toolset/utils/docker_helper.py b/toolset/utils/docker_helper.py index c58bb71d6a2..1f3ea692ee1 100644 --- a/toolset/utils/docker_helper.py +++ b/toolset/utils/docker_helper.py @@ -189,6 +189,13 @@ def watch_container(docker_container, docker_file): 'soft': 99 }] + cpuset_cpus = '' + + if self.benchmarker.config.cpuset_cpus is not None: + cpuset_cpus = self.benchmarker.config.cpuset_cpus + + log("Running docker container with cpu set: %s" %cpuset_cpus) + docker_cmd = '' if hasattr(test, 'docker_cmd'): docker_cmd = test.docker_cmd @@ -235,6 +242,7 @@ def watch_container(docker_container, docker_file): sysctls=sysctl, remove=True, log_config={'type': None}, + cpuset_cpus=cpuset_cpus, **extra_docker_args ) diff --git a/toolset/utils/scaffolding.py b/toolset/utils/scaffolding.py index 9eceb57e122..ec866e5bc76 100755 --- a/toolset/utils/scaffolding.py +++ b/toolset/utils/scaffolding.py @@ -8,7 +8,7 @@ class Scaffolding: def __init__(self, benchmarker): print(""" ------------------------------------------------------------------------------- - This wizard is intended to help build the scaffolding required for a new + This wizard is intended to help build the scaffolding required for a new test to be benchmarked. From here, you will be prompted for values related to the test you @@ -87,12 +87,12 @@ def __prompt_language(self): print(""" That language is not currently in our list of known languages. - + Here is a list of similar languages present in our benchmark suite that you may have meant: %s - + Did you mean to add the new language, '%s', to the benchmark suite? """ % (similar, self.language)) valid = self.__prompt_confirm_new_language() @@ -115,8 +115,8 @@ def __gather_approach(self): print(""" The approach of your test implementation. - 1) Realistic: Uses the framework with most out-of-the-box functionality - enabled. We consider this realistic because most applications + 1) Realistic: Uses the framework with most out-of-the-box functionality + enabled. We consider this realistic because most applications built with the framework will leave these features enabled. 2) Stripped: Removes or outright avoids implementing features that are unnecessary for the particulars of the benchmark exercise. This @@ -143,14 +143,14 @@ def __gather_classification(self): print(""" The classification of your test implementation. - 1) Fullstack: Robust framework expected to provide high-level functionality - for serving as a web application; for example, ability to - compose views, provide functions for responding with several - data types (json, html, etc), connecting to a database, form + 1) Fullstack: Robust framework expected to provide high-level functionality + for serving as a web application; for example, ability to + compose views, provide functions for responding with several + data types (json, html, etc), connecting to a database, form processing, etc. 2) Micro: Simple framework expected to provide enough middleware to build - a robust web application such as request routing and some - simple plumbing, but may not include built-in functionality + a robust web application such as request routing and some + simple plumbing, but may not include built-in functionality such as, for example, server-composed views. 3) Platform: Barebones infrastructure for servicing HTTP requests, but does not include a framework at all. @@ -181,7 +181,7 @@ def __gather_platform(self): print(""" The platform of your test implementation. - The platform is the low-level software or API used to host web applications + The platform is the low-level software or API used to host web applications for the framework; the platform provides an implementation of the HTTP fundamentals. @@ -233,11 +233,11 @@ def __gather_orm(self): print(""" How you would classify the ORM (object relational mapper) of your test? - 1) Full: A feature-rich ORM which provides functionality for interacting - with a database without writing a query in all but the most edge + 1) Full: A feature-rich ORM which provides functionality for interacting + with a database without writing a query in all but the most edge cases. 2) Micro: An ORM which provides functionality for interacting with a database - for many trivial operations (querying, updating), but not more + for many trivial operations (querying, updating), but not more robust cases (for example, gathering relations). 3) Raw: No ORM; raw database access. """) @@ -277,9 +277,9 @@ def __gather_versus(self): print(""" The name of another test (elsewhere in this project) that is a subset of this framework. - This allows for the generation of the framework efficiency chart in the + This allows for the generation of the framework efficiency chart in the results web site. - For example, Compojure is compared to "servlet" since Compojure is built on + For example, Compojure is compared to "servlet" since Compojure is built on the Servlet platform. Example: Servlet, Wai, Undertow @@ -344,31 +344,31 @@ def __copy_scaffold_files(self): def __edit_scaffold_files(self): for file in os.listdir(os.path.join(self.test_dir)): self.__replace_text( - os.path.join(self.test_dir, file), "\$NAME", self.name) + os.path.join(self.test_dir, file), r'\$NAME', self.name) self.__replace_text( - os.path.join(self.test_dir, file), "\$DISPLAY_NAME", + os.path.join(self.test_dir, file), r'\$DISPLAY_NAME', self.display_name) self.__replace_text( - os.path.join(self.test_dir, file), "\$APPROACH", self.approach) + os.path.join(self.test_dir, file), r'\$APPROACH', self.approach) self.__replace_text( - os.path.join(self.test_dir, file), "\$CLASSIFICATION", + os.path.join(self.test_dir, file), r'\$CLASSIFICATION', self.classification) self.__replace_text( - os.path.join(self.test_dir, file), "\$FRAMEWORK", + os.path.join(self.test_dir, file), r'\$FRAMEWORK', self.framework) self.__replace_text( - os.path.join(self.test_dir, file), "\$LANGUAGE", self.language) + os.path.join(self.test_dir, file), r'\$LANGUAGE', self.language) self.__replace_text( - os.path.join(self.test_dir, file), "\$DATABASE", self.database) + os.path.join(self.test_dir, file), r'\$DATABASE', self.database) self.__replace_text( - os.path.join(self.test_dir, file), "\$ORM", self.orm) + os.path.join(self.test_dir, file), r'\$ORM', self.orm) self.__replace_text( - os.path.join(self.test_dir, file), "\$PLATFORM", self.platform) + os.path.join(self.test_dir, file), r'\$PLATFORM', self.platform) self.__replace_text( - os.path.join(self.test_dir, file), "\$WEBSERVER", + os.path.join(self.test_dir, file), r'\$WEBSERVER', self.webserver) self.__replace_text( - os.path.join(self.test_dir, file), "\$VERSUS", self.versus) + os.path.join(self.test_dir, file), r'\$VERSUS', self.versus) def __print_success(self): print(""" diff --git a/toolset/wrk/wrk.dockerfile b/toolset/wrk/wrk.dockerfile index 01d7d4ae579..9bcf42f7b38 100644 --- a/toolset/wrk/wrk.dockerfile +++ b/toolset/wrk/wrk.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 # Required scripts for benchmarking COPY concurrency.sh pipeline.lua pipeline.sh query.sh ./