diff --git a/CMakeCache.txt b/CMakeCache.txt new file mode 100644 index 00000000000..628d4cdc769 --- /dev/null +++ b/CMakeCache.txt @@ -0,0 +1,505 @@ +# This is the CMakeCache file. +# For build in directory: /Users/hzq/cpp/FrameworkBenchmarks +# It was generated by CMake: /usr/local/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a library. +BRDEC_LIB_DIR:FILEPATH=BRDEC_LIB_DIR-NOTFOUND + +//Path to a library. +BR_LIB_DIR:FILEPATH=BR_LIB_DIR-NOTFOUND + +//Path to a library. +Brotli:FILEPATH=Brotli-NOTFOUND + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND + +//Path to a program. +CMAKE_AR:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING=Release + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Value Computed by CMake. +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/pkgRedirects + +//Path to a program. +CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump + +//Build architectures for OSX +CMAKE_OSX_ARCHITECTURES:STRING= + +//Minimum OS X version to target for deployment (at runtime); newer +// APIs weak linked. Set to empty string for default value. +CMAKE_OSX_DEPLOYMENT_TARGET:STRING=14.7 + +//The product will be built against the headers and libraries located +// inside the indicated SDK. +CMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Paozhu_web_framework + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip + +//Path to a program. +CMAKE_TAPI:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//choose ON to enable +ENABLE_BOOST:BOOL=OFF + +//choose ON to enable +ENABLE_GD:BOOL=ON + +//choose ON to enable +ENABLE_VCPKG:BOOL=OFF + +//choose ON to enable +ENABLE_WIN_VCPKG:BOOL=OFF + +//Path to a library. +FREETYPE_LIB_DIR:FILEPATH=/usr/local/opt/freetype/lib/libfreetype.dylib + +//Path to a library. +GD_LIB_DIR:FILEPATH=/usr/local/opt/gd/lib/libgd.dylib + +//Path to a file. +MYSQL_INCLUDE_DIR:PATH=/usr/local/mysql/include + +//Path to a library. +MYSQL_LIBRARY:FILEPATH=/usr/local/mysql/lib/libmysqlclient.dylib + +//Path to a file. +MYSQL_ROOT_DIR:PATH=/usr/local + +//Path to a library. +OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/local/Cellar/openssl@3/3.4.1/lib/libcrypto.dylib + +//Path to a file. +OPENSSL_INCLUDE_DIR:PATH=/usr/local/Cellar/openssl@3/3.4.1/include + +//Path to a library. +OPENSSL_SSL_LIBRARY:FILEPATH=/usr/local/Cellar/openssl@3/3.4.1/lib/libssl.dylib + +//Arguments to supply to pkg-config +PKG_CONFIG_ARGN:STRING= + +//pkg-config executable +PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/local/bin/pkg-config + +//Path to a library. +PNG_LIB_DIR:FILEPATH=/usr/local/opt/libpng/lib/libpng.dylib + +//Value Computed by CMake +Paozhu_web_framework_BINARY_DIR:STATIC=/Users/hzq/cpp/FrameworkBenchmarks + +//Value Computed by CMake +Paozhu_web_framework_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +Paozhu_web_framework_SOURCE_DIR:STATIC=/Users/hzq/cpp + +//Path to a library. +QR_LIB_DIR:FILEPATH=/usr/local/opt/qrencode/lib/libqrencode.dylib + +//Path to a file. +ZLIB_INCLUDE_DIR:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include + +//Path to a library. +ZLIB_LIBRARY_DEBUG:FILEPATH=ZLIB_LIBRARY_DEBUG-NOTFOUND + +//Path to a library. +ZLIB_LIBRARY_RELEASE:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/libz.tbd + +//Path to a library. +pkgcfg_lib__OPENSSL_crypto:FILEPATH=/usr/local/Cellar/openssl@3/3.4.1/lib/libcrypto.dylib + +//Path to a library. +pkgcfg_lib__OPENSSL_ssl:FILEPATH=/usr/local/Cellar/openssl@3/3.4.1/lib/libssl.dylib + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/hzq/cpp/FrameworkBenchmarks +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=31 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/hzq/cpp +//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL +CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_TAPI +CMAKE_TAPI-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Details about finding OpenSSL +FIND_PACKAGE_MESSAGE_DETAILS_OpenSSL:INTERNAL=[/usr/local/Cellar/openssl@3/3.4.1/lib/libcrypto.dylib][/usr/local/Cellar/openssl@3/3.4.1/include][c ][v3.4.1()] +//Details about finding ZLIB +FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/libz.tbd][/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include][c ][v1.2.12()] +//Details about finding mysql +FIND_PACKAGE_MESSAGE_DETAILS_mysql:INTERNAL=[/usr/local][v()] +//ADVANCED property for variable: OPENSSL_CRYPTO_LIBRARY +OPENSSL_CRYPTO_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENSSL_INCLUDE_DIR +OPENSSL_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: OPENSSL_SSL_LIBRARY +OPENSSL_SSL_LIBRARY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: PKG_CONFIG_ARGN +PKG_CONFIG_ARGN-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE +PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: ZLIB_INCLUDE_DIR +ZLIB_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: ZLIB_LIBRARY_DEBUG +ZLIB_LIBRARY_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: ZLIB_LIBRARY_RELEASE +ZLIB_LIBRARY_RELEASE-ADVANCED:INTERNAL=1 +_OPENSSL_CFLAGS:INTERNAL=-I/usr/local/Cellar/openssl@3/3.4.1/include +_OPENSSL_CFLAGS_I:INTERNAL= +_OPENSSL_CFLAGS_OTHER:INTERNAL= +_OPENSSL_FOUND:INTERNAL=1 +_OPENSSL_INCLUDEDIR:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/include +_OPENSSL_INCLUDE_DIRS:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/include +_OPENSSL_LDFLAGS:INTERNAL=-L/usr/local/Cellar/openssl@3/3.4.1/lib;-lssl;-lcrypto +_OPENSSL_LDFLAGS_OTHER:INTERNAL= +_OPENSSL_LIBDIR:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/lib +_OPENSSL_LIBRARIES:INTERNAL=ssl;crypto +_OPENSSL_LIBRARY_DIRS:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/lib +_OPENSSL_LIBS:INTERNAL= +_OPENSSL_LIBS_L:INTERNAL= +_OPENSSL_LIBS_OTHER:INTERNAL= +_OPENSSL_LIBS_PATHS:INTERNAL= +_OPENSSL_MODULE_NAME:INTERNAL=openssl +_OPENSSL_PREFIX:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1 +_OPENSSL_STATIC_CFLAGS:INTERNAL=-I/usr/local/Cellar/openssl@3/3.4.1/include +_OPENSSL_STATIC_CFLAGS_I:INTERNAL= +_OPENSSL_STATIC_CFLAGS_OTHER:INTERNAL= +_OPENSSL_STATIC_INCLUDE_DIRS:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/include +_OPENSSL_STATIC_LDFLAGS:INTERNAL=-L/usr/local/Cellar/openssl@3/3.4.1/lib;-lssl;-lcrypto +_OPENSSL_STATIC_LDFLAGS_OTHER:INTERNAL= +_OPENSSL_STATIC_LIBDIR:INTERNAL= +_OPENSSL_STATIC_LIBRARIES:INTERNAL=ssl;crypto +_OPENSSL_STATIC_LIBRARY_DIRS:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/lib +_OPENSSL_STATIC_LIBS:INTERNAL= +_OPENSSL_STATIC_LIBS_L:INTERNAL= +_OPENSSL_STATIC_LIBS_OTHER:INTERNAL= +_OPENSSL_STATIC_LIBS_PATHS:INTERNAL= +_OPENSSL_VERSION:INTERNAL=3.4.1 +_OPENSSL_openssl_INCLUDEDIR:INTERNAL= +_OPENSSL_openssl_LIBDIR:INTERNAL= +_OPENSSL_openssl_PREFIX:INTERNAL= +_OPENSSL_openssl_VERSION:INTERNAL= +__pkg_config_arguments__OPENSSL:INTERNAL=QUIET;openssl +__pkg_config_checked__OPENSSL:INTERNAL=1 +//ADVANCED property for variable: pkgcfg_lib__OPENSSL_crypto +pkgcfg_lib__OPENSSL_crypto-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: pkgcfg_lib__OPENSSL_ssl +pkgcfg_lib__OPENSSL_ssl-ADVANCED:INTERNAL=1 +prefix_result:INTERNAL=/usr/local/Cellar/openssl@3/3.4.1/lib + diff --git a/CMakeFiles/3.31.5/CMakeCCompiler.cmake b/CMakeFiles/3.31.5/CMakeCCompiler.cmake new file mode 100644 index 00000000000..bb8540e2ff3 --- /dev/null +++ b/CMakeFiles/3.31.5/CMakeCCompiler.cmake @@ -0,0 +1,81 @@ +set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "AppleClang") +set(CMAKE_C_COMPILER_VERSION "16.0.0.16000026") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_C_STANDARD_LATEST "23") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") +set(CMAKE_C17_COMPILE_FEATURES "c_std_17") +set(CMAKE_C23_COMPILE_FEATURES "c_std_23") + +set(CMAKE_C_PLATFORM_ID "Darwin") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_C_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_C_COMPILER_LINKER_ID "AppleClang") +set(CMAKE_C_COMPILER_LINKER_VERSION 1115.7.3) +set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) +set(CMAKE_C_LINKER_DEPFILE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks") diff --git a/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake b/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake new file mode 100644 index 00000000000..c7424f026f2 --- /dev/null +++ b/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake @@ -0,0 +1,101 @@ +set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_VERSION "16.0.0.16000026") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_CXX_STANDARD_LATEST "23") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") +set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") +set(CMAKE_CXX26_COMPILE_FEATURES "") + +set(CMAKE_CXX_PLATFORM_ID "Darwin") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_CXX_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_CXX_COMPILER_LINKER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_LINKER_VERSION 1115.7.3) +set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang IN ITEMS C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) +set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks") +set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") + +set(CMAKE_CXX_COMPILER_IMPORT_STD "") +### Imported target for C++23 standard library +set(CMAKE_CXX23_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE "Unsupported generator: Unix Makefiles") + + + diff --git a/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin b/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 00000000000..7d275c14122 Binary files /dev/null and b/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin differ diff --git a/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin b/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 00000000000..b296b6a08d9 Binary files /dev/null and b/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/CMakeFiles/3.31.5/CMakeSystem.cmake b/CMakeFiles/3.31.5/CMakeSystem.cmake new file mode 100644 index 00000000000..4ba5c26de72 --- /dev/null +++ b/CMakeFiles/3.31.5/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Darwin-23.6.0") +set(CMAKE_HOST_SYSTEM_NAME "Darwin") +set(CMAKE_HOST_SYSTEM_VERSION "23.6.0") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Darwin-23.6.0") +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_SYSTEM_VERSION "23.6.0") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c b/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 00000000000..8d8bb038bb3 --- /dev/null +++ b/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,904 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define C_STD_99 199901L +#define C_STD_11 201112L +#define C_STD_17 201710L +#define C_STD_23 202311L + +#ifdef __STDC_VERSION__ +# define C_STD __STDC_VERSION__ +#endif + +#if !defined(__STDC__) && !defined(__clang__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif C_STD > C_STD_17 +# define C_VERSION "23" +#elif C_STD > C_STD_11 +# define C_VERSION "17" +#elif C_STD > C_STD_99 +# define C_VERSION "11" +#elif C_STD >= C_STD_99 +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o b/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o new file mode 100644 index 00000000000..2841bb77a68 Binary files /dev/null and b/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o differ diff --git a/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp b/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 00000000000..da6c824af3a --- /dev/null +++ b/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,919 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define CXX_STD_98 199711L +#define CXX_STD_11 201103L +#define CXX_STD_14 201402L +#define CXX_STD_17 201703L +#define CXX_STD_20 202002L +#define CXX_STD_23 202302L + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) +# if _MSVC_LANG > CXX_STD_17 +# define CXX_STD _MSVC_LANG +# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17 +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 +# define CXX_STD CXX_STD_17 +# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# elif defined(__INTEL_CXX11_MODE__) +# define CXX_STD CXX_STD_11 +# else +# define CXX_STD CXX_STD_98 +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# if _MSVC_LANG > __cplusplus +# define CXX_STD _MSVC_LANG +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__NVCOMPILER) +# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__INTEL_COMPILER) || defined(__PGI) +# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) +# define CXX_STD CXX_STD_17 +# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__) +# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define CXX_STD CXX_STD_11 +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_standard_default = "INFO" ":" "standard_default[" +#if CXX_STD > CXX_STD_23 + "26" +#elif CXX_STD > CXX_STD_20 + "23" +#elif CXX_STD > CXX_STD_17 + "20" +#elif CXX_STD > CXX_STD_14 + "17" +#elif CXX_STD > CXX_STD_11 + "14" +#elif CXX_STD >= CXX_STD_11 + "11" +#else + "98" +#endif +"]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} diff --git a/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o b/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o new file mode 100644 index 00000000000..db2cc10625b Binary files /dev/null and b/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o differ diff --git a/CMakeFiles/CMakeConfigureLog.yaml b/CMakeFiles/CMakeConfigureLog.yaml new file mode 100644 index 00000000000..0667d47946f --- /dev/null +++ b/CMakeFiles/CMakeConfigureLog.yaml @@ -0,0 +1,471 @@ + +--- +events: + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineSystem.cmake:205 (message)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + The system is: Darwin - 23.6.0 - x86_64 + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. + Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + Build flags: + Id flags: + + The output was: + 1 + ld: library 'System' not found + cc: error: linker command failed with exit code 1 (use -v to see invocation) + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. + Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc + Build flags: + Id flags: -c + + The output was: + 0 + + + Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" + + The C compiler identification is AppleClang, found in: + /Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. + Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + Build flags: + Id flags: + + The output was: + 1 + ld: library 'c++' not found + c++: error: linker command failed with exit code 1 (use -v to see invocation) + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. + Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ + Build flags: + Id flags: -c + + The output was: + 0 + + + Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" + + The CXX compiler identification is AppleClang, found in: + /Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o + + - + kind: "try_compile-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" + - "/usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC" + binary: "/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_OSX_ARCHITECTURES: "" + CMAKE_OSX_DEPLOYMENT_TARGET: "14.7" + CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC' + + Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_148e9/fast + /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_148e9.dir/build.make CMakeFiles/cmTC_148e9.dir/build + Building C object CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -v -Wl,-v -MD -MT CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c + Apple clang version 16.0.0 (clang-1600.0.26.6) + Target: x86_64-apple-darwin23.6.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + cc: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx14.7.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.2 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdebug-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -x c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c + clang -cc1 version 16.0.0 (clang-1600.0.26.6) default target x86_64-apple-darwin23.6.0 + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/Library/Frameworks" + #include "..." search starts here: + #include <...> search starts here: + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks (framework directory) + End of search list. + Linking C executable cmTC_148e9 + /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_148e9.dir/link.txt --verbose=1 + Apple clang version 16.0.0 (clang-1600.0.26.6) + Target: x86_64-apple-darwin23.6.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 14.7.0 15.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_148e9 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a + @(#)PROGRAM:ld PROJECT:ld-1115.7.3 + BUILD 23:50:35 Dec 5 2024 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.9) + Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift + Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -o cmTC_148e9 + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:113 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Effective list of requested architectures (possibly empty) : "" + Effective list of architectures found in the ABI info binary: "x86_64" + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Parsed C implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Parsed C implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_148e9/fast] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_148e9.dir/build.make CMakeFiles/cmTC_148e9.dir/build] + ignore line: [Building C object CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -v -Wl -v -MD -MT CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.6)] + ignore line: [Target: x86_64-apple-darwin23.6.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [cc: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx14.7.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.2 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdebug-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-b3BWrC -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -x c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [clang -cc1 version 16.0.0 (clang-1600.0.26.6) default target x86_64-apple-darwin23.6.0] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking C executable cmTC_148e9] + ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_148e9.dir/link.txt --verbose=1] + ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.6)] + ignore line: [Target: x86_64-apple-darwin23.6.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 14.7.0 15.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_148e9 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [14.7.0] ==> ignore + arg [15.2] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk] ==> ignore + arg [-mllvm] ==> ignore + arg [-enable-linkonceodr-outlining] ==> ignore + arg [-o] ==> ignore + arg [cmTC_148e9] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_148e9.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + linker tool for 'C': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + implicit libs: [] + implicit objs: [] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:255 (cmake_determine_linker_id)" + - "/usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Running the C compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" + @(#)PROGRAM:ld PROJECT:ld-1115.7.3 + BUILD 23:50:35 Dec 5 2024 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.9) + - + kind: "try_compile-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" + - "/usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + checks: + - "Detecting CXX compiler ABI info" + directories: + source: "/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX" + binary: "/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX" + cmakeVariables: + CMAKE_CXX_FLAGS: "" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_CXX_SCAN_FOR_MODULES: "OFF" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_OSX_ARCHITECTURES: "" + CMAKE_OSX_DEPLOYMENT_TARGET: "14.7" + CMAKE_OSX_SYSROOT: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk" + buildResult: + variable: "CMAKE_CXX_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX' + + Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_8ba91/fast + /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8ba91.dir/build.make CMakeFiles/cmTC_8ba91.dir/build + Building CXX object CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -v -Wl,-v -MD -MT CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp + Apple clang version 16.0.0 (clang-1600.0.26.6) + Target: x86_64-apple-darwin23.6.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + c++: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1" + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx14.7.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.2 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp + clang -cc1 version 16.0.0 (clang-1600.0.26.6) default target x86_64-apple-darwin23.6.0 + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/Library/Frameworks" + #include "..." search starts here: + #include <...> search starts here: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1 + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks (framework directory) + End of search list. + Linking CXX executable cmTC_8ba91 + /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ba91.dir/link.txt --verbose=1 + Apple clang version 16.0.0 (clang-1600.0.26.6) + Target: x86_64-apple-darwin23.6.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 14.7.0 15.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_8ba91 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a + @(#)PROGRAM:ld PROJECT:ld-1115.7.3 + BUILD 23:50:35 Dec 5 2024 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.9) + Library search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift + Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_8ba91 + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:113 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Effective list of requested architectures (possibly empty) : "" + Effective list of architectures found in the ABI info binary: "x86_64" + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Parsed CXX implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" + - "/usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Parsed CXX implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: '/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX'] + ignore line: [] + ignore line: [Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_8ba91/fast] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_8ba91.dir/build.make CMakeFiles/cmTC_8ba91.dir/build] + ignore line: [Building CXX object CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -v -Wl -v -MD -MT CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.6)] + ignore line: [Target: x86_64-apple-darwin23.6.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [c++: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx14.7.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=2 -target-sdk-version=15.2 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 1115.7.3 -v -fcoverage-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16 -dependency-file CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -fdebug-compilation-dir=/Users/hzq/cpp/FrameworkBenchmarks/CMakeFiles/CMakeScratch/TryCompile-oFV5KX -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [clang -cc1 version 16.0.0 (clang-1600.0.26.6) default target x86_64-apple-darwin23.6.0] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking CXX executable cmTC_8ba91] + ignore line: [/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ba91.dir/link.txt --verbose=1] + ignore line: [Apple clang version 16.0.0 (clang-1600.0.26.6)] + ignore line: [Target: x86_64-apple-darwin23.6.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -platform_version macos 14.7.0 15.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_8ba91 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [x86_64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [14.7.0] ==> ignore + arg [15.2] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk] ==> ignore + arg [-mllvm] ==> ignore + arg [-enable-linkonceodr-outlining] ==> ignore + arg [-o] ==> ignore + arg [cmTC_8ba91] ==> ignore + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_8ba91.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lc++] ==> lib [c++] + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + linker tool for 'CXX': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + Library search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin/libclang_rt.osx.a] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + implicit libs: [c++] + implicit objs: [] + implicit dirs: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/swift] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks] + + + - + kind: "message-v1" + backtrace: + - "/usr/local/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:40 (message)" + - "/usr/local/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:255 (cmake_determine_linker_id)" + - "/usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:26 (PROJECT)" + message: | + Running the CXX compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" + @(#)PROGRAM:ld PROJECT:ld-1115.7.3 + BUILD 23:50:35 Dec 5 2024 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 16.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 16.0.0 (tapi-1600.0.11.9) +... diff --git a/CMakeFiles/cmake.check_cache b/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000000..3dccd731726 --- /dev/null +++ b/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/frameworks/C++/cuehttp/README.md b/frameworks/C++/cuehttp/README.md deleted file mode 100644 index 600152a6635..00000000000 --- a/frameworks/C++/cuehttp/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# cuehttp Benchmarking Test - -https://github.com/xcyl/cuehttp - -## Testing Source Code - -* [PLAINTEXT](plaintext/main.cpp) - -## Test URLs - -### PLAINTEXT - -http://localhost:8080/plaintext diff --git a/frameworks/C++/cuehttp/benchmark_config.json b/frameworks/C++/cuehttp/benchmark_config.json deleted file mode 100644 index 85b98fb5188..00000000000 --- a/frameworks/C++/cuehttp/benchmark_config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "framework": "cuehttp", - "tests": [ - { - "default": { - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "None", - "framework": "cuehttp", - "language": "C++", - "flavor": "None", - "orm": "None", - "platform": "None", - "webserver": "None", - "os": "Linux", - "database_os": "Linux", - "display_name": "cuehttp", - "notes": "", - "versus": "cuehttp" - } - } - ] -} \ No newline at end of file diff --git a/frameworks/C++/cuehttp/cuehttp.dockerfile b/frameworks/C++/cuehttp/cuehttp.dockerfile deleted file mode 100644 index 5ea59fbf51b..00000000000 --- a/frameworks/C++/cuehttp/cuehttp.dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update -yqq -RUN apt-get install -yqq g++-7 cmake git libboost-all-dev - -ENV CUEHTTP=/cuehttp - -WORKDIR / -RUN git clone https://github.com/xcyl/cuehttp.git - -WORKDIR /cuehttp - -RUN git checkout a7f5a4c935e22d110b70c5928c8ea2ce4dcbeeb5 - -WORKDIR /cuehttp/examples/plaintext -RUN mkdir build && cd build && cmake .. && make -j8 -EXPOSE 8080 -CMD ./build/plaintext diff --git a/frameworks/C++/cuehttp/plaintext/CMakeLists.txt b/frameworks/C++/cuehttp/plaintext/CMakeLists.txt deleted file mode 100644 index dc7352aabad..00000000000 --- a/frameworks/C++/cuehttp/plaintext/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(plaintext) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -msse4.2 -Wall -std=c++17") - -set(SRC main.cpp) -include_directories($ENV{CUEHTTP}/include) - -find_package(Boost COMPONENTS system REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) - -add_executable(${PROJECT_NAME} ${SRC}) - -target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES}) - -if (WIN32) - target_link_libraries(${PROJECT_NAME} ws2_32 wsock32) -else () - target_link_libraries(${PROJECT_NAME} pthread) -endif () diff --git a/frameworks/C++/cuehttp/plaintext/main.cpp b/frameworks/C++/cuehttp/plaintext/main.cpp deleted file mode 100644 index 2b103e2a909..00000000000 --- a/frameworks/C++/cuehttp/plaintext/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include - -using namespace cue::http; - -int main(int argc, char** argv) { - router route; - route.post("/plaintext", [](context& ctx) { - ctx.type("text/plain"); - ctx.status(200); - ctx.body("Hello, World!"); - }); - cuehttp app; - app.use(route); - app.listen(8080).run(); - - return 0; -} diff --git a/frameworks/C++/paozhu/paozhu.dockerfile b/frameworks/C++/paozhu/paozhu.dockerfile index 212773c8bea..f71728d65f2 100644 --- a/frameworks/C++/paozhu/paozhu.dockerfile +++ b/frameworks/C++/paozhu/paozhu.dockerfile @@ -24,10 +24,14 @@ RUN rm -Rf ./paozhu/libs RUN rm -Rf ./paozhu/viewsrc RUN rm -Rf ./paozhu/orm RUN rm -Rf ./paozhu/models -RUN rm -Rf ./paozhu/common - - - +#RUN rm -Rf ./paozhu/common +RUN rm -Rf ./paozhu/common/autocontrolmethod.hpp +RUN rm -Rf ./paozhu/common/autorestfulpaths.hpp +RUN rm -Rf ./paozhu/common/json_reflect_headers.h +RUN rm -Rf ./paozhu/common/reghttpmethod_pre.hpp +RUN rm -Rf ./paozhu/common/reghttpmethod.hpp +RUN rm -Rf ./paozhu/common/websockets_method_reg.hpp +RUN rm -Rf ./paozhu/common/httphook.cpp # COPY ./paozhu_benchmark/controller ./paozhu/ # COPY ./paozhu_benchmark/libs ./paozhu/ # COPY ./paozhu_benchmark/view ./paozhu/ @@ -39,7 +43,7 @@ RUN rm -Rf ./paozhu/common # RUN ls -l ./paozhu # RUN pwd -RUN mkdir ./paozhu/common +#RUN mkdir ./paozhu/common RUN mkdir ./paozhu/libs RUN mkdir ./paozhu/libs/types COPY ./paozhu_benchmark/libs/types/techempower_json.h ./paozhu/libs/types/ @@ -58,7 +62,7 @@ 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/common/cost_define.h ./paozhu/common/ +#COPY ./paozhu_benchmark/common/cost_define.h ./paozhu/common/ COPY ./paozhu_benchmark/common/autorestfulpaths.hpp ./paozhu/common/ COPY ./paozhu_benchmark/common/websockets_method_reg.hpp ./paozhu/common/ COPY ./paozhu_benchmark/common/httphook.cpp ./paozhu/common/ diff --git a/frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h b/frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h index ef54468d7be..c4d1a48addf 100755 --- a/frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h +++ b/frameworks/C++/paozhu/paozhu_benchmark/common/cost_define.h @@ -9,4 +9,8 @@ #define CONST_HTTP_BODY_POST_SIZE 33554432 #define CONST_HTTP_JSON_POST_SIZE 2097152 +#define CONST_ORM_CLEAR_TIME 7200 +#define CONST_ORM_CLEAR_NUMBER 1024 +#define CONST_ORM_QUERY_CONNECT_TIMEOUT 30 + #endif \ No newline at end of file diff --git a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h index 18cba5958fc..2e403808c05 100644 --- a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h +++ b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortune_mysql.h @@ -28,6 +28,7 @@ #include "mysql_conn.h" #include "mysql_conn_pool.h" #include "orm_cache.hpp" +#include "mysql_connect_mar.h" /*baseincludefile*/ namespace orm { @@ -139,21 +140,31 @@ namespace orm { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = countsql.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(countsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -162,18 +173,31 @@ namespace orm unsigned int column_num = 0; unsigned int offset = 0; - querysql_len = 0; + unsigned int querysql_len = 0; for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -190,7 +214,7 @@ namespace orm else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); column_num--; if (column_num == 0) @@ -202,7 +226,7 @@ namespace orm { unsigned int tempnum = 0; - unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + unsigned int name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); querysql_len = 0; for (unsigned int ik = 0; ik < name_length; ik++) @@ -228,7 +252,18 @@ namespace orm } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -342,19 +377,31 @@ namespace orm { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = countsql.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(countsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } + //std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); pack_info_t temp_pack_data; @@ -365,18 +412,30 @@ namespace orm unsigned int column_num = 0; unsigned int offset = 0; - querysql_len = 0; + unsigned int querysql_len = 0; for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -393,7 +452,7 @@ namespace orm else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); column_num--; if (column_num == 0) @@ -405,7 +464,7 @@ namespace orm { unsigned int tempnum = 0; - unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + unsigned int name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); querysql_len = 0; for (unsigned int ik = 0; ik < name_length; ik++) @@ -431,8 +490,17 @@ namespace orm } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -585,28 +653,50 @@ namespace orm { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = countsql.length() + 1; + //auto conn = conn_obj->get_edit_conn(); - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -616,12 +706,14 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -714,28 +806,48 @@ namespace orm { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = countsql.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -745,12 +857,13 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -832,28 +945,51 @@ namespace orm { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = countsql.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + std::size_t n = edit_conn->write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -863,12 +999,13 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -5031,27 +5168,31 @@ M_MODEL& or_leMessage(T val) { return temprecord; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return temprecord; } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -5065,14 +5206,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return temprecord; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return temprecord; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5089,7 +5243,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5111,7 +5265,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -5142,8 +5296,18 @@ M_MODEL& or_leMessage(T val) } } } + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - conn_obj->back_select_conn(conn); + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5243,28 +5407,32 @@ M_MODEL& or_leMessage(T val) { return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -5280,14 +5448,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5304,7 +5485,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5328,7 +5509,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -5350,9 +5531,18 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5454,25 +5644,28 @@ M_MODEL& or_leMessage(T val) { return *mod; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return *mod; } @@ -5490,14 +5683,28 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); + return *mod; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return *mod; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5514,7 +5721,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5536,7 +5743,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5556,7 +5763,18 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5644,21 +5862,31 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -5674,14 +5902,26 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5698,7 +5938,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5720,7 +5960,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5740,8 +5980,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -5827,25 +6076,28 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -5863,14 +6115,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5887,7 +6152,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5909,7 +6174,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5929,7 +6194,18 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -6018,23 +6294,30 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - // asio::error_code ec; + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -6052,16 +6335,26 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - // std::memset(result_data, 0x00, 4096); - // n = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable); - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6078,7 +6371,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6100,7 +6393,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -6120,8 +6413,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -6206,27 +6508,31 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -6240,14 +6546,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6264,7 +6583,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6288,7 +6607,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -6301,7 +6620,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -6321,8 +6640,18 @@ M_MODEL& or_leMessage(T val) } } } + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - conn_obj->back_select_conn(conn); + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -6410,26 +6739,36 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + + if (n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; std::vector field_array; - // std::vector> field_value; unsigned char action_setup = 0; unsigned int column_num = 0; @@ -6437,18 +6776,29 @@ M_MODEL& or_leMessage(T val) unsigned int offset = 0; std::vector field_pos; - // std::map other_col; for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6465,7 +6815,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6489,7 +6839,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -6502,7 +6852,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -6522,9 +6872,17 @@ M_MODEL& or_leMessage(T val) } } } - - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -6716,25 +7074,29 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -6751,14 +7113,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6775,7 +7150,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6793,7 +7168,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -6824,7 +7199,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } } catch (const std::exception &e) @@ -6893,21 +7278,31 @@ M_MODEL& or_leMessage(T val) { co_return valuetemp; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return valuetemp; + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -6921,14 +7316,26 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return valuetemp; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6945,7 +7352,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6963,7 +7370,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -6994,7 +7401,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } } catch (const std::exception &e) @@ -7055,25 +7472,30 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -7091,14 +7513,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -7115,7 +7550,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -7136,7 +7571,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -7156,8 +7591,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -7228,22 +7672,31 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -7258,14 +7711,26 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -7282,7 +7747,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -7303,7 +7768,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -7323,8 +7788,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -7411,35 +7885,52 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); - conn_obj->back_edit_conn(conn); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7449,10 +7940,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7531,35 +8025,50 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); - conn_obj->back_edit_conn(conn); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7569,10 +8078,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7652,29 +8164,49 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -7684,11 +8216,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -7767,28 +8301,48 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7799,11 +8353,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -7848,35 +8404,50 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7886,10 +8457,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7969,35 +8543,49 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8007,10 +8595,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8091,28 +8682,48 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8122,10 +8733,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -8171,35 +8785,49 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8209,10 +8837,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8258,28 +8889,48 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8289,10 +8940,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -8376,35 +9031,49 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8414,10 +9083,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8508,36 +9181,51 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_edit_conn(); - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8546,10 +9234,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8587,36 +9278,52 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8625,12 +9332,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8667,29 +9376,50 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8698,12 +9428,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -8740,36 +9472,51 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8778,12 +9525,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8820,43 +9569,65 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); } else if ((unsigned char)temp_pack_data.data[0] == 0x00) { - unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -8893,36 +9664,51 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8930,12 +9716,14 @@ M_MODEL& or_leMessage(T val) else if ((unsigned char)temp_pack_data.data[0] == 0x00) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8972,29 +9760,50 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9003,12 +9812,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -9076,36 +9887,50 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9114,10 +9939,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } else { @@ -9126,36 +9955,51 @@ M_MODEL& or_leMessage(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9164,12 +10008,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } return 0; } @@ -9228,28 +10074,48 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -9260,11 +10126,13 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -9290,29 +10158,49 @@ M_MODEL& or_leMessage(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9321,12 +10209,14 @@ M_MODEL& or_leMessage(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -9347,7 +10237,7 @@ M_MODEL& or_leMessage(T val) std::tuple, std::map, std::vector>> query(const std::string &rawsql) { - + effect_num = 0; std::vector> temprecord; std::vector table_fieldname; std::map table_fieldmap; @@ -9391,25 +10281,28 @@ M_MODEL& or_leMessage(T val) { return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = rawsql.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(rawsql); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(rawsql); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } @@ -9427,14 +10320,27 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -9451,7 +10357,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -9475,7 +10381,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -9497,8 +10403,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(rawsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord)); } catch (const std::exception &e) @@ -9518,7 +10433,7 @@ M_MODEL& or_leMessage(T val) asio::awaitable, std::map, std::vector>>> async_query(const std::string &rawsql) { - + effect_num = 0; std::vector> temprecord; std::vector table_fieldname; std::map table_fieldmap; @@ -9562,22 +10477,30 @@ M_MODEL& or_leMessage(T val) { co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = rawsql.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(rawsql); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(rawsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -9592,14 +10515,26 @@ M_MODEL& or_leMessage(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -9616,7 +10551,7 @@ M_MODEL& or_leMessage(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -9640,7 +10575,7 @@ M_MODEL& or_leMessage(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -9662,8 +10597,17 @@ M_MODEL& or_leMessage(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(rawsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord)); } catch (const std::exception &e) @@ -9702,6 +10646,7 @@ M_MODEL& or_leMessage(T val) ishascontent = false; iscommit = false; iscache = false; + iserror = false; effect_num = 0; if (both) { @@ -9723,6 +10668,7 @@ M_MODEL& or_leMessage(T val) ishascontent = false; iscommit = false; iscache = false; + iserror = false; effect_num = 0; return *mod; } @@ -9758,7 +10704,25 @@ M_MODEL& or_leMessage(T val) iserror = true; return true; } - + void lock_conn() + { + islock_conn = true; + } + void unlock_conn() + { + islock_conn = false; + if (conn_obj) + { + if(select_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } + if(edit_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + } + } public: std::string selectsql; std::string wheresql; @@ -9776,11 +10740,14 @@ M_MODEL& or_leMessage(T val) bool ishascontent = false; bool iscache = false; bool iserror = false; + bool islock_conn = false; int exptime = 0; unsigned int effect_num = 0; M_MODEL *mod; + std::shared_ptr select_conn; + std::shared_ptr edit_conn; std::shared_ptr conn_obj; }; //} /*tagnamespace_replace*/ diff --git a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h index 2d688b054ed..0c2957cb67b 100644 --- a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h +++ b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/fortunebase.h @@ -2,7 +2,7 @@ #define ORM_DEFAULT_FORTUNEBASEMATA_H /* *This file is auto create from cli -*本文件为自动生成 Sun, 02 Mar 2025 10:54:30 GMT +*本文件为自动生成 Thu, 13 Mar 2025 08:50:20 GMT ***/ #include #include diff --git a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h index 5fe029ad608..6d4f2b60aec 100644 --- a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h +++ b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/world_mysql.h @@ -28,6 +28,7 @@ #include "mysql_conn.h" #include "mysql_conn_pool.h" #include "orm_cache.hpp" +#include "mysql_connect_mar.h" /*baseincludefile*/ namespace orm { @@ -139,21 +140,31 @@ namespace orm { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = countsql.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(countsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -162,18 +173,31 @@ namespace orm unsigned int column_num = 0; unsigned int offset = 0; - querysql_len = 0; + unsigned int querysql_len = 0; for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -190,7 +214,7 @@ namespace orm else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); column_num--; if (column_num == 0) @@ -202,7 +226,7 @@ namespace orm { unsigned int tempnum = 0; - unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + unsigned int name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); querysql_len = 0; for (unsigned int ik = 0; ik < name_length; ik++) @@ -228,7 +252,18 @@ namespace orm } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -342,19 +377,31 @@ namespace orm { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = countsql.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(countsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } + //std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); pack_info_t temp_pack_data; @@ -365,18 +412,30 @@ namespace orm unsigned int column_num = 0; unsigned int offset = 0; - querysql_len = 0; + unsigned int querysql_len = 0; for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -393,7 +452,7 @@ namespace orm else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); column_num--; if (column_num == 0) @@ -405,7 +464,7 @@ namespace orm { unsigned int tempnum = 0; - unsigned int name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + unsigned int name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); querysql_len = 0; for (unsigned int ik = 0; ik < name_length; ik++) @@ -431,8 +490,17 @@ namespace orm } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -585,28 +653,50 @@ namespace orm { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = countsql.length() + 1; + //auto conn = conn_obj->get_edit_conn(); - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -616,12 +706,14 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -714,28 +806,48 @@ namespace orm { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = countsql.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -745,12 +857,13 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -832,28 +945,51 @@ namespace orm { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = countsql.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(countsql); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); + std::size_t n = edit_conn->write_sql(countsql); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(countsql,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -863,12 +999,13 @@ namespace orm { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - //insertid = pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -4871,27 +5008,31 @@ M_MODEL& or_leRandomnumber(T val) { return temprecord; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return temprecord; } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -4905,14 +5046,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return temprecord; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return temprecord; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -4929,7 +5083,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -4951,7 +5105,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -4982,8 +5136,18 @@ M_MODEL& or_leRandomnumber(T val) } } } + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - conn_obj->back_select_conn(conn); + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5083,28 +5247,32 @@ M_MODEL& or_leRandomnumber(T val) { return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -5120,14 +5288,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5144,7 +5325,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5168,7 +5349,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -5190,9 +5371,18 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5294,25 +5484,28 @@ M_MODEL& or_leRandomnumber(T val) { return *mod; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return *mod; } @@ -5330,14 +5523,28 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); + return *mod; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return *mod; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5354,7 +5561,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5376,7 +5583,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5396,7 +5603,18 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5484,21 +5702,31 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -5514,14 +5742,26 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5538,7 +5778,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5560,7 +5800,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5580,8 +5820,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -5667,25 +5916,28 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -5703,14 +5955,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5727,7 +5992,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5749,7 +6014,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5769,7 +6034,18 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -5858,23 +6134,30 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - // asio::error_code ec; + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -5892,16 +6175,26 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - // std::memset(result_data, 0x00, 4096); - // n = co_await conn->socket->async_read_some(asio::buffer(result_data), asio::use_awaitable); - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -5918,7 +6211,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -5940,7 +6233,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -5960,8 +6253,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -6046,27 +6348,31 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } - pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; @@ -6080,14 +6386,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) { - if (conn->pack_eof_check(temp_pack_data)) + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) + { + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6104,7 +6423,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6128,7 +6447,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -6141,7 +6460,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -6161,8 +6480,18 @@ M_MODEL& or_leRandomnumber(T val) } } } + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } - conn_obj->back_select_conn(conn); + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { @@ -6250,26 +6579,36 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + + if (n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; std::vector field_array; - // std::vector> field_value; unsigned char action_setup = 0; unsigned int column_num = 0; @@ -6277,18 +6616,29 @@ M_MODEL& or_leRandomnumber(T val) unsigned int offset = 0; std::vector field_pos; - // std::map other_col; for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6305,7 +6655,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6329,7 +6679,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, data_temp); tempnum = tempnum + name_length; @@ -6342,7 +6692,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -6362,9 +6712,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -6556,25 +6914,29 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -6591,14 +6953,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6615,7 +6990,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6633,7 +7008,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -6664,7 +7039,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } } catch (const std::exception &e) @@ -6733,21 +7118,31 @@ M_MODEL& or_leRandomnumber(T val) { co_return valuetemp; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return valuetemp; + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -6761,14 +7156,26 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return valuetemp; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6785,7 +7192,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6803,7 +7210,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string temp_str; temp_str.resize(name_length); @@ -6834,7 +7241,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } } catch (const std::exception &e) @@ -6895,25 +7312,30 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - conn->send_data.clear(); + if(select_conn->isdebug) + { + select_conn->begin_time(); + } - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = select_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return 0; } @@ -6931,14 +7353,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -6955,7 +7390,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -6976,7 +7411,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -6996,8 +7431,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -7068,22 +7512,31 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = co_await conn_obj->async_get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return 0; + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -7098,14 +7551,26 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return 0; + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return 0; + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -7122,7 +7587,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -7143,7 +7608,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); assign_field_value(field_pos[ij], (unsigned char *)&temp_pack_data.data[tempnum], name_length, B_BASE::data); tempnum = tempnum + name_length; @@ -7163,8 +7628,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } if (iscache) { if (exptime > 0) @@ -7251,35 +7725,52 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); - conn_obj->back_edit_conn(conn); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7289,10 +7780,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7371,35 +7865,50 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); - conn_obj->back_edit_conn(conn); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7409,10 +7918,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7492,29 +8004,49 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -7524,11 +8056,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -7607,28 +8141,48 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7639,11 +8193,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -7688,35 +8244,50 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7726,10 +8297,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7809,35 +8383,49 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7847,10 +8435,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -7931,28 +8522,48 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -7962,10 +8573,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -8011,35 +8625,49 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8049,10 +8677,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8098,28 +8729,48 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8129,10 +8780,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -8216,35 +8871,49 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -8254,10 +8923,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8348,36 +9021,51 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + //auto conn = conn_obj->get_edit_conn(); - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8386,10 +9074,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } catch (const std::exception &e) { @@ -8427,36 +9118,52 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); + //auto conn = conn_obj->get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8465,12 +9172,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8507,29 +9216,50 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8538,12 +9268,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -8580,36 +9312,51 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8618,12 +9365,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8660,43 +9409,65 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); } else if ((unsigned char)temp_pack_data.data[0] == 0x00) { - unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -8733,36 +9504,51 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8770,12 +9556,14 @@ M_MODEL& or_leRandomnumber(T val) else if ((unsigned char)temp_pack_data.data[0] == 0x00) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } catch (const std::exception &e) { @@ -8812,29 +9600,50 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8843,12 +9652,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -8916,36 +9727,50 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -8954,10 +9779,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return effect_num; } else { @@ -8966,36 +9795,51 @@ M_MODEL& or_leRandomnumber(T val) { return 0; } - auto conn = conn_obj->get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + //auto conn = conn_obj->get_edit_conn(); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = conn_obj->get_edit_conn(); + } + } + else + { + edit_conn = conn_obj->get_edit_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(edit_conn->isdebug) { - error_msg = conn->ec.message(); - iserror = true; + edit_conn->begin_time(); + } + std::size_t n = edit_conn->write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); return 0; } unsigned int offset = 0; - n = conn->read_loop(); - + n = edit_conn->read_loop(); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); - + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9004,12 +9848,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + return insert_last_id; } return 0; } @@ -9068,28 +9914,48 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } if ((unsigned char)temp_pack_data.data[0] == 0xFF) { @@ -9100,11 +9966,13 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return effect_num; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return effect_num; } catch (const std::exception &e) { @@ -9130,29 +9998,49 @@ M_MODEL& or_leRandomnumber(T val) { co_return 0; } - auto conn = co_await conn_obj->async_get_edit_conn(); - - unsigned int querysql_len = sqlstring.length() + 1; + if(islock_conn) + { + if(!edit_conn) + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } + } + else + { + edit_conn = co_await conn_obj->async_get_edit_conn(); + } - conn->send_data.clear(); - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(sqlstring); + if(edit_conn->isdebug) + { + edit_conn->begin_time(); + } + std::size_t n = co_await edit_conn->async_write_sql(sqlstring); + if(n==0) + { + error_msg = edit_conn->error_msg; + edit_conn.reset(); + co_return 0; + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - unsigned int offset = 0; - n = co_await conn->async_read_loop(); - + n = co_await edit_conn->async_read_loop(); + if (n==0) + { + edit_conn.reset(); + co_return 0; + } pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - - conn_obj->back_edit_conn(conn); + edit_conn->read_field_pack(edit_conn->_cache_data, n, offset, temp_pack_data); + if(edit_conn->isdebug) + { + edit_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= edit_conn->count_time(); + conn_mar.push_log(sqlstring,std::to_string(du_time)); + } + long long insert_last_id = 0; if ((unsigned char)temp_pack_data.data[0] == 0xFF) { error_msg = temp_pack_data.data.substr(3); @@ -9161,12 +10049,14 @@ M_MODEL& or_leRandomnumber(T val) { unsigned int d_offset = 1; - effect_num = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - long long insert_last_id= conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); - - co_return insert_last_id; + effect_num = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); + insert_last_id = edit_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], d_offset); } - co_return 0; + if(!islock_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + co_return insert_last_id; } catch (const std::exception &e) { @@ -9187,7 +10077,7 @@ M_MODEL& or_leRandomnumber(T val) std::tuple, std::map, std::vector>> query(const std::string &rawsql) { - + effect_num = 0; std::vector> temprecord; std::vector table_fieldname; std::map table_fieldmap; @@ -9231,25 +10121,28 @@ M_MODEL& or_leRandomnumber(T val) { return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = conn_obj->get_select_conn(); - - unsigned int querysql_len = rawsql.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(rawsql); + //auto conn = conn_obj->get_select_conn(); + if(islock_conn) + { + if(!select_conn) + { + select_conn = conn_obj->get_select_conn(); + } + } + else + { + select_conn = conn_obj->get_select_conn(); + } - std::size_t n = asio::write(*conn->socket, asio::buffer(conn->send_data), conn->ec); - - if(conn->ec) + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = select_conn->write_sql(rawsql); + if(n==0) { - error_msg = conn->ec.message(); - iserror = true; + error_msg = select_conn->error_msg; + select_conn.reset(); return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } @@ -9267,14 +10160,27 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = conn->read_loop(); + n = select_conn->read_loop(); offset = 0; + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -9291,7 +10197,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -9315,7 +10221,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -9337,8 +10243,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(rawsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord)); } catch (const std::exception &e) @@ -9358,7 +10273,7 @@ M_MODEL& or_leRandomnumber(T val) asio::awaitable, std::map, std::vector>>> async_query(const std::string &rawsql) { - + effect_num = 0; std::vector> temprecord; std::vector table_fieldname; std::map table_fieldmap; @@ -9402,22 +10317,30 @@ M_MODEL& or_leRandomnumber(T val) { co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); } - auto conn = co_await conn_obj->async_get_select_conn(); - - unsigned int querysql_len = rawsql.length() + 1; - - conn->send_data.clear(); - - conn->send_data.push_back((querysql_len & 0xFF)); - conn->send_data.push_back((querysql_len >> 8 & 0xFF)); - conn->send_data.push_back((querysql_len >> 16 & 0xFF)); - conn->send_data.push_back(0x00); - conn->send_data.push_back(0x03); - conn->send_data.append(rawsql); + if(islock_conn) + { + if(!select_conn) + { + select_conn = co_await conn_obj->async_get_select_conn(); + } + } + else + { + select_conn = co_await conn_obj->async_get_select_conn(); + } - std::size_t n = co_await asio::async_write(*conn->socket, asio::buffer(conn->send_data), asio::use_awaitable); - - + if(select_conn->isdebug) + { + select_conn->begin_time(); + } + std::size_t n = co_await select_conn->async_write_sql(rawsql); + if(n==0) + { + error_msg = select_conn->error_msg; + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + pack_info_t temp_pack_data; temp_pack_data.seq_id = 1; bool is_sql_item = false; @@ -9432,14 +10355,26 @@ M_MODEL& or_leRandomnumber(T val) for (; is_sql_item == false;) { - n = co_await conn->async_read_loop(); + n = co_await select_conn->async_read_loop(); offset = 0; + if (n==0) + { + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } for (; offset < n;) { - conn->read_field_pack(conn->_cache_data, n, offset, temp_pack_data); - if (temp_pack_data.length == temp_pack_data.current_length) + select_conn->read_field_pack(select_conn->_cache_data, n, offset, temp_pack_data); + if(temp_pack_data.error > 0) + { + iserror = true; + error_msg =temp_pack_data.data; + select_conn.reset(); + co_return std::make_tuple(table_fieldname, table_fieldmap, temprecord); + } + if (temp_pack_data.length == temp_pack_data.current_length && temp_pack_data.current_length > 0) { - if (conn->pack_eof_check(temp_pack_data)) + if (select_conn->pack_eof_check(temp_pack_data)) { is_sql_item = true; break; @@ -9456,7 +10391,7 @@ M_MODEL& or_leRandomnumber(T val) else if (action_setup == 1) { field_info_t temp_filed_col; - conn->read_col_info(temp_pack_data.data, temp_filed_col); + select_conn->read_col_info(temp_pack_data.data, temp_filed_col); field_array.emplace_back(std::move(temp_filed_col)); column_num--; @@ -9480,7 +10415,7 @@ M_MODEL& or_leRandomnumber(T val) for (unsigned int ij = 0; ij < column_num; ij++) { unsigned long long name_length = 0; - name_length = conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); + name_length = select_conn->pack_real_num((unsigned char *)&temp_pack_data.data[0], tempnum); std::string tempstr; tempstr.resize(name_length); std::memcpy(tempstr.data(), (unsigned char *)&temp_pack_data.data[tempnum], name_length); @@ -9502,8 +10437,17 @@ M_MODEL& or_leRandomnumber(T val) } } } - conn_obj->back_select_conn(conn); - + if(select_conn->isdebug) + { + select_conn->finish_time(); + auto &conn_mar = get_orm_connect_mar(); + long long du_time= select_conn->count_time(); + conn_mar.push_log(rawsql,std::to_string(du_time)); + } + if(!islock_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } co_return std::make_tuple(std::move(table_fieldname), std::move(table_fieldmap), std::move(temprecord)); } catch (const std::exception &e) @@ -9542,6 +10486,7 @@ M_MODEL& or_leRandomnumber(T val) ishascontent = false; iscommit = false; iscache = false; + iserror = false; effect_num = 0; if (both) { @@ -9563,6 +10508,7 @@ M_MODEL& or_leRandomnumber(T val) ishascontent = false; iscommit = false; iscache = false; + iserror = false; effect_num = 0; return *mod; } @@ -9598,7 +10544,25 @@ M_MODEL& or_leRandomnumber(T val) iserror = true; return true; } - + void lock_conn() + { + islock_conn = true; + } + void unlock_conn() + { + islock_conn = false; + if (conn_obj) + { + if(select_conn) + { + conn_obj->back_select_conn(std::move(select_conn)); + } + if(edit_conn) + { + conn_obj->back_edit_conn(std::move(edit_conn)); + } + } + } public: std::string selectsql; std::string wheresql; @@ -9616,11 +10580,14 @@ M_MODEL& or_leRandomnumber(T val) bool ishascontent = false; bool iscache = false; bool iserror = false; + bool islock_conn = false; int exptime = 0; unsigned int effect_num = 0; M_MODEL *mod; + std::shared_ptr select_conn; + std::shared_ptr edit_conn; std::shared_ptr conn_obj; }; //} /*tagnamespace_replace*/ diff --git a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h index 93f7c1f14b2..0fee4b832c8 100644 --- a/frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h +++ b/frameworks/C++/paozhu/paozhu_benchmark/orm/include/worldbase.h @@ -2,7 +2,7 @@ #define ORM_DEFAULT_WORLDBASEMATA_H /* *This file is auto create from cli -*本文件为自动生成 Sun, 02 Mar 2025 10:54:30 GMT +*本文件为自动生成 Thu, 13 Mar 2025 08:50:20 GMT ***/ #include #include diff --git a/frameworks/Crystal/lucky/config/server.cr b/frameworks/Crystal/lucky/config/server.cr index 16f458c361c..cdfeda684ef 100644 --- a/frameworks/Crystal/lucky/config/server.cr +++ b/frameworks/Crystal/lucky/config/server.cr @@ -6,7 +6,7 @@ Lucky::Server.configure do |settings| settings.secret_key_base = "u4PWnhZfOFXdTOtoiSBF+6jn0zHbYS6/yumo3WXYNSw" settings.host = "0.0.0.0" settings.port = 8080 - settings.gzip_enabled = true + settings.gzip_enabled = false settings.asset_host = "" end diff --git a/frameworks/Go/echo/src/go.mod b/frameworks/Go/echo/src/go.mod index 04c940547d5..cb54749b3ad 100644 --- a/frameworks/Go/echo/src/go.mod +++ b/frameworks/Go/echo/src/go.mod @@ -1,6 +1,7 @@ module echo/app go 1.22 +toolchain go1.23.7 require ( github.com/jackc/pgx/v5 v5.6.0 @@ -16,9 +17,9 @@ 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.21.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/net v0.36.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect ) diff --git a/frameworks/Go/echo/src/go.sum b/frameworks/Go/echo/src/go.sum index e607732cf1b..cb3bf5a04a1 100644 --- a/frameworks/Go/echo/src/go.sum +++ b/frameworks/Go/echo/src/go.sum @@ -25,25 +25,27 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= 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.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/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= +golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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.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/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/frameworks/Java/helidon/helidon-nima.dockerfile b/frameworks/Java/helidon/helidon-nima.dockerfile index bfe655e52c0..3e34b8b275c 100644 --- a/frameworks/Java/helidon/helidon-nima.dockerfile +++ b/frameworks/Java/helidon/helidon-nima.dockerfile @@ -12,5 +12,6 @@ COPY --from=maven /helidon/target/benchmark-nima.jar app.jar EXPOSE 8080 CMD java -XX:+UseNUMA \ + -server \ -XX:+UseParallelGC \ -jar app.jar diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java index 9526fdce533..956a5ef1ba1 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnection.java @@ -1,8 +1,12 @@ package io.helidon.benchmark.nima.models; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + import io.vertx.pgclient.PgConnection; import io.vertx.sqlclient.PreparedQuery; +import io.vertx.sqlclient.PreparedStatement; import io.vertx.sqlclient.Row; import io.vertx.sqlclient.RowSet; @@ -11,9 +15,9 @@ public class PgClientConnection implements AutoCloseable { private static String SELECT_WORLD = "SELECT id, randomnumber from WORLD where id=$1"; private static String SELECT_FORTUNE = "SELECT * from FORTUNE"; - private PreparedQuery> worldQuery; - private PreparedQuery> fortuneQuery; - private PreparedQuery>[] updateQuery; + private CompletableFuture worldQuery; + private CompletableFuture fortuneQuery; + private CompletableFuture[] updateQuery; private final PgConnection conn; @@ -30,30 +34,28 @@ public void close() { conn.close(); } - public PreparedQuery> worldQuery() { - return worldQuery; + public PreparedQuery> worldQuery() throws ExecutionException, InterruptedException { + return worldQuery.get().query(); } - public PreparedQuery> fortuneQuery() { - return fortuneQuery; + public PreparedQuery> fortuneQuery() throws ExecutionException, InterruptedException { + return fortuneQuery.get().query(); } - public PreparedQuery> updateQuery(int queryCount) { - return updateQuery[queryCount - 1]; + public PreparedQuery> updateQuery(int queryCount) throws ExecutionException, InterruptedException { + return updateQuery[queryCount - 1].get().query(); } @SuppressWarnings("unchecked") void prepare() { try { - worldQuery = conn.prepare(SELECT_WORLD) - .toCompletionStage().toCompletableFuture().get().query(); - fortuneQuery = conn.prepare(SELECT_FORTUNE) - .toCompletionStage().toCompletableFuture().get().query(); - updateQuery = (PreparedQuery>[]) new PreparedQuery[UPDATE_QUERIES]; + worldQuery = conn.prepare(SELECT_WORLD).toCompletionStage().toCompletableFuture(); + fortuneQuery = conn.prepare(SELECT_FORTUNE).toCompletionStage().toCompletableFuture(); + updateQuery = (CompletableFuture[]) new CompletableFuture[UPDATE_QUERIES]; for (int i = 0; i < UPDATE_QUERIES; i++) { updateQuery[i] = conn.prepare(singleUpdate(i + 1)) - .toCompletionStage().toCompletableFuture().get().query(); - } + .toCompletionStage().toCompletableFuture(); + } } catch (Exception e) { throw new RuntimeException(e); } diff --git a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java index 2d142dd13d3..5469941c44c 100644 --- a/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java +++ b/frameworks/Java/helidon/nima/src/main/java/io/helidon/benchmark/nima/models/PgClientConnectionPoolArray.java @@ -1,7 +1,8 @@ package io.helidon.benchmark.nima.models; -import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.logging.Logger; import io.helidon.config.Config; @@ -13,7 +14,7 @@ class PgClientConnectionPoolArray extends PgClientConnectionPool { private final int connections; private final PgClientConnection[] connectionArray; - private final ReentrantLock lock = new ReentrantLock(); + private final ReadWriteLock lock = new ReentrantReadWriteLock(); PgClientConnectionPoolArray(Vertx vertx, PgConnectOptions options, Config config) { super(vertx, options, config); @@ -29,20 +30,23 @@ class PgClientConnectionPoolArray extends PgClientConnectionPool { @Override public PgClientConnection clientConnection() { int index = Thread.currentThread().hashCode() % connections; - PgClientConnection connection = connectionArray[index]; - if (connection == null) { - try { - lock.lock(); - connection = connectionArray[index]; - if (connection == null) { - connection = newConnection(); - connectionArray[index] = connection; + if (connectionArray[index] == null) { + lock.readLock().lock(); + if (connectionArray[index] == null) { + lock.readLock().unlock(); + lock.writeLock().lock(); + try { + if (connectionArray[index] == null) { + connectionArray[index] = newConnection(); + } + } finally { + lock.writeLock().unlock(); } - } finally { - lock.unlock(); + } else { + lock.readLock().unlock(); } } - return connection; + return connectionArray[index]; } @Override diff --git a/frameworks/Java/play1/README.md b/frameworks/Java/play1/README.md deleted file mode 100644 index 7cf95274bd7..00000000000 --- a/frameworks/Java/play1/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Play 1 framework Benchmarking Test - -[Play 1 framework](https://www.playframework.com/) - the high velocity web framework for Java and Scala. This is the old version - it's not Play 2. - -### Test sources - -This is the list: - - * [Plaintext](app/controllers/Application.java#L24) - * [JSON](app/controllers/Application.java#L28) - * [DB](app/controllers/Application.java#L39) - * [Queries](app/controllers/Application.java#L45) - -## Software Versions - -The tests were run with: - - * [Oracle Java 10](https://www.oracle.com/java/) - * [MySQL 5.7](http://www.mysql.com/) - -Please check the versions in the install and build scripts of TFB project. - -## Test URLs - -All implementations use the same URLs. - - * Plaintext - `http://localhost:8080/plaintext` - * JSON - `http://localhost:8080/json` - * DB - `http://localhost:8080/db` - * Queries - `http://localhost:8080/query?queries=` - diff --git a/frameworks/Java/play1/app/controllers/Application.java b/frameworks/Java/play1/app/controllers/Application.java deleted file mode 100644 index f2424d15b15..00000000000 --- a/frameworks/Java/play1/app/controllers/Application.java +++ /dev/null @@ -1,132 +0,0 @@ -package controllers; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ThreadLocalRandom; - -import models.World; -import play.db.jpa.JPAPlugin; -import play.jobs.Job; -import play.libs.F.Promise; -import play.mvc.Controller; - -public class Application extends Controller { - - private static final int TEST_DATABASE_ROWS = 10000; - - public static void index() { - render(); - } - - public static void hello() { - renderText("Hello, world!"); - } - - public static void json() { - Map result = new HashMap(); - result.put("message", "Hello, World!"); - renderJSON(result); - } - - /** - * this version is used in the tests. it is the simplest and fastest. - * - * @param queries - */ - public static void dbSync() { - Long id = Long.valueOf(ThreadLocalRandom.current().nextInt(TEST_DATABASE_ROWS) + 1); - World result = World.findById(id); - renderJSON(result); - } - - public static void dbQueries(int queries) { - if (queries == 0) { - queries = 1; - } else if (queries > 500) { - queries = 500; - } - final List worlds = new ArrayList(); - for (int i = 0; i < queries; ++i) { - Long id = Long.valueOf(ThreadLocalRandom.current().nextInt(TEST_DATABASE_ROWS) + 1); - World result = World.findById(id); - worlds.add(result); - } - renderJSON(worlds); - } - - @play.db.jpa.NoTransaction - public static void setup() { - JPAPlugin plugin = play.Play.plugin(JPAPlugin.class); - plugin.startTx(true); - - // clean out the old - World.deleteAll(); - System.out.println("DELETED"); - // in with the new - for (long i = 0; i <= TEST_DATABASE_ROWS; i++) { - int randomNumber = ThreadLocalRandom.current().nextInt(TEST_DATABASE_ROWS) + 1; - new World(i, randomNumber).save(); - if (i % 100 == 0) { - - World.em().flush(); - World.em().clear(); - System.out.println("FLUSHED : " + i + "/" + TEST_DATABASE_ROWS); - - } - } - System.out.println("ADDED"); - plugin.closeTx(false); - } - - /** - * note this is method is much slower than the synchronous version - */ - public static void dbAsyncEachQuery(int queries) - throws InterruptedException, ExecutionException { - if (queries == 0) - queries = 1; - final int queryCount = queries; - List> promises = new ArrayList>(); - for (int i = 0; i < queryCount; ++i) { - final Long id = Long - .valueOf(ThreadLocalRandom.current().nextInt(TEST_DATABASE_ROWS) + 1); - Job job = new Job() { - public World doJobWithResult() throws Exception { - World result = World.findById(id); - return result; - }; - }; - promises.add(job.now()); - } - List result = await(Promise.waitAll(promises)); - renderJSON(result); - } - - /** - * note this is method is a bit slower than the synchronous version - */ - public static void dbAsyncAllQueries(int queries) - throws InterruptedException, ExecutionException { - if (queries == 0) - queries = 1; - final int queryCount = queries; - final List worlds = new ArrayList(); - Job> job = new Job>() { - public java.util.List doJobWithResult() throws Exception { - for (int i = 0; i < queryCount; ++i) { - Long id = Long - .valueOf(ThreadLocalRandom.current().nextInt(TEST_DATABASE_ROWS) + 1); - World result = World.findById(id); - worlds.add(result); - } - return worlds; - }; - }; - List result = job.now().get(); - renderJSON(result); - } - -} diff --git a/frameworks/Java/play1/app/models/World.java b/frameworks/Java/play1/app/models/World.java deleted file mode 100644 index c1337dd9c6c..00000000000 --- a/frameworks/Java/play1/app/models/World.java +++ /dev/null @@ -1,30 +0,0 @@ -package models; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; - -import play.db.jpa.GenericModel; -import play.db.jpa.Model; - -import com.google.gson.annotations.SerializedName; - -/** - * use a generic model as we want to explicitly define the id - * - * @author tom - * - */ -@Entity -public class World extends GenericModel { - - public World(long i, long number) { - id = i; - randomNumber = number ; - } - - @Id - public Long id; - - public Long randomNumber; -} \ No newline at end of file diff --git a/frameworks/Java/play1/app/views/Application/index.html b/frameworks/Java/play1/app/views/Application/index.html deleted file mode 100644 index c614df6bffb..00000000000 --- a/frameworks/Java/play1/app/views/Application/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/frameworks/Java/play1/app/views/errors/404.html b/frameworks/Java/play1/app/views/errors/404.html deleted file mode 100644 index eb0b00e5421..00000000000 --- a/frameworks/Java/play1/app/views/errors/404.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Not found - - - - #{if play.mode.name() == 'DEV'} - #{404 result /} - #{/if} - #{else} -

Not found

-

- ${result.message} -

- #{/else} - - diff --git a/frameworks/Java/play1/app/views/errors/500.html b/frameworks/Java/play1/app/views/errors/500.html deleted file mode 100644 index a898cb77e48..00000000000 --- a/frameworks/Java/play1/app/views/errors/500.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Application error - - - - #{if play.mode.name() == 'DEV'} - #{500 exception /} - #{/if} - #{else} -

Oops, an error occured

- #{if exception instanceof play.exceptions.PlayException} -

- This exception has been logged with id ${exception.id}. -

- #{/if} - #{/else} - - diff --git a/frameworks/Java/play1/app/views/main.html b/frameworks/Java/play1/app/views/main.html deleted file mode 100644 index 92e03f87d7a..00000000000 --- a/frameworks/Java/play1/app/views/main.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - #{get 'title' /} - - - #{get 'moreStyles' /} - - - #{get 'moreScripts' /} - - - #{doLayout /} - - diff --git a/frameworks/Java/play1/benchmark_config.json b/frameworks/Java/play1/benchmark_config.json deleted file mode 100644 index dddee2bca86..00000000000 --- a/frameworks/Java/play1/benchmark_config.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "framework": "play1", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "query_url": "/query?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "MySQL", - "framework": "play1", - "language": "Java", - "flavor": "None", - "orm": "Full", - "platform": "Netty", - "webserver": "None", - "os": "Linux", - "database_os": "Linux", - "display_name": "play1", - "notes": "", - "versus": "netty" - } - }] -} diff --git a/frameworks/Java/play1/conf/application.conf b/frameworks/Java/play1/conf/application.conf deleted file mode 100644 index 02d35c1cde6..00000000000 --- a/frameworks/Java/play1/conf/application.conf +++ /dev/null @@ -1,236 +0,0 @@ -# This is the main configuration file for the application. -# ~~~~~ -application.name=play-1.2.5 - -# Application mode -# ~~~~~ -# Set to dev to enable instant reloading and other development help. -# Otherwise set to prod. -application.mode=dev -%prod.application.mode=prod - -# Secret key -# ~~~~~ -# The secret key is used to secure cryptographics functions -# If you deploy your application to several instances be sure to use the same key ! -application.secret=p7Abj8rpexZmmC8iPsY2PlXSo1xtHFhLKHRCHpE1ZqEgRU5TIHPcEbaryoj16vi8 - -# i18n -# ~~~~~ -# Define locales used by your application. -# You can then place localized messages in conf/messages.{locale} files -# application.langs=fr,en,ja - -# Date format -# ~~~~~ -date.format=yyyy-MM-dd -# date.format.fr=dd/MM/yyyy - -# Server configuration -# ~~~~~ -# If you need to change the HTTP port, uncomment this (default is set to 9000) -# http.port=9000 - -#modified to match previous port on test -http.port=8080 - -# -# By default the server listen for HTTP on the wilcard address. -# You can restrict this. -# http.address=127.0.0.1 -# -# Use this if you don't host your Play application at the root of the domain -# you're serving it from. This parameter has no effect when deployed as a -# war, because the path will be handled by the application server. -# http.path=/ - -# Session configuration -# ~~~~~~~~~~~~~~~~~~~~~~ -# By default, session will be written to the transient PLAY_SESSION cookie. -# The cookies are not secured by default, only set it to true -# if you're serving your pages through https. -# application.session.cookie=PLAY -# application.session.maxAge=1h -# application.session.secure=false - -# Session/Cookie sharing between subdomain -# ~~~~~~~~~~~~~~~~~~~~~~ -# By default a cookie is only valid for a specific domain. By setting -# application.defaultCookieDomain to '.example.com', the cookies -# will be valid for all domains ending with '.example.com', ie: -# foo.example.com and bar.example.com -# application.defaultCookieDomain=.example.com - -# JVM configuration -# ~~~~~ -# Define which port is used by JPDA when application is in debug mode (default is set to 8000) -# jpda.port=8000 -# -# Java source level => 1.5, 1.6 or 1.7 (experimental) -# java.source=1.5 - -# Log level -# ~~~~~ -# Specify log level for your application. -# If you want a very customized log, create a log4j.properties file in the conf directory -# application.log=INFO -# -# More logging configuration -# application.log.path=/log4j.properties -# application.log.system.out=off - -# Database configuration -# ~~~~~ -# Enable a database engine if needed. -# -# To quickly set up a development database, use either: -# - mem : for a transient in memory database (H2 in memory) -# - fs : for a simple file written database (H2 file stored) -# db=mem -# -# To connect to a local MySQL5 database, use: -# db=mysql://user:pwd@host/database -# -# To connect to a local PostgreSQL9 database, use: -# db=postgres://user:pwd@host/database -# -# If you need a full JDBC configuration use the following : -# db.url=jdbc:postgresql:database_name -# db.driver=org.postgresql.Driver -# db.user=root -# db.pass=secret -# -# Connections pool configuration : -db.pool.timeout=1000 -db.pool.maxSize=30 -db.pool.minSize=10 - - -# -# If you want to reuse an existing Datasource from your application server, use: -# db=java:/comp/env/jdbc/myDatasource -# -# When using an existing Datasource, it's sometimes needed to destroy it when -# the application is stopped. Depending on the datasource, you can define a -# generic "destroy" method : -# db.destroyMethod=close -db.driver= com.mysql.jdbc.Driver -db.url=jdbc:mysql://tfb-database:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true&useSSL=false -#db.url=jdbc:mysql://tfb-database:3306/hello_world -db.user=benchmarkdbuser -db.pass=benchmarkdbpass -#db.jndiName=DefaultDS - -#db.default.driver= com.mysql.jdbc.Driver -#db.default.url=jdbc:mysql://tfb-database:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true -#db.default.user=benchmarkdbuser -#db.default.pass=benchmarkdbpass -#db.default.jndiName=DefaultDS - - -# JPA Configuration (Hibernate) -# ~~~~~ -# -# Specify the custom JPA dialect to use here (default to guess): -# jpa.dialect=org.hibernate.dialect.PostgreSQLDialect -# -# Specify the ddl generation pattern to use. Set to none to disable it -# (default to update in DEV mode, and none in PROD mode): -# jpa.ddl=update -# -# Debug SQL statements (logged using DEBUG level): -# jpa.debugSQL=true -# -# You can even specify additional hibernate properties here: -# hibernate.use_sql_comments=true -# ... -# -# Store path for Blob content -attachments.path=data/attachments - -# Memcached configuration -# ~~~~~ -# Enable memcached if needed. Otherwise a local cache is used. -# memcached=enabled -# -# Specify memcached host (default to 127.0.0.1:11211) -# memcached.host=127.0.0.1:11211 -# -# Or you can specify multiple host to build a distributed cache -# memcached.1.host=127.0.0.1:11211 -# memcached.2.host=127.0.0.1:11212 -# -# Use plain SASL to authenticate for memcached -# memcached.user= -# memcached.password= - -# HTTP Response headers control for static files -# ~~~~~ -# Set the default max-age, telling the user's browser how long it should cache the page. -# Default is 3600 (one hour). Set it to 0 to send no-cache. -# This is only read in prod mode, in dev mode the cache is disabled. -# http.cacheControl=3600 - -# If enabled, Play will generate entity tags automatically and send a 304 when needed. -# Default is true, set it to false to deactivate use of entity tags. -# http.useETag=true - -# Custom mime types -# mimetype.xpi=application/x-xpinstall - -# WS configuration -# ~~~~~ -# Default engine is Async Http Client, uncomment to use -# the JDK's internal implementation -# webservice = urlfetch -# If you need to set proxy params for WS requests -# http.proxyHost = localhost -# http.proxyPort = 3128 -# http.proxyUser = jojo -# http.proxyPassword = jojo - -# Mail configuration -# ~~~~~ -# Default is to use a mock Mailer -mail.smtp=mock - -# Or, specify mail host configuration -# mail.smtp.host=127.0.0.1 -# mail.smtp.user=admin -# mail.smtp.pass= -# mail.smtp.channel=ssl - -# Url-resolving in Jobs -# ~~~~~~ -# When rendering templates with reverse-url-resoling (@@{..}) in Jobs (which do not have an inbound Http.Request), -# ie if sending a HtmlMail, Play need to know which url your users use when accessing your app. -# %test.application.baseUrl=http://localhost:9000/ -# %prod.application.baseUrl=http://www.yourdomain.com/ - -# Jobs executor -# ~~~~~~ -# Size of the Jobs pool -# play.jobs.pool=10 - - -# Execution pool -# ~~~~~ -# Default to 1 thread in DEV mode or (nb processors + 1) threads in PROD mode. -# Try to keep a low as possible. 1 thread will serialize all requests (very useful for debugging purpose) -# play.pool=3 - -# Open file from errors pages -# ~~~~~ -# If your text editor supports opening files by URL, Play! will -# dynamically link error pages to files -# -# Example, for textmate: -# play.editor=txmt://open?url=file://%s&line=%s - -# Testing. Set up a custom configuration for test mode -# ~~~~~ -#%test.module.cobertura=${play.path}/modules/cobertura -%test.application.mode=dev -%test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0 -%test.jpa.ddl=create -%test.mail.smtp=mock diff --git a/frameworks/Java/play1/conf/dependencies.yml b/frameworks/Java/play1/conf/dependencies.yml deleted file mode 100644 index d86de2e46ea..00000000000 --- a/frameworks/Java/play1/conf/dependencies.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Application dependencies - -require: - - play \ No newline at end of file diff --git a/frameworks/Java/play1/conf/messages b/frameworks/Java/play1/conf/messages deleted file mode 100644 index b51f29459d1..00000000000 --- a/frameworks/Java/play1/conf/messages +++ /dev/null @@ -1,3 +0,0 @@ -# You can specialize this file for each language. -# For example, for French create a messages.fr file -# diff --git a/frameworks/Java/play1/conf/routes b/frameworks/Java/play1/conf/routes deleted file mode 100644 index 5f33cf52b6c..00000000000 --- a/frameworks/Java/play1/conf/routes +++ /dev/null @@ -1,15 +0,0 @@ -# Routes -# This file defines all application routes (Higher priority routes first) -# ~~~~ - - -# Home page -GET /json Application.json -GET /db Application.dbSync -GET /query Application.dbQueries -GET /plaintext Application.hello -GET /db2 Application.dbAsyncAllQueries -GET /db3 Application.dbAsyncEachQuery -GET /setup Application.setup -GET / Application.index - diff --git a/frameworks/Java/play1/config.toml b/frameworks/Java/play1/config.toml deleted file mode 100644 index 7e774fff5de..00000000000 --- a/frameworks/Java/play1/config.toml +++ /dev/null @@ -1,17 +0,0 @@ -[framework] -name = "play1" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -urls.db = "/db" -urls.query = "/query?queries=" -approach = "Realistic" -classification = "Fullstack" -database = "MySQL" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "Netty" -webserver = "None" -versus = "netty" diff --git a/frameworks/Java/play1/play1.dockerfile b/frameworks/Java/play1/play1.dockerfile deleted file mode 100644 index 090a8ff77a5..00000000000 --- a/frameworks/Java/play1/play1.dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM openjdk:10-jdk -WORKDIR /play1 -COPY app app -COPY conf conf -COPY public public -COPY test test -RUN wget -nv https://downloads.typesafe.com/play/1.5.2/play-1.5.2.zip -RUN unzip -q play-1.5.2.zip -RUN apt-get install -yqq python - -EXPOSE 8080 - -CMD ["play-1.5.2/play", "run", "--%prod"] diff --git a/frameworks/Java/play1/public/images/favicon.png b/frameworks/Java/play1/public/images/favicon.png deleted file mode 100644 index c7d92d2ae47..00000000000 Binary files a/frameworks/Java/play1/public/images/favicon.png and /dev/null differ diff --git a/frameworks/Java/play1/public/javascripts/jquery-1.6.4.min.js b/frameworks/Java/play1/public/javascripts/jquery-1.6.4.min.js deleted file mode 100644 index 628ed9b3160..00000000000 --- a/frameworks/Java/play1/public/javascripts/jquery-1.6.4.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/frameworks/Java/play1/public/stylesheets/main.css b/frameworks/Java/play1/public/stylesheets/main.css deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/frameworks/Java/play1/test/Application.test.html b/frameworks/Java/play1/test/Application.test.html deleted file mode 100644 index 2b0ad094b67..00000000000 --- a/frameworks/Java/play1/test/Application.test.html +++ /dev/null @@ -1,7 +0,0 @@ -*{ You can use plain selenium command using the selenium tag }* - -#{selenium} - // Open the home page, and check that no error occured - open('/') - assertNotTitle('Application error') -#{/selenium} \ No newline at end of file diff --git a/frameworks/Java/play1/test/ApplicationTest.java b/frameworks/Java/play1/test/ApplicationTest.java deleted file mode 100644 index f1501cbbdba..00000000000 --- a/frameworks/Java/play1/test/ApplicationTest.java +++ /dev/null @@ -1,17 +0,0 @@ -import org.junit.*; -import play.test.*; -import play.mvc.*; -import play.mvc.Http.*; -import models.*; - -public class ApplicationTest extends FunctionalTest { - - @Test - public void testThatIndexPageWorks() { - Response response = GET("/"); - assertIsOk(response); - assertContentType("text/html", response); - assertCharset(play.Play.defaultWebEncoding, response); - } - -} \ No newline at end of file diff --git a/frameworks/Java/play1/test/BasicTest.java b/frameworks/Java/play1/test/BasicTest.java deleted file mode 100644 index d039860fa30..00000000000 --- a/frameworks/Java/play1/test/BasicTest.java +++ /dev/null @@ -1,13 +0,0 @@ -import org.junit.*; -import java.util.*; -import play.test.*; -import models.*; - -public class BasicTest extends UnitTest { - - @Test - public void aVeryImportantThingToTest() { - assertEquals(2, 1 + 1); - } - -} diff --git a/frameworks/Java/play1/test/data.yml b/frameworks/Java/play1/test/data.yml deleted file mode 100644 index 77b04bb14b2..00000000000 --- a/frameworks/Java/play1/test/data.yml +++ /dev/null @@ -1,7 +0,0 @@ -# you describe your data using the YAML notation here -# and then load them using Fixtures.load("data.yml") - -# User(bob): -# email: bob@gmail.com -# password: secret -# fullname: Bob \ No newline at end of file diff --git a/frameworks/Java/redkale/pom-jdbc.xml b/frameworks/Java/redkale/pom-jdbc.xml index 86b6c6d5fd6..8483c39801d 100644 --- a/frameworks/Java/redkale/pom-jdbc.xml +++ b/frameworks/Java/redkale/pom-jdbc.xml @@ -7,8 +7,8 @@ org.redkale.boot.Application - 2.8.0-SNAPSHOT - 1.2.0-SNAPSHOT + 2.8.1-SNAPSHOT + 1.2.0 42.7.2 UTF-8 21 diff --git a/frameworks/Java/redkale/pom-pgclient.xml b/frameworks/Java/redkale/pom-pgclient.xml index 47f212a3053..10ee48261f9 100644 --- a/frameworks/Java/redkale/pom-pgclient.xml +++ b/frameworks/Java/redkale/pom-pgclient.xml @@ -7,8 +7,8 @@ org.redkale.boot.Application - 2.8.0-SNAPSHOT - 1.2.0-SNAPSHOT + 2.8.1-SNAPSHOT + 1.2.0 4.5.8 2.1 UTF-8 diff --git a/frameworks/Java/redkale/pom.xml b/frameworks/Java/redkale/pom.xml index 3c7970fb4e3..c8ef3afb031 100644 --- a/frameworks/Java/redkale/pom.xml +++ b/frameworks/Java/redkale/pom.xml @@ -7,8 +7,8 @@ org.redkale.boot.Application - 2.8.0-SNAPSHOT - 1.2.0-SNAPSHOT + 2.8.1-SNAPSHOT + 1.2.0 UTF-8 21 21 diff --git a/frameworks/Java/tio-boot/pom.xml b/frameworks/Java/tio-boot/pom.xml index 668d7ea5c01..d72bc47bb04 100644 --- a/frameworks/Java/tio-boot/pom.xml +++ b/frameworks/Java/tio-boot/pom.xml @@ -11,7 +11,8 @@ 1.8 ${java.version} ${java.version} - 1.9.1 + 1.9.3 + com.litongjava.tio.http.server.MainApp @@ -25,7 +26,8 @@ com.litongjava java-db - 1.4.9 + 1.5.0 + junit diff --git a/frameworks/Java/tio-http-server/pom.xml b/frameworks/Java/tio-http-server/pom.xml index 080b11956ff..f6fc4055259 100644 --- a/frameworks/Java/tio-http-server/pom.xml +++ b/frameworks/Java/tio-http-server/pom.xml @@ -1,4 +1,6 @@ - + 4.0.0 com.litongjava tio-http-server-benchmark @@ -17,11 +19,16 @@ com.litongjava tio-http-server 3.7.3.v20250301-RELEASE + + + com.litongjava + tio-core + 3.7.3.v20250305-RELEASE com.litongjava java-db - 1.4.9 + 1.5.0 junit diff --git a/frameworks/JavaScript/aroma.js/README.md b/frameworks/JavaScript/aroma.js/README.md new file mode 100644 index 00000000000..927f8006851 --- /dev/null +++ b/frameworks/JavaScript/aroma.js/README.md @@ -0,0 +1,27 @@ +# Aroma.js Benchmarking Test + +From [aroma.js.org](https://aroma.js.org): + +> Aroma.js is a lightweight, feature-rich, and developer-friendly web framework designed to build modern web applications with ease. It provides essential features like routing, middleware, session management, cookie handling, template rendering, static file serving, and more. With its simple API, it enables rapid development of web applications with flexibility. + +### Test Type Implementation Source Code + +- [JSON](app.js) +- [PLAINTEXT](app.js) + +## Important Libraries + +The tests were run with: + +- [Aroma.js](https://aroma.js.org/) +- [NodeJS](https://nodejs.org/en/) + +## Test URLs + +### JSON + +http://localhost:8080/json + +### PLAINTEXT + +http://localhost:8080/plaintext diff --git a/frameworks/JavaScript/aroma.js/app.js b/frameworks/JavaScript/aroma.js/app.js new file mode 100644 index 00000000000..414af881bfa --- /dev/null +++ b/frameworks/JavaScript/aroma.js/app.js @@ -0,0 +1,36 @@ + +const cluster = require('cluster'), + numCPUs = require('os').cpus().length, + Aroma = require('aroma.js'); + + +if (cluster.isPrimary) { + console.log(`Primary ${process.pid} is running`); + + for (let i = 0; i < numCPUs; i++) { + cluster.fork(); + } + + cluster.on('exit', (worker, code, signal) => { + console.log(`worker ${worker.process.pid} died`); + }); +} else { + const app = module.exports = new Aroma(); + + app.parseUrlEncoded(); + + app.use((req, res, next) => { + res.setHeader("Server", "Aroma.js"); + return next(); + }); + + app.get('/json', (req, res) => res.send({ message: 'Hello, World!' })); + + app.get('/plaintext', (req, res) => { + res.setHeader('Content-Type', 'text/plain'); + res.send('Hello, World!'); + }); + + + app.listen(8080); +} diff --git a/frameworks/JavaScript/aroma.js/aroma.js.dockerfile b/frameworks/JavaScript/aroma.js/aroma.js.dockerfile new file mode 100644 index 00000000000..ec726dd2800 --- /dev/null +++ b/frameworks/JavaScript/aroma.js/aroma.js.dockerfile @@ -0,0 +1,11 @@ +FROM node:20.16-slim + +COPY ./ ./ + +RUN npm install + +ENV NODE_ENV production + +EXPOSE 8080 + +CMD ["node", "app.js"] diff --git a/frameworks/JavaScript/aroma.js/benchmark_config.json b/frameworks/JavaScript/aroma.js/benchmark_config.json new file mode 100644 index 00000000000..5d5a3fdaa62 --- /dev/null +++ b/frameworks/JavaScript/aroma.js/benchmark_config.json @@ -0,0 +1,21 @@ +{ + "framework": "aroma.js", + "tests": [{ + "default": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "framework": "aroma.js", + "language": "JavaScript", + "flavor": "NodeJS", + "platform": "nodejs", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "aroma.js", + "versus": "nodejs" + } + }] + } \ No newline at end of file diff --git a/frameworks/C++/cuehttp/config.toml b/frameworks/JavaScript/aroma.js/config.toml similarity index 52% rename from frameworks/C++/cuehttp/config.toml rename to frameworks/JavaScript/aroma.js/config.toml index c9eb86399f0..b7c4320a60c 100644 --- a/frameworks/C++/cuehttp/config.toml +++ b/frameworks/JavaScript/aroma.js/config.toml @@ -1,14 +1,13 @@ [framework] -name = "cuehttp" +name = "aroma.js" [main] urls.plaintext = "/plaintext" +urls.json = "/json" approach = "Realistic" -classification = "Fullstack" -database = "None" +classification = "Micro" database_os = "Linux" os = "Linux" -orm = "None" -platform = "None" +platform = "nodejs" webserver = "None" -versus = "cuehttp" +versus = "nodejs" diff --git a/frameworks/JavaScript/aroma.js/package.json b/frameworks/JavaScript/aroma.js/package.json new file mode 100644 index 00000000000..4f9d2856a44 --- /dev/null +++ b/frameworks/JavaScript/aroma.js/package.json @@ -0,0 +1,8 @@ +{ + "name": "aroma.js", + "dependencies": { + "aroma.js": "1.0.8" + }, + "main": "app.js" + } + \ No newline at end of file diff --git a/frameworks/Lua/luxure/README.md b/frameworks/Lua/luxure/README.md deleted file mode 100755 index 5518b909a56..00000000000 --- a/frameworks/Lua/luxure/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Luxure Benchmarking Test - -### Test Type Implementation Source Code - -* [JSON](./server.lua) -* [PLAINTEXT](./server.lua) - -## Important Libraries -The tests were run with: -* [luasocket](https://www.github.com/lunarmodules/luasocket) -* [cosock](https://www.github.com/cosock/cosock) -* [luncheon](https://www.github.com/cosock/luncheon) -* [dkjson](https://github.com/LuaDist/dkjson) - -## Test URLs -### JSON - -http://localhost:8080/json - -### PLAINTEXT - -http://localhost:8080/plaintext diff --git a/frameworks/Lua/luxure/luxure.dockerfile b/frameworks/Lua/luxure/luxure.dockerfile deleted file mode 100644 index b509fa37309..00000000000 --- a/frameworks/Lua/luxure/luxure.dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ubuntu:22.04 - -COPY ./server.lua / - -RUN DEBIAN_FRONTEND=noninteractiv \ - apt-get update \ - && apt-get install -y \ - build-essential \ - libreadline-dev \ - unzip \ - curl \ - wget \ - libssl-dev \ - && curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz \ - && tar -zxf lua-5.3.5.tar.gz \ - && cd lua-5.3.5 \ - && make linux test \ - && make install \ - && cd .. \ - && rm -rf lua-5.3.5 \ - && rm ./lua-5.3.5.tar.gz \ - && wget https://luarocks.org/releases/luarocks-3.8.0.tar.gz \ - && tar zxpf luarocks-3.8.0.tar.gz \ - && cd luarocks-3.8.0 \ - && ./configure --with-lua-include=/usr/local/include \ - && make \ - && make install \ - && cd .. \ - && rm -rf ./luarocks-3.8.0 \ - && rm luarocks-3.8.0.tar.gz \ - && luarocks install luxure \ - && luarocks install dkjson - -EXPOSE 8080 - -CMD lua /server.lua diff --git a/frameworks/Lua/luxure/server.lua b/frameworks/Lua/luxure/server.lua deleted file mode 100644 index e9a6fe106d8..00000000000 --- a/frameworks/Lua/luxure/server.lua +++ /dev/null @@ -1,22 +0,0 @@ -local lux = require "luxure" -local dkjson = require "dkjson" -local server = lux.Server.new() - -server:use(function(req, res, next) - res:add_header("server", "luxure") - res:add_header("date", os.date("!%a, %d %b %Y %X GMT")) - next(req, res) -end) - -server:get("/json", function(req, res) - res:add_header("content-type", "application/json") - res:send(dkjson.encode({ message = "Hello, World!" })) -end) - -server:get("/plaintext", function(req,res) - res:add_header("content-type", "text/plain") - res:send("Hello, World!") -end) - -server:listen(8080) -server:run() diff --git a/frameworks/Python/crax/README.md b/frameworks/Python/crax/README.md deleted file mode 100644 index ffb69935b57..00000000000 --- a/frameworks/Python/crax/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# [Crax](https://crax.wiki/) Benchmark Test - -This is the Crax portion of a [benchmarking tests suite](../../) -comparing a variety of web development platforms. - -The information below is specific to Crax. For further guidance, -review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). -Also note that there is additional information provided in -the [Python README](../). - -## Description - -[Crax](https://github.com/crax-framework/crax) is a framework or a pack of tools for web development. - -## Test Paths & Sources - -All of the test implementations are located within a single file ([app.py](hello/app.py)). - -## Resources - -* [Crax on GitHub](https://github.com/crax-framework/crax) -* [Crax Wiki](https://crax.wiki/) diff --git a/frameworks/Python/crax/benchmark_config.json b/frameworks/Python/crax/benchmark_config.json deleted file mode 100644 index a461cd62fab..00000000000 --- a/frameworks/Python/crax/benchmark_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "framework": "crax", - "tests": [{ - "default": { - "json_url": "/json", - "fortune_url": "/fortunes", - "plaintext_url": "/plaintext", - "db_url": "/db", - "query_url": "/queries?queries=", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "micro", - "framework": "crax", - "language": "Python", - "flavor": "Python3", - "platform": "None", - "webserver": "None", - "os": "Linux", - "orm": "Raw", - "database_os": "Linux", - "database": "Postgres", - "display_name": "Crax", - "notes": "" - } - }] -} \ No newline at end of file diff --git a/frameworks/Python/crax/config.toml b/frameworks/Python/crax/config.toml deleted file mode 100644 index b640dfaac07..00000000000 --- a/frameworks/Python/crax/config.toml +++ /dev/null @@ -1,19 +0,0 @@ -[framework] -name = "crax" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "micro" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "None" -versus = "None" diff --git a/frameworks/Python/crax/crax.dockerfile b/frameworks/Python/crax/crax.dockerfile deleted file mode 100644 index 4b33e3a0fb6..00000000000 --- a/frameworks/Python/crax/crax.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.8 - -ADD ./ /crax - -WORKDIR /crax - -RUN pip3 install cython==0.29.13 && \ - pip3 install -r /crax/requirements.txt - -EXPOSE 8080 - -CMD gunicorn hello.app:app -k uvicorn.workers.UvicornWorker -c crax_conf.py \ No newline at end of file diff --git a/frameworks/Python/crax/crax_conf.py b/frameworks/Python/crax/crax_conf.py deleted file mode 100644 index 042c7445e6d..00000000000 --- a/frameworks/Python/crax/crax_conf.py +++ /dev/null @@ -1,14 +0,0 @@ -import multiprocessing -import os - -_is_travis = os.environ.get('TRAVIS') == 'true' - -workers = multiprocessing.cpu_count() -if _is_travis: - workers = 2 - -bind = "0.0.0.0:8080" -keepalive = 120 -errorlog = '-' -pidfile = '/tmp/crax.pid' -loglevel = 'error' diff --git a/frameworks/Python/crax/hello/__init__.py b/frameworks/Python/crax/hello/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/frameworks/Python/crax/hello/app.py b/frameworks/Python/crax/hello/app.py deleted file mode 100644 index 718489d18a1..00000000000 --- a/frameworks/Python/crax/hello/app.py +++ /dev/null @@ -1,90 +0,0 @@ -import os -from operator import itemgetter -from random import randint -import asyncpg -from crax import Crax -from crax.response_types import BaseResponse, JSONResponse -from crax.urls import Route, Url -from crax.views import JSONView, TemplateView - -READ_ROW_SQL = 'SELECT "id", "randomnumber" FROM "world" WHERE id = $1' -WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"=$1 WHERE id=$2' - - -async def setup_database(): - global connection_pool - connection_pool = await asyncpg.create_pool( - user=os.getenv('PGUSER', 'benchmarkdbuser'), - password=os.getenv('PGPASS', 'benchmarkdbpass'), - database='hello_world', - host='tfb-database', - port=5432 - ) - - -def get_num_queries(request): - try: - query_count = int(request.query["queries"][0]) - except (KeyError, IndexError, ValueError): - return 1 - if query_count < 1: - return 1 - if query_count > 500: - return 500 - return query_count - - -class TestSingleQuery(JSONView): - async def get(self): - row_id = randint(1, 10000) - async with connection_pool.acquire() as connection: - if self.request.path == '/db': - res = await connection.fetchval(READ_ROW_SQL, row_id) - self.context = {'id': row_id, 'randomNumber': res} - - -class TestMultiQueries(JSONView): - async def get(self): - row_ids = [randint(1, 10000) for _ in range(get_num_queries(self.request))] - worlds = [] - async with connection_pool.acquire() as connection: - statement = await connection.prepare(READ_ROW_SQL) - for row_id in row_ids: - number = await statement.fetchval(row_id) - worlds.append({'id': row_id, 'randomNumber': number}) - self.context = worlds - - -class TestUpdates(JSONView): - async def get(self): - updates = [(randint(1, 10000), randint(1, 10000)) for _ in range(get_num_queries(self.request))] - worlds = [{'id': row_id, 'randomNumber': number} for row_id, number in updates] - async with connection_pool.acquire() as connection: - statement = await connection.prepare(READ_ROW_SQL) - for row_id, number in updates: - await statement.fetchval(row_id) - await connection.executemany(WRITE_ROW_SQL, updates) - self.context = worlds - - -class TestSingleFortunes(TemplateView): - template = "fortune.html" - - async def get(self): - async with connection_pool.acquire() as connection: - fortunes = await connection.fetch('SELECT * FROM Fortune') - fortunes.append([0, 'Additional fortune added at request time.']) - fortunes.sort(key=itemgetter(1)) - self.context["fortunes"] = fortunes - - -APPLICATIONS = ["hello"] -URL_PATTERNS = [ - Route(Url('/json'), JSONResponse(None, {'message': 'Hello, world!'})), - Route(Url('/plaintext'), BaseResponse(None, b'Hello, world!')), - Route(Url('/db'), TestSingleQuery), - Route(Url('/queries'), TestMultiQueries), - Route(Url('/updates'), TestUpdates), - Route(Url('/fortunes'), TestSingleFortunes) -] -app = Crax('hello.app', debug=True, on_startup=setup_database) diff --git a/frameworks/Python/crax/hello/templates/fortune.html b/frameworks/Python/crax/hello/templates/fortune.html deleted file mode 100644 index 4f0b3db447c..00000000000 --- a/frameworks/Python/crax/hello/templates/fortune.html +++ /dev/null @@ -1,10 +0,0 @@ - - -Fortunes - - - -{% for fortune in fortunes %} -{% endfor %}
idmessage
{{ fortune[0] }}{{ fortune[1]|e }}
- - \ No newline at end of file diff --git a/frameworks/Python/crax/requirements.txt b/frameworks/Python/crax/requirements.txt deleted file mode 100644 index 714d2fb4f27..00000000000 --- a/frameworks/Python/crax/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -crax[postgresql]==0.1.5 -gunicorn==20.1.0 -uvloop==0.17.0 -uvicorn==0.20.0 -httptools==0.5.0 diff --git a/frameworks/Python/flask/requirements.txt b/frameworks/Python/flask/requirements.txt index eb63cf6086d..bbd623a8f9d 100644 --- a/frameworks/Python/flask/requirements.txt +++ b/frameworks/Python/flask/requirements.txt @@ -10,3 +10,4 @@ Jinja2==3.1.4 MarkupSafe==2.1.2 ujson==5.4.0 orjson==3.8.7; implementation_name=='cpython' +Werkzeug==2.3.8 diff --git a/frameworks/Python/hug/README.md b/frameworks/Python/hug/README.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/frameworks/Python/hug/app.py b/frameworks/Python/hug/app.py deleted file mode 100644 index 0ee6509add6..00000000000 --- a/frameworks/Python/hug/app.py +++ /dev/null @@ -1,29 +0,0 @@ -import hug - -from datetime import datetime - - -# Create decorators for mimetypes (JSON is default) -plaintext = hug.get(output=hug.output_format.text) -json = hug.get(output=hug.output_format.json) - - -# Create a directive to add necessary headers -@hug.response_middleware() -def set_required_headers(request, response, resource): - date_obj = datetime.now() - rfc_1123 = "%a, %d %b %Y %H:%M:%S GMT" - rfc_1123_date = date_obj.strftime(rfc_1123) - - headers = { "Server": "hug", "Date": rfc_1123_date } - - response.set_headers(headers) - - -@plaintext -@hug.get("/plaintext") -def plaintext(): - """Plaintext handler.""" - return "Hello, World!" - -app = hug.API(__name__).http.server() diff --git a/frameworks/Python/hug/benchmark_config.json b/frameworks/Python/hug/benchmark_config.json deleted file mode 100644 index b86b6f36db1..00000000000 --- a/frameworks/Python/hug/benchmark_config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "framework": "hug", - "tests": [ - { - "default": { - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "None", - "framework": "Hug", - "language": "Python", - "flavor": "Python3", - "orm": "Raw", - "platform": "Falcon", - "webserver": "None", - "os": "Linux", - "database_os": "Linux", - "display_name": "Hug", - "notes": "CPython 2", - "versus": "wsgi" - } - } - ] -} diff --git a/frameworks/Python/hug/hug.dockerfile b/frameworks/Python/hug/hug.dockerfile deleted file mode 100644 index b385c993026..00000000000 --- a/frameworks/Python/hug/hug.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.6.6-stretch - -WORKDIR /hug -COPY app.py app.py -COPY uwsgi.ini uwsgi.ini -COPY requirements.txt requirements.txt - -RUN pip3 install -r requirements.txt - -EXPOSE 8080 - -CMD ["uwsgi", "--ini", "uwsgi.ini"] diff --git a/frameworks/Python/hug/requirements.txt b/frameworks/Python/hug/requirements.txt deleted file mode 100644 index 7b366e79132..00000000000 --- a/frameworks/Python/hug/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -Cython==0.28.5 -hug==2.3.2 -uWSGI==2.0.17.1 -greenlet==0.4.14 -gunicorn==19.9.0 -meinheld==0.6.1 diff --git a/frameworks/Python/hug/uwsgi.ini b/frameworks/Python/hug/uwsgi.ini deleted file mode 100644 index 15d7d5fa95f..00000000000 --- a/frameworks/Python/hug/uwsgi.ini +++ /dev/null @@ -1,13 +0,0 @@ -; These preferences specifically tuned for performance. - -[uwsgi] -http=:8080 -chdir=/hug -wsgi-file=/hug/app.py -callable=app -workers=%(%k * 2 + 1) -processes=%k -enable-threads=True -threads=1 -disable-logging=True -max-worker-lifetime=30 diff --git a/frameworks/Python/morepath/README.md b/frameworks/Python/morepath/README.md deleted file mode 100644 index 3d0066a6f32..00000000000 --- a/frameworks/Python/morepath/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# [Morepath](http://morepath.readthedocs.io/) Benchmark Test - -The information below is specific to Morepath. For further guidance, -review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). -Also note that there is additional information that's provided in -the [Python README](../). - -This is the Python Morepath portion of a [benchmarking tests suite](../../) -comparing a variety of frameworks. - -All test implementations are located within ([./app](app)). - -## Description - -Morepath with [PonyOrm](https://docs.ponyorm.com/) using PostgreSQL for -database access. - -### Database - -PostgreSQL (with PonyORM). - -### Server - -gunicorn + meinheld on CPython - -## Test URLs - -### Test 1: JSON Encoding - - http://localhost:8080/json - -### Test 2: Single Row Query - - http://localhost:8080/db - -### Test 3: Multi Row Query - - http://localhost:8080/queries?queries=20 - -### Test 4: Fortunes (Template rendering) - - http://localhost:8080/fortunes - -### Test 5: Update Query - - http://localhost:8080/updates?queries=20 - -### Test 6: Plaintext - - http://localhost:8080/plaintext diff --git a/frameworks/Python/morepath/app/__init__.py b/frameworks/Python/morepath/app/__init__.py deleted file mode 100644 index b601c11a64a..00000000000 --- a/frameworks/Python/morepath/app/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# flake8: noqa - -from app.app import App diff --git a/frameworks/Python/morepath/app/app.py b/frameworks/Python/morepath/app/app.py deleted file mode 100644 index 7b43a7baf51..00000000000 --- a/frameworks/Python/morepath/app/app.py +++ /dev/null @@ -1,11 +0,0 @@ -from more.pony import PonyApp -from more.jinja2 import Jinja2App - - -class App(PonyApp, Jinja2App): - pass - - -@App.template_directory() -def get_template_directory(): - return 'templates' diff --git a/frameworks/Python/morepath/app/collection.py b/frameworks/Python/morepath/app/collection.py deleted file mode 100644 index 8ab02a095f8..00000000000 --- a/frameworks/Python/morepath/app/collection.py +++ /dev/null @@ -1,6 +0,0 @@ -from .model import Fortune - - -class FortuneCollection(object): - def query(self): - return Fortune.select() diff --git a/frameworks/Python/morepath/app/model.py b/frameworks/Python/morepath/app/model.py deleted file mode 100644 index 9cd7bc8ed49..00000000000 --- a/frameworks/Python/morepath/app/model.py +++ /dev/null @@ -1,29 +0,0 @@ -from pony.orm import Database, Optional - -db = Database() - - -class Json(): - pass - - -class World(db.Entity): - randomnumber = Optional(int) - - -class WorldQueries(): - def __init__(self, queries): - self.queries = queries - - -class Fortune(db.Entity): - message = Optional(str) - - -class WorldUpdates(): - def __init__(self, queries): - self.queries = queries - - -class Plaintext(): - pass diff --git a/frameworks/Python/morepath/app/path.py b/frameworks/Python/morepath/app/path.py deleted file mode 100644 index 05d1dc442e1..00000000000 --- a/frameworks/Python/morepath/app/path.py +++ /dev/null @@ -1,35 +0,0 @@ -from random import randint - -from .app import App -from .model import Json, World, WorldQueries, WorldUpdates, Plaintext -from .collection import FortuneCollection - - -@App.path(model=Json, path='json') -def get_json(): - return Json() - - -@App.path(model=World, path='db') -def get_random_world(): - return World[randint(1, 10000)] - - -@App.path(model=WorldQueries, path='queries') -def get_queries(queries): - return WorldQueries(queries) - - -@App.path(model=FortuneCollection, path='fortunes') -def get_fortunes(): - return FortuneCollection() - - -@App.path(model=WorldUpdates, path='updates') -def get_updates(queries): - return WorldUpdates(queries) - - -@App.path(model=Plaintext, path='plaintext') -def get_plaintext(): - return Plaintext() diff --git a/frameworks/Python/morepath/app/run.py b/frameworks/Python/morepath/app/run.py deleted file mode 100644 index 82336adbb79..00000000000 --- a/frameworks/Python/morepath/app/run.py +++ /dev/null @@ -1,31 +0,0 @@ -import os - -import morepath - -from app import App -from .model import db - - -def setup_db(): - DBHOST = 'tfb-database' - - db.bind( - 'postgres', - user='benchmarkdbuser', - password='benchmarkdbpass', - host=DBHOST, - database='hello_world' - ) - db.generate_mapping(create_tables=True) - - -def wsgi_factory(): # pragma: no cover - morepath.autoscan() - - App.commit() - setup_db() - - return App() - - -application = wsgi_factory() # pragma: no cover diff --git a/frameworks/Python/morepath/app/templates/fortune.jinja2 b/frameworks/Python/morepath/app/templates/fortune.jinja2 deleted file mode 100644 index e2c33c3c4af..00000000000 --- a/frameworks/Python/morepath/app/templates/fortune.jinja2 +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Fortunes - - - - - - - -{% for fortune in fortunes %} - - - - -{% endfor %} -
idmessage
{{ fortune.id }}{{ fortune.message|escape }}
- - diff --git a/frameworks/Python/morepath/app/tests/test_app.py b/frameworks/Python/morepath/app/tests/test_app.py deleted file mode 100644 index 63f94e5c818..00000000000 --- a/frameworks/Python/morepath/app/tests/test_app.py +++ /dev/null @@ -1,259 +0,0 @@ -from webtest import TestApp as Client -import morepath - -import app -from app import App - - -def setup_module(module): - morepath.scan(app) - morepath.commit(App) - - -def test_json(): - """/json""" - app = App() - c = Client(app) - - response = c.get('/json', status=200) - assert response.headerlist == [ - ('Content-Type', 'application/json'), - ('Content-Length', '27') - ] - assert response.json == {"message": "Hello, World!"} - - -def test_db(): - """/db""" - app = App() - c = Client(app) - - response = c.get('/db', status=200) - assert response.content_type == 'application/json' - assert 'id' in response.json - assert 'randomNumber' in response.json - assert 1 <= response.json['id'] <= 10000 - assert 1 <= response.json['randomNumber'] <= 10000 - - -def test_queries(): - """/queries?queries=""" - app = App() - c = Client(app) - - response = c.get('/queries?queries=', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_queries_foo(): - """/queries?queries=foo""" - app = App() - c = Client(app) - - response = c.get('/queries?queries=foo', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_queries_0(): - """/queries?queries=0""" - app = App() - c = Client(app) - - response = c.get('/queries?queries=0', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_queries_999(): - """/queries?queries=999""" - app = App() - c = Client(app) - - response = c.get('/queries?queries=999', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 500 - - -def test_queries_10(): - """/queries?queries=10""" - app = App() - c = Client(app) - - response = c.get('/queries?queries=10', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 10 - - obj_list = response.json - for obj in obj_list: - assert 'id' in obj - assert 'randomNumber' in obj - assert 1 <= obj['id'] <= 10000 - assert 1 <= obj['randomNumber'] <= 10000 - - -def test_fortunes(): - """/fortunes""" - app = App() - c = Client(app) - - response = c.get('/fortunes', status=200) - assert response.headerlist == [ - ('Content-Type', 'text/html; charset=UTF-8'), - ('Content-Length', '1304') - ] - assert response.text == fortunes - - -def test_updates(): - """/updates?queries=""" - app = App() - c = Client(app) - - response = c.get('/updates?queries=', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_updates_foo(): - """/updates?queries=foo""" - app = App() - c = Client(app) - - response = c.get('/updates?queries=foo', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_updates_0(): - """/updates?queries=0""" - app = App() - c = Client(app) - - response = c.get('/updates?queries=0', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 1 - - -def test_updates_999(): - """/updates?queries=999""" - app = App() - c = Client(app) - - response = c.get('/updates?queries=999', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 500 - - -def test_updates_10(): - """/updates?queries=10""" - app = App() - c = Client(app) - - response = c.get('/updates?queries=10', status=200) - assert response.content_type == 'application/json' - assert len(response.json) == 10 - - obj_list = response.json - for obj in obj_list: - assert 'id' in obj - assert 'randomNumber' in obj - assert 1 <= obj['id'] <= 10000 - assert 1 <= obj['randomNumber'] <= 10000 - - -def test_plaintext(): - """/plaintext""" - app = App() - c = Client(app) - - response = c.get('/plaintext', status=200) - assert response.headerlist == [ - ('Content-Type', 'text/plain; charset=UTF-8'), - ('Content-Length', '13') - ] - assert response.text == 'Hello, World!' - - -fortunes = """ - - - -Fortunes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
idmessage
11<script>alert("This should not be displayed in a browser alert box.");</script>
4A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1
5A computer program does what you tell it to do, not what you want it to do.
2A computer scientist is someone who fixes things that aren't broken.
8A list is only as strong as its weakest link. — Donald Knuth
0Additional fortune added at request time.
3After enough decimal places, nobody gives a damn.
7Any program that runs right is obsolete.
10Computers make very fast, very accurate mistakes.
6Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen
9Feature: A bug with seniority.
1fortune: No such file or directory
12フレームワークのベンチマーク
- -""" diff --git a/frameworks/Python/morepath/app/view.py b/frameworks/Python/morepath/app/view.py deleted file mode 100644 index c518784a93d..00000000000 --- a/frameworks/Python/morepath/app/view.py +++ /dev/null @@ -1,79 +0,0 @@ -from random import randint - -from .app import App -from .model import Json, World, WorldQueries, WorldUpdates, Plaintext -from .collection import FortuneCollection - - -@App.json(model=Json) -def test_1(self, request): - """Test 1: JSON serialization""" - return {'message': 'Hello, World!'} - - -@App.json(model=World) -def test_2(self, request): - """Test 2: Single database query""" - return {'id': self.id, 'randomNumber': self.randomnumber} - - -@App.json(model=WorldQueries) -def test_3(self, request): - """Test 3: Multiple database queries""" - try: - queries = int(self.queries) - except ValueError: - queries = 1 - else: - if queries < 1: - queries = 1 - elif queries > 500: - queries = 500 - - result = [] - - for id_ in [randint(1, 10000) for _ in range(queries)]: - result.append({'id': id_, 'randomNumber': World[id_].randomnumber}) - - return result - - -@App.html(model=FortuneCollection, template='fortune.jinja2') -def test_4(self, request): - """Test 4: Fortunes""" - fortunes = [f.to_dict() for f in self.query()] - fortunes.append({ - 'id': 0, - 'message': 'Additional fortune added at request time.' - }) - - return {'fortunes': sorted(fortunes, key=lambda x: x['message'])} - - -@App.json(model=WorldUpdates) -def test_5(self, request): - """Test 5: Database updates""" - try: - queries = int(self.queries) - except ValueError: - queries = 1 - else: - if queries < 1: - queries = 1 - elif queries > 500: - queries = 500 - - result = [] - - for id_ in sorted(randint(1, 10000) for _ in range(queries)): - randomNumber = randint(1, 10000) - World[id_].randomnumber = randomNumber - result.append({'id': id_, 'randomNumber': randomNumber}) - - return result - - -@App.view(model=Plaintext) -def test_6(self, request): - """Test 6: Plaintext""" - return 'Hello, World!' diff --git a/frameworks/Python/morepath/benchmark_config.json b/frameworks/Python/morepath/benchmark_config.json deleted file mode 100644 index 43f1b3200d4..00000000000 --- a/frameworks/Python/morepath/benchmark_config.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "framework": "morepath", - "tests": [{ - "default": { - "json_url": "/json", - "db_url": "/db", - "query_url": "/queries?queries=", - "fortune_url": "/fortunes", - "update_url": "/updates?queries=", - "plaintext_url": "/plaintext", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "Postgres", - "framework": "morepath", - "language": "Python", - "flavor": "Python3", - "orm": "Full", - "platform": "Meinheld", - "webserver": "gunicorn", - "os": "Linux", - "database_os": "Linux", - "display_name": "Morepath", - "notes": "uses Morepath with PonyORM for database access" - } - }] -} diff --git a/frameworks/Python/morepath/config.toml b/frameworks/Python/morepath/config.toml deleted file mode 100644 index af46ef2250a..00000000000 --- a/frameworks/Python/morepath/config.toml +++ /dev/null @@ -1,19 +0,0 @@ -[framework] -name = "morepath" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Micro" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Full" -platform = "Meinheld" -webserver = "gunicorn" -versus = "None" diff --git a/frameworks/Python/morepath/gunicorn_conf.py b/frameworks/Python/morepath/gunicorn_conf.py deleted file mode 100644 index bab6df83a9e..00000000000 --- a/frameworks/Python/morepath/gunicorn_conf.py +++ /dev/null @@ -1,14 +0,0 @@ -import multiprocessing -import os - -if os.environ.get('TRAVIS') == 'true': - workers = 2 -else: - workers = multiprocessing.cpu_count() * 3 - -bind = '0.0.0.0:8080' -keepalive = 120 -errorlog = '-' -pidfile = 'gunicorn.pid' - -worker_class = "meinheld.gmeinheld.MeinheldWorker" diff --git a/frameworks/Python/morepath/morepath.dockerfile b/frameworks/Python/morepath/morepath.dockerfile deleted file mode 100644 index a0fee3578cd..00000000000 --- a/frameworks/Python/morepath/morepath.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.6.6-stretch - -ADD ./ /japronto - -WORKDIR /japronto - -RUN pip3 install -r /japronto/requirements.txt - -EXPOSE 8080 - -CMD gunicorn app.run -c gunicorn_conf.py diff --git a/frameworks/Python/morepath/requirements.txt b/frameworks/Python/morepath/requirements.txt deleted file mode 100644 index 8f58488b64e..00000000000 --- a/frameworks/Python/morepath/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -dectate==0.13 -greenlet==0.4.14 -gunicorn==19.9.0 -importscan==0.1 -Jinja2==2.11.3 -MarkupSafe==1.0 -meinheld==1.0.2 -more.jinja2==0.2 -more.pony==0.1 -morepath==0.18.1 -pony==0.7.1 -psycopg2==2.7.5 -reg==0.11 -repoze.lru==0.6 -WebOb==1.8.8 - --e . diff --git a/frameworks/Python/morepath/setup.py b/frameworks/Python/morepath/setup.py deleted file mode 100644 index d712f4e8c87..00000000000 --- a/frameworks/Python/morepath/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -from setuptools import setup, find_packages - -setup( - name='frameworkbenchmarks', - version='0.0', - description='FrameworkBenchmarks', - author='', - author_email='', - url='', - packages=find_packages(), - include_package_data=True, - zip_safe=False, - platforms='any', - install_requires=[ - 'more.pony', - 'psycopg2', - 'more.jinja2', - 'gunicorn', - 'meinheld', - ], - extras_require=dict( - test=[ - 'pytest >= 2.9.1', - 'WebTest >= 2.0.14', - 'pytest-cov', - ] - ), - entry_points=dict( - morepath=[ - 'scan = app', - ], - ), - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Morepath', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ] -) diff --git a/frameworks/Python/quart/requirements.txt b/frameworks/Python/quart/requirements.txt index fb1f1a1e0be..13e6e269e43 100644 --- a/frameworks/Python/quart/requirements.txt +++ b/frameworks/Python/quart/requirements.txt @@ -14,5 +14,5 @@ priority==2.0.0 quart==0.18.0 toml==0.10.2 uvloop==0.16.0 -Werkzeug==3.0.3 +Werkzeug==2.3.8 wsproto==1.2.0 diff --git a/frameworks/Python/starlite/.dockerignore b/frameworks/Python/starlite/.dockerignore deleted file mode 100644 index 9fce104ae8c..00000000000 --- a/frameworks/Python/starlite/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -.venv -README.md diff --git a/frameworks/Python/starlite/README.md b/frameworks/Python/starlite/README.md deleted file mode 100755 index 0d1452fc99a..00000000000 --- a/frameworks/Python/starlite/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Starlite Benchmarking Test - -This is the Starlite portion of a [benchmarking tests suite](../../) -comparing a variety of web development platforms. - -The information below is specific to Starlite. For further guidance, -review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). -Also note that there is additional information provided in -the [Python README](../). - -## Description# Starlite - -Starlite is a powerful, performant, flexible and opinionated ASGI framework, -offering first class typing support and a full [Pydantic](https://github.com/samuelcolvin/pydantic) -integration. - -Check out the [documentation 📚](https://starlite-api.github.io/starlite/). diff --git a/frameworks/Python/starlite/app.py b/frameworks/Python/starlite/app.py deleted file mode 100755 index 09a4ffa56f5..00000000000 --- a/frameworks/Python/starlite/app.py +++ /dev/null @@ -1,121 +0,0 @@ -import asyncio -import os -from operator import itemgetter -from random import randint, sample -from typing import Any - -import uvloop -from asyncpg import create_pool -from jinja2 import Template -from starlite import MediaType, Starlite, get - -asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) -connection_pool: Any = None - - -async def init_connection_pool() -> None: - global connection_pool - connection_pool = await create_pool( - user=os.getenv('PGUSER', 'benchmarkdbuser'), - password=os.getenv('PGPASS', 'benchmarkdbpass'), - database='hello_world', - host='tfb-database', - port=5432 - ) - - -def normalize_queries(value: str | None) -> int: - queries = int(value) if value and value.isnumeric() else 1 - if queries > 500: - return 500 - if queries < 1: - return 1 - return queries - - -def load_fortunes_template() -> "Template": - path = os.path.join('templates', 'fortune.html') - with open(path, 'r') as template_file: - template_text = template_file.read() - return Template(template_text) - - -fortune_template = load_fortunes_template() - - -@get(path='/json') -def json_serialization() -> dict[str, str]: - return {'message': 'Hello, world!'} - - -@get(path='/db') -async def single_database_query() -> dict[str, int]: - row_id = randint(1, 10000) - async with connection_pool.acquire() as connection: - number = await connection.fetchval( - 'SELECT "randomnumber", "id" FROM "world" WHERE id = $1', - row_id - ) - - return {'id': row_id, 'randomNumber': number} - - -@get(path='/queries') -async def multiple_database_queries(queries: None | str = None) -> list[dict[str, int]]: - row_ids = sample(range(1, 10000), normalize_queries(queries)) - worlds = [] - - async with connection_pool.acquire() as connection: - statement = await connection.prepare('SELECT "randomnumber", "id" FROM "world" WHERE id = $1') - for row_id in row_ids: - number = await statement.fetchval(row_id) - worlds.append({'id': row_id, 'randomNumber': number}) - - return worlds - - -@get(path='/fortunes', media_type=MediaType.HTML) -async def render_fortunes_template() -> str: - async with connection_pool.acquire() as connection: - fortunes = await connection.fetch('SELECT * FROM Fortune') - - fortunes.append([0, 'Additional fortune added at request time.']) - fortunes.sort(key=itemgetter(1)) - return fortune_template.render(fortunes=fortunes) - - -@get(path='/updates') -async def database_updates(queries: None | str = None) -> list[dict[str, int]]: - num_queries = normalize_queries(queries) - updates = list(zip(sorted(sample(range(1, 10000 + 1), num_queries)), sample(range(1, 10000), num_queries))) - - worlds = [ - {"id": row_id, "randomNumber": number} for row_id, number in updates - ] - - async with connection_pool.acquire() as connection: - statement = await connection.prepare('SELECT "id", "randomnumber" FROM "world" WHERE id = $1') - for row_id, _ in updates: - await statement.fetchval(row_id) - await connection.executemany('UPDATE "world" SET "randomnumber"=$1 WHERE id=$2', updates) - - return worlds - - -@get(path='/plaintext', media_type=MediaType.TEXT) -def plaintext() -> bytes: - return b'Hello, world!' - - -app = Starlite( - route_handlers=[ - database_updates, - json_serialization, - multiple_database_queries, - plaintext, - render_fortunes_template, - single_database_query, - ], - on_startup=[init_connection_pool], - openapi_config=None, -) diff --git a/frameworks/Python/starlite/benchmark_config.json b/frameworks/Python/starlite/benchmark_config.json deleted file mode 100755 index cdceafff5e4..00000000000 --- a/frameworks/Python/starlite/benchmark_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "framework": "starlite", - "tests": [ - { - "default": { - "json_url": "/json", - "fortune_url": "/fortunes", - "plaintext_url": "/plaintext", - "db_url": "/db", - "query_url": "/queries?queries=", - "update_url": "/updates?queries=", - "port": 8080, - "approach": "Realistic", - "classification": "Micro", - "database": "Postgres", - "framework": "Starlite", - "language": "Python", - "flavor": "Python3", - "orm": "Raw", - "platform": "None", - "webserver": "Uvicorn", - "os": "Linux", - "database_os": "Linux", - "display_name": "Starlite", - "notes": "", - "versus": "None" - } - } - ] -} diff --git a/frameworks/Python/starlite/config.toml b/frameworks/Python/starlite/config.toml deleted file mode 100644 index 3aa7c3cec44..00000000000 --- a/frameworks/Python/starlite/config.toml +++ /dev/null @@ -1,19 +0,0 @@ -[framework] -name = "starlite" - -[uvicorn] -urls.plaintext = "/plaintext" -urls.json = "/json" -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Micro" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "Uvicorn" -versus = "None" diff --git a/frameworks/Python/starlite/requirements.txt b/frameworks/Python/starlite/requirements.txt deleted file mode 100644 index d8312c6df61..00000000000 --- a/frameworks/Python/starlite/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -asyncpg>=0.27.0 -jinja2>=3.1.2 -starlite>=1.51.0 -uvicorn[standard]>=0.20.0 -uvloop>=0.17.0 \ No newline at end of file diff --git a/frameworks/Python/starlite/starlite.dockerfile b/frameworks/Python/starlite/starlite.dockerfile deleted file mode 100644 index f51c232e4cc..00000000000 --- a/frameworks/Python/starlite/starlite.dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM python:3.11 -WORKDIR /starlite/ - -RUN python -m venv /opt/venv -ENV PATH="/opt/venv/bin:$PATH" - -COPY . . - -RUN pip install --upgrade pip \ - && pip install cython==0.29.33 \ - && pip install -r /starlite/requirements.txt - -EXPOSE 8080 -CMD uvicorn app:app --host 0.0.0.0 --port 8080 --workers $(nproc) --log-level error --loop uvloop diff --git a/frameworks/Python/starlite/templates/fortune.html b/frameworks/Python/starlite/templates/fortune.html deleted file mode 100644 index 2e62ac5f7a0..00000000000 --- a/frameworks/Python/starlite/templates/fortune.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Fortunes - - - - - - - {% for fortune in fortunes %} - - - - - {% endfor %}
idmessage
{{ fortune[0] }}{{ fortune[1]|e }}
- - diff --git a/frameworks/Python/turbogears/requirements.txt b/frameworks/Python/turbogears/requirements.txt index 0ad8a126c99..58499e541b2 100644 --- a/frameworks/Python/turbogears/requirements.txt +++ b/frameworks/Python/turbogears/requirements.txt @@ -3,7 +3,7 @@ tg.devtools==2.3.8 SQLAlchemy==1.3.0 zope.sqlalchemy==0.7.6 mysqlclient==1.3.7 -jinja2==2.11.3 +jinja2==3.1.6 gunicorn==19.9.0 meinheld==1.0.2 diff --git a/frameworks/Python/vibora/README.md b/frameworks/Python/vibora/README.md deleted file mode 100644 index 647792661a2..00000000000 --- a/frameworks/Python/vibora/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# [Vibora](https://github.com/vibora-io/vibora) Benchmark Test - -The information below is specific to Vibora. For further guidance, -review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). -Also note that there is additional information that's provided in -the [Python README](../). - -This is the Python Vibora portion of a [benchmarking tests suite](../../) -comparing a variety of frameworks. - -All test implementations are located within a single file -([app.py](app.py)). - -## Description - -Vibora, Vibora + psycopg2 - -### Database - -Postgres - -## Test URLs -### JSON Encoding - -http://localhost:8080/json - -### Single Row Random Query - -http://localhost:8080/db - -### Plaintext - -http://localhost:8080/plaintext - - - -The following tests cannot be currently run due to an issue with the framework -[Details Here] = https://github.com/vibora-io/vibora/issues/223 - -### Update random rows - -http://localhost:8080/updates/?queries= - -### Variable Row Query Test - -http://localhost:8080/db?queries= diff --git a/frameworks/Python/vibora/app.py b/frameworks/Python/vibora/app.py deleted file mode 100644 index 243aa4365e1..00000000000 --- a/frameworks/Python/vibora/app.py +++ /dev/null @@ -1,115 +0,0 @@ -import multiprocessing -import os -from random import randint -from operator import itemgetter - -from vibora import Vibora, Request, JsonResponse, Response -from vibora.hooks import Events - -from db import Pool -DEFAULT_POOL_SIZE = 1000//multiprocessing.cpu_count() - -READ_ROW_SQL = 'SELECT * FROM "world" WHERE id={0}' -WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"={0} WHERE id={1} RETURNING id, randomNumber' -READ_ALL_FORTUNES = 'SELECT * FROM "fortune"' -ADDITIONAL_ROW = [0, 'Additional fortune added at request time.'] -sort_fortunes_key = itemgetter(1) - -app = Vibora(template_dirs=['templates']) - - -@app.handle(Events.BEFORE_SERVER_START) -async def init_db(app: Vibora): - app.components.add(await Pool("postgresql://%s:%s@%s:5432/%s" % (os.getenv("PGUSER", "benchmarkdbuser"), os.getenv("PSPASS", "benchmarkdbpass"), os.getenv("PGADDR", "tfb-database"), os.getenv("PGDB", "hello_world")), max_size=int(os.getenv("PGPOOLSIZE", DEFAULT_POOL_SIZE)))) - - -@app.handle(Events.BEFORE_SERVER_STOP) -async def close_db(app: Vibora): - await asyncio.wait_for(app.components.get(Pool).close(), timeout=10) - - -def getQueriesTotal(params): - try: - queries = params['queries'][0] - query_count = int(queries) - except: - return 1 - - if query_count < 1: - return 1 - if query_count > 500: - return 500 - return query_count - - -async def fetchWorld(pool): - async with pool.acquire() as conn: - return await conn.fetchrow(READ_ROW_SQL.format(randint(1, 10000))) - - -async def updateWorld(world_id, pool): - async with pool.acquire() as conn: - return await conn.fetchrow(WRITE_ROW_SQL.format(randint(1, 10000), world_id)) - - -async def fetchMultipleWorlds(total, pool): - worlds = [] - for x in range(total): - res = await fetchWorld(pool) - worlds.append({'id': res[0], 'randomNumber': res[1]}) - return worlds - - -async def updateMultipleWorlds(total, pool): - worlds = [] - for x in range(total): - res = await fetchWorld(pool) - updated = await updateWorld(res[0], pool) - worlds.append({'id': updated[0], 'randomNumber': updated[1]}) - return worlds - - -async def fetchFortunes(pool): - async with pool.acquire() as conn: - return await conn.fetch(READ_ALL_FORTUNES) - - -@app.route('/fortunes') -async def fortunes(pool: Pool): - fortunes = await fetchFortunes(pool) - fortunes.append(ADDITIONAL_ROW) - fortunes.sort(key=sort_fortunes_key) - return await app.render('index.html', fortunes=fortunes) - - -@app.route('/db') -async def single_query(request: Request, pool: Pool): - res = await fetchWorld(pool) - return JsonResponse({'id': res[0], 'randomNumber': res[1]}, headers={'Server': 'Vibora'}) - - -@app.route('/plaintext') -async def plaintext(): - return Response(b'Hello, World!', headers={'Server': 'Vibora', 'Content-Type': 'text/plain'}) - - -@app.route('/json') -async def json(): - return JsonResponse({'message': 'Hello, World!'}, headers={'Server': 'Vibora'}) - - -@app.route('/queries') -async def multiple_queries(request: Request, pool: Pool): - total_queries = getQueriesTotal(request.args) - worlds = await fetchMultipleWorlds(total_queries, pool) - return JsonResponse(worlds, headers={'Server': 'Vibora', 'Content-Type': 'application/json', 'Content-Length': str(total_queries)}) - - -@app.route('/updates') -async def update_queries(request: Request, pool: Pool): - total_queries = getQueriesTotal(request.args) - worlds = await updateMultipleWorlds(total_queries, pool) - return JsonResponse(worlds, headers={'Server': 'Vibora', 'Content-Type': 'application/json', 'Content-Length': str(total_queries)}) - -if __name__ == '__main__': - app.run(host="0.0.0.0", port=8000, workers=multiprocessing.cpu_count()) diff --git a/frameworks/Python/vibora/benchmark_config.json b/frameworks/Python/vibora/benchmark_config.json deleted file mode 100644 index 3876196498a..00000000000 --- a/frameworks/Python/vibora/benchmark_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "framework": "vibora", - "tests": [{ - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "port": 8000, - "approach": "Realistic", - "classification": "Platform", - "framework": "vibora", - "language": "Python", - "flavor": "Python3", - "platform": "None", - "webserver": "None", - "os": "Linux", - "orm": "Full", - "database_os": "Linux", - "database": "Postgres", - "display_name": "Vibora", - "notes": "" - } - }] -} diff --git a/frameworks/Python/vibora/db.py b/frameworks/Python/vibora/db.py deleted file mode 100644 index 2f3fe5560e2..00000000000 --- a/frameworks/Python/vibora/db.py +++ /dev/null @@ -1,36 +0,0 @@ -import asyncio -from contextlib import asynccontextmanager -import asyncpg - - -class Connection(asyncpg.Connection): - async def reset(self, *, timeout=None): - pass - - -class Pool: - def __init__(self, connect_url, max_size=10, connection_class=None): - self._connect_url = connect_url - self._connection_class = connection_class or Connection - self._queue = asyncio.LifoQueue(max_size) - - def __await__(self): - return self._async_init__().__await__() - - async def _async_init__(self): - for _ in range(self._queue.maxsize): - self._queue.put_nowait(await asyncpg.connect(self._connect_url, connection_class=self._connection_class)) - return self - - @asynccontextmanager - async def acquire(self): - conn = await self._queue.get() - try: - yield conn - finally: - self._queue.put_nowait(conn) - - async def close(self): - for _ in range(self._queue.maxsize): - conn = await self._queue.get() - await conn.close() diff --git a/frameworks/Python/vibora/requirements.txt b/frameworks/Python/vibora/requirements.txt deleted file mode 100644 index 88fbcd0ba4b..00000000000 --- a/frameworks/Python/vibora/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -asyncpg==0.26.0 -git+https://github.com/IterableTrucks/vibora.git@a24bbf417a84df3a25f7e8901613a1c50ccfe63f#egg=vibora[fast] diff --git a/frameworks/Python/vibora/templates/index.html b/frameworks/Python/vibora/templates/index.html deleted file mode 100644 index 55c472c8ee1..00000000000 --- a/frameworks/Python/vibora/templates/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Fortunes - - - - - - - - {% for fortune in fortunes %} - - - - - {% endfor %} -
idmessage
{{ fortune[0] }}{{ fortune[1] }}
- - \ No newline at end of file diff --git a/frameworks/Python/vibora/vibora.dockerfile b/frameworks/Python/vibora/vibora.dockerfile deleted file mode 100644 index 5a2685d5ec5..00000000000 --- a/frameworks/Python/vibora/vibora.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.10.6 - -ADD ./ /vibora - -WORKDIR /vibora - -RUN pip3 install -r /vibora/requirements.txt - -EXPOSE 8000 - -CMD ["python3", "app.py"] diff --git a/frameworks/Python/xpresso/README.md b/frameworks/Python/xpresso/README.md deleted file mode 100755 index 1a66fe57feb..00000000000 --- a/frameworks/Python/xpresso/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Xpresso Benchmarking Test - -This is the Xpresso portion of a [benchmarking tests suite](../../) comparing a variety of web development platforms. - -The information below is specific to Xpresso. -For further guidance, review the [documentation](https://github.com/TechEmpower/FrameworkBenchmarks/wiki). -Also note that there is additional information provided in the [Python README](../). - -## Description - -[Xpresso] is a high performance Python web framework built on top of [Starlette], [Pydantic] and [di] with a focus on composability, flexibility and minimal but well defined library APIs. - -## Test Paths & Sources - -All of the test implementations are located within a single file ([main.py](main.py)). - -## Resources - -* [Xpresso source code on GitHub](https://github.com/adriangb/xpresso) -* [Xpresso website - documentation](https://xpresso-api.dev) - -[Xpresso]: https://github.com/adriangb/xpresso -[Starlette]: https://github.com/encode/starlette -[Pydantic]: https://github.com/samuelcolvin/pydantic/ -[di]: https://github.com/adriangb/di diff --git a/frameworks/Python/xpresso/config.toml b/frameworks/Python/xpresso/config.toml deleted file mode 100644 index fe4a990a539..00000000000 --- a/frameworks/Python/xpresso/config.toml +++ /dev/null @@ -1,19 +0,0 @@ -[framework] -name = "xpresso" - -[main] -urls.plaintext = "/plaintext" -urls.json = "/json" -urls.db = "/db" -urls.query = "/queries?queries=" -urls.update = "/updates?queries=" -urls.fortune = "/fortunes" -approach = "Realistic" -classification = "Micro" -database = "Postgres" -database_os = "Linux" -os = "Linux" -orm = "Raw" -platform = "None" -webserver = "None" -versus = "None" diff --git a/frameworks/Python/xpresso/main.py b/frameworks/Python/xpresso/main.py deleted file mode 100755 index 0862fe51c7a..00000000000 --- a/frameworks/Python/xpresso/main.py +++ /dev/null @@ -1,158 +0,0 @@ -import multiprocessing -import os -import pathlib -from operator import itemgetter -from random import randint, sample -from typing import Annotated, AsyncIterable, Optional - -import asyncpg # type: ignore -import jinja2 # type: ignore -import uvicorn # type: ignore -from pydantic import BaseModel, Field -from starlette.responses import HTMLResponse, PlainTextResponse -from xpresso import App, Depends, Path, Response, FromQuery - -READ_ROW_SQL = 'SELECT "randomnumber", "id" FROM "world" WHERE id = $1' -WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"=$1 WHERE id=$2' -ADDITIONAL_ROW = (0, 'Additional fortune added at request time.') - - -sort_fortunes_key = itemgetter(1) - -app_dir = pathlib.Path(__file__).parent -with (app_dir / "templates" / "fortune.html").open() as template_file: - template = jinja2.Template(template_file.read()) - - -async def get_db_pool() -> AsyncIterable[asyncpg.Pool]: - async with asyncpg.create_pool( # type: ignore - user=os.getenv('PGUSER', 'benchmarkdbuser'), - password=os.getenv('PGPASS', 'benchmarkdbpass'), - database=os.getenv('PGDB', 'hello_world'), - host=os.getenv('PGHOST', 'tfb-database'), - port=5432, - ) as pool: - yield pool - - -DBPool = Annotated[asyncpg.Pool, Depends(get_db_pool, scope="app")] - - -def get_num_queries(queries: Optional[str]) -> int: - if not queries: - return 1 - try: - queries_num = int(queries) - except (ValueError, TypeError): - return 1 - if queries_num < 1: - return 1 - if queries_num > 500: - return 500 - return queries_num - - - -class Greeting(BaseModel): - message: str - - -def json_serialization() -> Greeting: - return Greeting(message="Hello, world!") - - -def plaintext() -> Response: - return PlainTextResponse(b"Hello, world!") - - -class QueryResult(BaseModel): - id: int - randomNumber: int - - -async def single_database_query(pool: DBPool) -> QueryResult: - row_id = randint(1, 10000) - - connection: "asyncpg.Connection" - async with pool.acquire() as connection: # type: ignore - number: int = await connection.fetchval(READ_ROW_SQL, row_id) # type: ignore - - return QueryResult.construct(id=row_id, randomNumber=number) - - -QueryCount = Annotated[str, Field(gt=0, le=500)] - - -async def multiple_database_queries( - pool: DBPool, - queries: FromQuery[str | None] = None, -) -> list[QueryResult]: - num_queries = get_num_queries(queries) - row_ids = sample(range(1, 10000), num_queries) - - connection: "asyncpg.Connection" - async with pool.acquire() as connection: # type: ignore - statement = await connection.prepare(READ_ROW_SQL) # type: ignore - return [ - QueryResult.construct( - id=row_id, - randomNumber=await statement.fetchval(row_id), # type: ignore - ) - for row_id in row_ids - ] - - -async def fortunes(pool: DBPool) -> Response: - connection: "asyncpg.Connection" - async with pool.acquire() as connection: # type: ignore - fortunes: "list[tuple[int, str]]" = await connection.fetch("SELECT * FROM Fortune") # type: ignore - - fortunes.append(ADDITIONAL_ROW) - fortunes.sort(key=sort_fortunes_key) - content = template.render(fortunes=fortunes) # type: ignore - return HTMLResponse(content) - - -async def database_updates( - pool: DBPool, - queries: FromQuery[str | None] = None, -) -> list[QueryResult]: - num_queries = get_num_queries(queries) - - updates = [(row_id, randint(1, 10000)) for row_id in sample(range(1, 10000), num_queries)] - - async with pool.acquire() as connection: - statement = await connection.prepare(READ_ROW_SQL) - for row_id, _ in updates: - await statement.fetchval(row_id) - await connection.executemany(WRITE_ROW_SQL, updates) # type: ignore - - return [QueryResult.construct(id=row_id, randomNumber=number) for row_id, number in updates] - - -routes = ( - Path("/json", get=json_serialization), - Path("/plaintext", get=plaintext), - Path("/db", get=single_database_query), - Path("/queries", get=multiple_database_queries), - Path("/fortunes", get=fortunes), - Path("/updates", get=database_updates), -) - - -app = App(routes=routes) - - -if __name__ == "__main__": - workers = multiprocessing.cpu_count() - if os.environ.get("TRAVIS") == "true": - workers = 2 - uvicorn.run( # type: ignore - "main:app", - host="0.0.0.0", - port=8080, - workers=workers, - log_level="error", - loop="uvloop", - http="httptools", - ) diff --git a/frameworks/Python/xpresso/requirements.txt b/frameworks/Python/xpresso/requirements.txt deleted file mode 100644 index e9e6af671f9..00000000000 --- a/frameworks/Python/xpresso/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -asyncpg==0.27.0 -Jinja2==2.11.3 -markupsafe==2.0.1 -httptools==0.5.0 -uvloop==0.17.0 -uvicorn==0.20.0 -xpresso==0.46.0 diff --git a/frameworks/Python/xpresso/templates/fortune.html b/frameworks/Python/xpresso/templates/fortune.html deleted file mode 100644 index 1c90834285d..00000000000 --- a/frameworks/Python/xpresso/templates/fortune.html +++ /dev/null @@ -1,10 +0,0 @@ - - -Fortunes - - - -{% for fortune in fortunes %} -{% endfor %}
idmessage
{{ fortune[0] }}{{ fortune[1]|e }}
- - diff --git a/frameworks/Python/xpresso/xpresso.dockerfile b/frameworks/Python/xpresso/xpresso.dockerfile deleted file mode 100644 index f0aba7a9005..00000000000 --- a/frameworks/Python/xpresso/xpresso.dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM python:3.10 - -RUN mkdir /xpresso -WORKDIR /xpresso - -COPY ./requirements.txt /xpresso/ - -RUN pip install --no-cache-dir -r /xpresso/requirements.txt - -COPY ./ /xpresso/ - -EXPOSE 8080 - -CMD ["python", "main.py"] diff --git a/frameworks/Ruby/agoo/Gemfile.lock b/frameworks/Ruby/agoo/Gemfile.lock index 62b47ca4908..8d4a2594fdc 100644 --- a/frameworks/Ruby/agoo/Gemfile.lock +++ b/frameworks/Ruby/agoo/Gemfile.lock @@ -1,13 +1,15 @@ GEM remote: https://rubygems.org/ specs: - agoo (2.15.10) - bigdecimal (3.1.8) - connection_pool (2.4.1) - oj (3.16.3) + agoo (2.15.13) + bigdecimal (3.1.9) + connection_pool (2.5.0) + oj (3.16.10) bigdecimal (>= 3.0) - pg (1.5.6) - rack (3.0.12) + ostruct (>= 0.2) + ostruct (0.6.1) + pg (1.5.9) + rack (3.1.11) PLATFORMS ruby diff --git a/frameworks/Ruby/grape/Gemfile b/frameworks/Ruby/grape/Gemfile index 185a55f68e2..1aea70fade0 100644 --- a/frameworks/Ruby/grape/Gemfile +++ b/frameworks/Ruby/grape/Gemfile @@ -4,6 +4,6 @@ gem 'mysql2', '0.5.6' gem 'unicorn', '6.1.0' gem 'puma', '~> 6.4' gem 'activerecord', '~> 7.1.0', :require => 'active_record' -gem 'grape', '2.0.0' +gem 'grape', '2.1.1' gem 'multi_json', require: 'multi_json' gem 'oj', '~> 3.16' diff --git a/frameworks/Ruby/grape/README.md b/frameworks/Ruby/grape/README.md index 6e35abfae04..87f4e3f1c2a 100644 --- a/frameworks/Ruby/grape/README.md +++ b/frameworks/Ruby/grape/README.md @@ -11,7 +11,7 @@ comparing a variety of web servers. ## Infrastructure Software Versions The tests were run with: -* [Ruby 3.3](http://www.ruby-lang.org/) +* [Ruby 3.4](http://www.ruby-lang.org/) * [Grape 2.0.0](http://www.ruby-grape.org/) * [Unicorn 6.1.0](https://yhbt.net/unicorn/) * [Puma 6.4](https://puma.io/) diff --git a/frameworks/Ruby/grape/config.ru b/frameworks/Ruby/grape/config.ru index 22142a30c72..a91b5364a11 100644 --- a/frameworks/Ruby/grape/config.ru +++ b/frameworks/Ruby/grape/config.ru @@ -77,7 +77,7 @@ module Acme class API < Grape::API before do - header 'Date', Time.now.httpdate + header 'Date', Time.now.httpdate if defined?(Puma) header 'Server', 'WebServer' end content_type :json, 'application/json' diff --git a/frameworks/Ruby/grape/grape-unicorn.dockerfile b/frameworks/Ruby/grape/grape-unicorn.dockerfile index f805021f71e..4f32633e8bb 100644 --- a/frameworks/Ruby/grape/grape-unicorn.dockerfile +++ b/frameworks/Ruby/grape/grape-unicorn.dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4 ENV RUBY_YJIT_ENABLE=1 diff --git a/frameworks/Ruby/grape/grape.dockerfile b/frameworks/Ruby/grape/grape.dockerfile index 99898d43e65..e14f49a9bb4 100644 --- a/frameworks/Ruby/grape/grape.dockerfile +++ b/frameworks/Ruby/grape/grape.dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4 ENV RUBY_YJIT_ENABLE=1 diff --git a/frameworks/Ruby/hanami/.env b/frameworks/Ruby/hanami/.env new file mode 100644 index 00000000000..c28bf215c1f --- /dev/null +++ b/frameworks/Ruby/hanami/.env @@ -0,0 +1,3 @@ +HANAMI_ENV=production +HANAMI_PORT=8080 +DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world diff --git a/frameworks/Ruby/hanami/Gemfile.lock b/frameworks/Ruby/hanami/Gemfile.lock new file mode 100644 index 00000000000..36b859fb018 --- /dev/null +++ b/frameworks/Ruby/hanami/Gemfile.lock @@ -0,0 +1,166 @@ +GEM + remote: https://rubygems.org/ + specs: + bigdecimal (3.1.9) + concurrent-ruby (1.3.4) + dry-auto_inject (1.1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-cli (1.2.0) + dry-configurable (1.3.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-core (1.1.0) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + dry-events (1.1.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.1) + dry-files (1.1.0) + dry-inflector (1.2.0) + dry-initializer (3.2.0) + dry-logger (1.0.4) + dry-logic (1.6.0) + bigdecimal + concurrent-ruby (~> 1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-monitor (1.0.1) + dry-configurable (~> 1.0, < 2) + dry-core (~> 1.0, < 2) + dry-events (~> 1.0, < 2) + dry-schema (1.13.4) + concurrent-ruby (~> 1.0) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-logic (>= 1.4, < 2) + dry-types (>= 1.7, < 2) + zeitwerk (~> 2.6) + dry-struct (1.7.0) + dry-core (~> 1.1) + dry-types (~> 1.8) + ice_nine (~> 0.11) + zeitwerk (~> 2.6) + dry-system (1.2.0) + dry-auto_inject (~> 1.1) + dry-configurable (~> 1.3) + dry-core (~> 1.1) + dry-inflector (~> 1.1) + dry-transformer (1.0.1) + zeitwerk (~> 2.6) + dry-types (1.8.0) + bigdecimal (~> 3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) + dry-validation (1.10.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-schema (>= 1.12, < 2) + zeitwerk (~> 2.6) + hanami (2.2.1) + bundler (>= 1.16, < 3) + dry-configurable (~> 1.0, >= 1.2.0, < 2) + dry-core (~> 1.0, < 2) + dry-inflector (~> 1.0, >= 1.1.0, < 2) + dry-logger (~> 1.0, < 2) + dry-monitor (~> 1.0, >= 1.0.1, < 2) + dry-system (~> 1.1) + hanami-cli (~> 2.2.1) + hanami-utils (~> 2.2) + json (>= 2.7.2) + zeitwerk (~> 2.6) + hanami-cli (2.2.1) + bundler (~> 2.1) + dry-cli (~> 1.0, >= 1.1.0) + dry-files (~> 1.0, >= 1.0.2, < 2) + dry-inflector (~> 1.0, < 2) + rake (~> 13.0) + zeitwerk (~> 2.6) + hanami-controller (2.1.0) + dry-configurable (~> 1.0, < 2) + dry-core (~> 1.0) + hanami-utils (~> 2.1) + rack (~> 2.0) + zeitwerk (~> 2.6) + hanami-router (2.1.0) + mustermann (~> 3.0) + mustermann-contrib (~> 3.0) + rack (~> 2.0) + hanami-utils (2.2.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0, < 2) + dry-transformer (~> 1.0, < 2) + hanami-validations (2.1.0) + dry-validation (>= 1.10, < 2) + zeitwerk (~> 2.6.0) + hansi (0.2.1) + ice_nine (0.11.2) + json (2.9.1) + logger (1.6.4) + mustermann (3.0.3) + ruby2_keywords (~> 0.0.1) + mustermann-contrib (3.0.3) + hansi (~> 0.2.0) + mustermann (= 3.0.3) + nio4r (2.7.4) + pg (1.5.9) + puma (6.5.0) + nio4r (~> 2.0) + rack (2.2.9) + rake (13.2.1) + rom (5.3.2) + rom-changeset (~> 5.3, >= 5.3.0) + rom-core (~> 5.3, >= 5.3.2) + rom-repository (~> 5.3, >= 5.3.0) + rom-changeset (5.3.0) + dry-core (~> 1.0) + rom-core (~> 5.3) + transproc (~> 1.0, >= 1.1.0) + rom-core (5.3.2) + concurrent-ruby (~> 1.1) + dry-configurable (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-initializer (~> 3.0, >= 3.0.1) + dry-struct (~> 1.0) + dry-types (~> 1.6) + transproc (~> 1.0, >= 1.1.0) + rom-repository (5.3.0) + dry-core (~> 1.0) + dry-initializer (~> 3.0, >= 3.0.1) + rom-core (~> 5.3, >= 5.3.0) + rom-sql (3.6.5) + dry-core (~> 1.0) + dry-types (~> 1.0) + rom (~> 5.2, >= 5.2.1) + sequel (>= 4.49) + ruby2_keywords (0.0.5) + sequel (5.88.0) + bigdecimal + transproc (1.1.1) + zeitwerk (2.6.18) + +PLATFORMS + ruby + x86_64-darwin-23 + +DEPENDENCIES + dry-types (~> 1.0, >= 1.6.1) + hanami (~> 2.0) + hanami-controller (~> 2.0) + hanami-router (~> 2.0) + hanami-validations (~> 2.0) + pg + puma + rake + rom (~> 5.3) + rom-sql (~> 3.6) + +BUNDLED WITH + 2.5.16 diff --git a/frameworks/Ruby/hanami/app/actions/db/index.rb b/frameworks/Ruby/hanami/app/actions/db/index.rb index c32ec0f1df0..98b8ed970d8 100644 --- a/frameworks/Ruby/hanami/app/actions/db/index.rb +++ b/frameworks/Ruby/hanami/app/actions/db/index.rb @@ -8,7 +8,7 @@ class Index < HelloWorld::Action include Deps["persistence.rom"] def handle(*, response) - world = rom.relations[:World].where(id: random_id).one + world = rom.relations[:World].by_pk(random_id).one response.headers['Server'] = 'hanami' response.headers['Date'] = Time.now.httpdate response.format = :json diff --git a/frameworks/Ruby/hanami/app/actions/queries/index.rb b/frameworks/Ruby/hanami/app/actions/queries/index.rb new file mode 100644 index 00000000000..5a1d0bd1419 --- /dev/null +++ b/frameworks/Ruby/hanami/app/actions/queries/index.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module HelloWorld + module Actions + module Queries + class Index < HelloWorld::Action + QUERY_RANGE = 1..10_000 # range of IDs in the Fortune DB + ALL_IDS = QUERY_RANGE.to_a # enumeration of all the IDs in fortune DB + MIN_QUERIES = 1 # min number of records that can be retrieved + MAX_QUERIES = 500 # max number of records that can be retrieved + + include Deps["persistence.rom"] + + def handle(request, response) + worlds = ALL_IDS.sample(queries(request)).map do |id| + rom.relations[:World].by_pk(id).one + end + response.headers['Server'] = 'hanami' + response.headers['Date'] = Time.now.httpdate + response.format = :json + response.body = worlds.to_json + end + + private + + def queries(request) + request.params[:queries].to_i.clamp(MIN_QUERIES, MAX_QUERIES) + end + end + end + end +end diff --git a/frameworks/Ruby/hanami/app/actions/updates/index.rb b/frameworks/Ruby/hanami/app/actions/updates/index.rb new file mode 100644 index 00000000000..54f963f7bf2 --- /dev/null +++ b/frameworks/Ruby/hanami/app/actions/updates/index.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module HelloWorld + module Actions + module Updates + class Index < HelloWorld::Action + QUERY_RANGE = 1..10_000 # range of IDs in the Fortune DB + ALL_IDS = QUERY_RANGE.to_a # enumeration of all the IDs in fortune DB + MIN_QUERIES = 1 # min number of records that can be retrieved + MAX_QUERIES = 500 # max number of records that can be retrieved + + include Deps["persistence.rom"] + + def handle(request, response) + worlds = ALL_IDS.sample(queries(request)).map do |id| + world = rom.relations[:World].by_pk(id) + world_struct = world.one + new_value = random_id + new_value = random_id while new_value == world_struct[:randomnumber] + world_struct[:randomnumber] = new_value + world.command(:update).call(randomnumber: world_struct[:randomnumber]) + world_struct + end + response.headers['Server'] = 'hanami' + response.headers['Date'] = Time.now.httpdate + response.format = :json + response.body = worlds.to_json + end + + private + + def queries(request) + request.params[:queries].to_i.clamp(MIN_QUERIES, MAX_QUERIES) + end + + def random_id + Random.rand(QUERY_RANGE) + end + end + end + end +end diff --git a/frameworks/Ruby/hanami/benchmark_config.json b/frameworks/Ruby/hanami/benchmark_config.json index d5ee774c13f..d384577682c 100644 --- a/frameworks/Ruby/hanami/benchmark_config.json +++ b/frameworks/Ruby/hanami/benchmark_config.json @@ -2,8 +2,10 @@ "framework": "hanami", "tests": [{ "default": { - "db_url": "/db", "json_url": "/json", + "db_url": "/db", + "query_url": "/queries?queries=", + "update_url": "/updates?queries=", "plaintext_url": "/plaintext", "port": 8080, "approach": "Realistic", diff --git a/frameworks/Ruby/hanami/config/providers/persistence.rb b/frameworks/Ruby/hanami/config/providers/persistence.rb index 28234177e29..0aa12ececf6 100644 --- a/frameworks/Ruby/hanami/config/providers/persistence.rb +++ b/frameworks/Ruby/hanami/config/providers/persistence.rb @@ -5,12 +5,10 @@ require_relative '../auto_tune' num_workers, num_threads = auto_tune - opts = {} - - if (threads = num_threads) > 1 - opts[:max_connections] = (2 * Math.log(threads)).floor - opts[:pool_timeout] = 10 - end + opts = { + max_connections: 3, + pool_timeout: 10 + } config = ROM::Configuration.new(:sql, target["settings"].database_url, opts) register "config", config @@ -27,4 +25,8 @@ register "rom", ROM.container(config) end + + stop do + target["persistence.rom"].disconnect + end end diff --git a/frameworks/Ruby/hanami/config/puma.rb b/frameworks/Ruby/hanami/config/puma.rb index b360cf8a278..83e2dc90637 100644 --- a/frameworks/Ruby/hanami/config/puma.rb +++ b/frameworks/Ruby/hanami/config/puma.rb @@ -5,7 +5,7 @@ num_workers, num_threads = auto_tune workers num_workers -threads num_threads, num_threads +threads 3, 3 port ENV.fetch("HANAMI_PORT", 2300) environment ENV.fetch("HANAMI_ENV", "development") diff --git a/frameworks/Ruby/hanami/config/routes.rb b/frameworks/Ruby/hanami/config/routes.rb index 77ea9582b13..d568af27c70 100644 --- a/frameworks/Ruby/hanami/config/routes.rb +++ b/frameworks/Ruby/hanami/config/routes.rb @@ -4,6 +4,8 @@ module HelloWorld class Routes < Hanami::Routes get "/db", to: "db.index" get "/json", to: "json.index" + get "/updates", to: "updates.index" get "/plaintext", to: "plaintext.index" + get "/queries", to: "queries.index" end end diff --git a/frameworks/Ruby/hanami/hanami.dockerfile b/frameworks/Ruby/hanami/hanami.dockerfile index 6ba8e69f3e6..09892d3f9e7 100644 --- a/frameworks/Ruby/hanami/hanami.dockerfile +++ b/frameworks/Ruby/hanami/hanami.dockerfile @@ -7,15 +7,12 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends libjemalloc2 ENV LD_PRELOAD=libjemalloc.so.2 +ADD ./ /hanami WORKDIR /hanami -COPY Gemfile ./ - ENV BUNDLE_FORCE_RUBY_PLATFORM=true RUN bundle install --jobs=8 -COPY . . - EXPOSE 8080 ENV HANAMI_ENV=production diff --git a/frameworks/Ruby/rack-sequel/Gemfile b/frameworks/Ruby/rack-sequel/Gemfile index 11db7de0ce2..5389d9134d6 100644 --- a/frameworks/Ruby/rack-sequel/Gemfile +++ b/frameworks/Ruby/rack-sequel/Gemfile @@ -5,12 +5,10 @@ gem 'sequel', '~> 5.0' gem 'rack', '~> 3.0' group :mysql, optional: true do - gem 'jdbc-mysql', '~> 5.1', platforms: :jruby, require: 'jdbc/mysql' gem 'mysql2', '~> 0.4', platforms: [:ruby, :mswin] end group :postgresql, optional: true 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 @@ -21,7 +19,7 @@ group :passenger, optional: true do end group :puma, optional: true do - gem 'puma', '~> 6.4', require: false + gem 'puma', '~> 6.5', require: false end group :unicorn, optional: true do diff --git a/frameworks/Ruby/rack-sequel/Gemfile.lock b/frameworks/Ruby/rack-sequel/Gemfile.lock index 3d02b26b0ab..0913e9cca6d 100644 --- a/frameworks/Ruby/rack-sequel/Gemfile.lock +++ b/frameworks/Ruby/rack-sequel/Gemfile.lock @@ -2,8 +2,8 @@ GEM remote: https://rubygems.org/ specs: base64 (0.2.0) - bigdecimal (3.1.8) - json (2.9.1) + bigdecimal (3.1.9) + json (2.10.1) kgio (2.11.4) mysql2 (0.5.6) nio4r (2.7.4) @@ -11,15 +11,15 @@ GEM rack (>= 1.6.13) rackup (>= 2.0.0) rake (>= 12.3.3) - pg (1.5.8) - puma (6.5.0) + pg (1.5.9) + puma (6.6.0) nio4r (~> 2.0) - rack (3.1.8) + rack (3.1.11) rackup (2.2.1) rack (>= 3) raindrops (0.20.1) rake (13.2.1) - sequel (5.85.0) + sequel (5.90.0) bigdecimal sequel_pg (1.17.1) pg (>= 0.18.0, != 1.2.0) @@ -34,13 +34,11 @@ PLATFORMS DEPENDENCIES base64 - jdbc-mysql (~> 5.1) - jdbc-postgres (~> 9.4) json (~> 2.8) mysql2 (~> 0.4) passenger (~> 6.0) pg (~> 1.5) - puma (~> 6.4) + puma (~> 6.5) rack (~> 3.0) sequel (~> 5.0) sequel_pg (~> 1.6) diff --git a/frameworks/Ruby/rack/Gemfile b/frameworks/Ruby/rack/Gemfile index 83ef0486ea3..c1288cb2cda 100644 --- a/frameworks/Ruby/rack/Gemfile +++ b/frameworks/Ruby/rack/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' gem 'rack', '~> 3.0' gem 'connection_pool', '~> 2.4' gem 'jdbc-postgres', '~> 42.2', platforms: :jruby, require: 'jdbc/postgres' -gem 'json', '~> 2.8' +gem 'json', '~> 2.10' gem 'pg', '~> 1.5', platforms: %i[ruby mswin] gem 'sequel' gem 'sequel_pg', platforms: %i[ruby mswin] @@ -20,7 +20,7 @@ group :iodine, optional: true do end group :puma, optional: true do - gem 'puma', '~> 6.4' + gem 'puma', '~> 6.5' end group :unicorn, optional: true do diff --git a/frameworks/Ruby/rack/Gemfile.lock b/frameworks/Ruby/rack/Gemfile.lock index e15a39ea4cf..66efa44e788 100644 --- a/frameworks/Ruby/rack/Gemfile.lock +++ b/frameworks/Ruby/rack/Gemfile.lock @@ -2,47 +2,53 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.2) - async (2.20.0) + async (2.23.0) console (~> 1.29) fiber-annotation - io-event (~> 1.6, >= 1.6.5) - async-container (0.18.3) - async (~> 2.10) - async-http (0.83.1) + io-event (~> 1.9) + metrics (~> 0.12) + traces (~> 0.15) + async-container (0.24.0) + async (~> 2.22) + async-container-supervisor (0.5.1) + async-container (~> 0.22) + async-service + io-endpoint + memory-leak (~> 0.5) + async-http (0.87.0) async (>= 2.10.2) async-pool (~> 0.9) io-endpoint (~> 0.14) io-stream (~> 0.6) metrics (~> 0.12) - protocol-http (~> 0.43) - protocol-http1 (>= 0.28.1) - protocol-http2 (~> 0.19) + protocol-http (~> 0.49) + protocol-http1 (~> 0.30) + protocol-http2 (~> 0.22) traces (~> 0.10) - async-http-cache (0.4.4) + async-http-cache (0.4.5) async-http (~> 0.56) - async-pool (0.10.1) + async-pool (0.10.3) async (>= 1.25) - traces - async-service (0.12.0) + async-service (0.13.0) async async-container (~> 0.16) - bigdecimal (3.1.8) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) - console (1.29.0) + bigdecimal (3.1.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + console (1.30.0) fiber-annotation fiber-local (~> 1.1) json - falcon (0.48.3) + falcon (0.51.1) async - async-container (~> 0.18) + async-container (~> 0.20) + async-container-supervisor (~> 0.5.0) async-http (~> 0.75) async-http-cache (~> 0.4) async-service (~> 0.10) bundler localhost (~> 1.1) openssl (~> 3.0) - process-metrics (~> 0.2) protocol-http (~> 0.31) protocol-rack (~> 0.7) samovar (~> 2.3) @@ -50,73 +56,74 @@ GEM fiber-local (1.1.0) fiber-storage fiber-storage (1.0.0) - io-endpoint (0.14.0) - io-event (1.7.3) + io-endpoint (0.15.2) + io-event (1.9.0) io-stream (0.6.1) iodine (0.7.58) - json (2.9.1) + json (2.10.2) kgio (2.11.4) - language_server-protocol (3.17.0.3) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) localhost (1.3.1) mapping (1.1.1) - metrics (0.12.1) + memory-leak (0.5.2) + metrics (0.12.2) nio4r (2.7.4) - openssl (3.2.0) + openssl (3.3.0) parallel (1.26.3) - parser (3.3.6.0) + parser (3.3.7.1) ast (~> 2.4.1) racc pg (1.5.9) - process-metrics (0.3.0) - console (~> 1.8) - json (~> 2) - samovar (~> 2.1) protocol-hpack (1.5.1) - protocol-http (0.43.0) - protocol-http1 (0.28.1) + protocol-http (0.49.0) + protocol-http1 (0.30.0) protocol-http (~> 0.22) - protocol-http2 (0.20.0) + protocol-http2 (0.22.1) protocol-hpack (~> 1.4) - protocol-http (~> 0.18) - protocol-rack (0.11.0) + protocol-http (~> 0.47) + protocol-rack (0.11.2) protocol-http (~> 0.43) rack (>= 1.0) - puma (6.5.0) + puma (6.6.0) nio4r (~> 2.0) racc (1.8.1) - rack (3.1.8) - rack-test (2.1.0) + rack (3.1.11) + rack-test (2.2.0) rack (>= 1.3) rainbow (3.1.1) raindrops (0.20.1) - regexp_parser (2.9.2) - rubocop (1.68.0) + regexp_parser (2.10.0) + rubocop (1.73.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.35.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.1) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) samovar (2.3.0) console (~> 1.0) mapping (~> 1.0) - sequel (5.86.0) + sequel (5.90.0) bigdecimal sequel_pg (1.17.1) pg (>= 0.18.0, != 1.2.0) sequel (>= 4.38.0) - traces (0.14.1) + traces (0.15.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2023.3) tzinfo (>= 1.0.0) - unicode-display_width (2.6.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -130,9 +137,9 @@ DEPENDENCIES falcon (~> 0.47) iodine (~> 0.7) jdbc-postgres (~> 42.2) - json (~> 2.8) + json (~> 2.10) pg (~> 1.5) - puma (~> 6.4) + puma (~> 6.5) rack (~> 3.0) rack-test rubocop diff --git a/frameworks/Ruby/rack/README.md b/frameworks/Ruby/rack/README.md index 65783108d2e..478315eb1d0 100644 --- a/frameworks/Ruby/rack/README.md +++ b/frameworks/Ruby/rack/README.md @@ -13,12 +13,12 @@ The tests were run with: * [Ruby 3.4](http://www.ruby-lang.org/) * [JRuby 9.4](http://jruby.org/) -* [Rack 3.0.7](http://rack.github.com/) +* [Rack 3.1](http://rack.github.com/) * [Unicorn 6.1.0](http://unicorn.bogomips.org/) * [Puma 6.4](http://puma.io/) * [Iodine](https://github.com/boazsegev/iodine) * [Falcon](https://github.com/socketry/falcon) -* [Sequel 5.68.0](https://sequel.jeremyevans.net/) +* [Sequel 5](https://sequel.jeremyevans.net/) ## Paths & Source for Tests diff --git a/frameworks/Ruby/rage-sequel/Gemfile.lock b/frameworks/Ruby/rage-sequel/Gemfile.lock index d1ad00bb988..0bb226b818b 100644 --- a/frameworks/Ruby/rage-sequel/Gemfile.lock +++ b/frameworks/Ruby/rage-sequel/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: bigdecimal (3.1.9) pg (1.5.9) - rack (2.2.10) + rack (2.2.13) rack-test (2.2.0) rack (>= 1.3) rage-iodine (4.0.0) diff --git a/frameworks/Ruby/rails/Gemfile b/frameworks/Ruby/rails/Gemfile index 0afad6b04cc..4adfe82d29e 100644 --- a/frameworks/Ruby/rails/Gemfile +++ b/frameworks/Ruby/rails/Gemfile @@ -26,5 +26,5 @@ group :falcon, optional: true do end group :puma, optional: true do - gem 'puma', '~> 6.4', require: false + gem 'puma', '~> 6.5', require: false end diff --git a/frameworks/Ruby/rails/Gemfile.lock b/frameworks/Ruby/rails/Gemfile.lock index b048da6986e..2f8f40f851a 100644 --- a/frameworks/Ruby/rails/Gemfile.lock +++ b/frameworks/Ruby/rails/Gemfile.lock @@ -1,29 +1,29 @@ GEM remote: https://rubygems.org/ specs: - actioncable (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) - actionmailer (8.0.0) - actionpack (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activesupport (= 8.0.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (8.0.0) - actionview (= 8.0.0) - activesupport (= 8.0.0) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) rack (>= 2.2.4) rack-session (>= 1.0.1) @@ -31,35 +31,35 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (8.0.0) - actionpack (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (8.0.0) - activesupport (= 8.0.0) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (8.0.0) - activesupport (= 8.0.0) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (8.0.0) - activesupport (= 8.0.0) - activerecord (8.0.0) - activemodel (= 8.0.0) - activesupport (= 8.0.0) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) - activestorage (8.0.0) - actionpack (= 8.0.0) - activejob (= 8.0.0) - activerecord (= 8.0.0) - activesupport (= 8.0.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - activesupport (8.0.0) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -73,54 +73,60 @@ GEM tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) agoo (2.15.13) - async (2.19.0) + async (2.23.0) console (~> 1.29) fiber-annotation - io-event (~> 1.6, >= 1.6.5) - async-container (0.18.3) - async (~> 2.10) - async-http (0.82.3) + io-event (~> 1.9) + metrics (~> 0.12) + traces (~> 0.15) + async-container (0.24.0) + async (~> 2.22) + async-container-supervisor (0.5.1) + async-container (~> 0.22) + async-service + io-endpoint + memory-leak (~> 0.5) + async-http (0.87.0) async (>= 2.10.2) async-pool (~> 0.9) io-endpoint (~> 0.14) io-stream (~> 0.6) metrics (~> 0.12) - protocol-http (~> 0.37) - protocol-http1 (>= 0.28.1) - protocol-http2 (~> 0.19) + protocol-http (~> 0.49) + protocol-http1 (~> 0.30) + protocol-http2 (~> 0.22) traces (~> 0.10) - async-http-cache (0.4.4) + async-http-cache (0.4.5) async-http (~> 0.56) - async-pool (0.10.1) + async-pool (0.10.3) async (>= 1.25) - traces - async-service (0.12.0) + async-service (0.13.0) async async-container (~> 0.16) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.3.0) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) - console (1.29.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + console (1.30.0) fiber-annotation fiber-local (~> 1.1) json crass (1.0.6) date (3.4.1) drb (2.2.1) - erubi (1.13.0) - falcon (0.48.3) + erubi (1.13.1) + falcon (0.51.1) async - async-container (~> 0.18) + async-container (~> 0.20) + async-container-supervisor (~> 0.5.0) async-http (~> 0.75) async-http-cache (~> 0.4) async-service (~> 0.10) bundler localhost (~> 1.1) openssl (~> 3.0) - process-metrics (~> 0.2) protocol-http (~> 0.31) protocol-rack (~> 0.7) samovar (~> 2.3) @@ -130,20 +136,21 @@ GEM fiber-storage (1.0.0) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.6) + i18n (1.14.7) concurrent-ruby (~> 1.0) io-console (0.8.0) - io-endpoint (0.14.0) - io-event (1.7.3) + io-endpoint (0.15.2) + io-event (1.9.0) io-stream (0.6.1) iodine (0.7.58) - irb (1.14.1) + irb (1.15.1) + pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.9.1) + json (2.10.1) localhost (1.3.1) - logger (1.6.2) - loofah (2.23.1) + logger (1.6.6) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -153,7 +160,8 @@ GEM net-smtp mapping (1.1.1) marcel (1.0.4) - metrics (0.12.1) + memory-leak (0.5.2) + metrics (0.12.2) mini_mime (1.1.5) mini_portile2 (2.8.8) minitest (5.25.4) @@ -164,7 +172,7 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.5.0) + net-smtp (0.5.1) net-protocol nio4r (2.7.4) nokogiri (1.18.3) @@ -174,93 +182,93 @@ GEM racc (~> 1.4) nokogiri (1.18.3-x86_64-linux-gnu) racc (~> 1.4) - openssl (3.2.0) + openssl (3.3.0) pg (1.5.9) - process-metrics (0.3.0) - console (~> 1.8) - json (~> 2) - samovar (~> 2.1) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) protocol-hpack (1.5.1) - protocol-http (0.42.0) - protocol-http1 (0.28.1) + protocol-http (0.49.0) + protocol-http1 (0.30.0) protocol-http (~> 0.22) - protocol-http2 (0.19.4) + protocol-http2 (0.22.1) protocol-hpack (~> 1.4) - protocol-http (~> 0.18) - traces - protocol-rack (0.10.1) - protocol-http (~> 0.37) + protocol-http (~> 0.47) + protocol-rack (0.11.2) + protocol-http (~> 0.43) rack (>= 1.0) - psych (5.2.1) + psych (5.2.3) date stringio - puma (6.5.0) + puma (6.6.0) nio4r (~> 2.0) racc (1.8.1) - rack (3.1.10) - rack-session (2.0.0) + rack (3.1.12) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) - rails (8.0.0) - actioncable (= 8.0.0) - actionmailbox (= 8.0.0) - actionmailer (= 8.0.0) - actionpack (= 8.0.0) - actiontext (= 8.0.0) - actionview (= 8.0.0) - activejob (= 8.0.0) - activemodel (= 8.0.0) - activerecord (= 8.0.0) - activestorage (= 8.0.0) - activesupport (= 8.0.0) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 8.0.0) + railties (= 8.0.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (8.0.0) - actionpack (= 8.0.0) - activesupport (= 8.0.0) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rake (13.2.1) - rdoc (6.8.1) + rdoc (6.12.0) psych (>= 4.0.0) - redis (5.3.0) + redis (5.4.0) redis-client (>= 0.22.0) - redis-client (0.22.2) + redis-client (0.24.0) connection_pool - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) samovar (2.3.0) console (~> 1.0) mapping (~> 1.0) - securerandom (0.4.0) - stringio (3.1.2) + securerandom (0.4.1) + stringio (3.1.5) thor (1.3.2) timeout (0.4.3) - traces (0.14.1) + traces (0.15.2) trilogy (2.8.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2024.2) + tzinfo-data (1.2025.1) tzinfo (>= 1.0.0) uri (1.0.3) useragent (0.16.11) - websocket-driver (0.7.6) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.7.1) + zeitwerk (2.7.2) PLATFORMS ruby @@ -272,7 +280,7 @@ DEPENDENCIES falcon (~> 0.47) iodine (~> 0.7) pg (~> 1.5) - puma (~> 6.4) + puma (~> 6.5) rackup rails (~> 8.0.0) redis (~> 5.0) diff --git a/frameworks/Ruby/rails/app/controllers/application_controller.rb b/frameworks/Ruby/rails/app/controllers/application_controller.rb index 02f927caed7..0ef204a6b6b 100644 --- a/frameworks/Ruby/rails/app/controllers/application_controller.rb +++ b/frameworks/Ruby/rails/app/controllers/application_controller.rb @@ -1,11 +1,13 @@ # frozen_string_literal: true class ApplicationController < ActionController::Base - before_action :add_header + if defined?(Agoo) || defined?(Falcon) || defined?(Puma) + before_action :add_date_header + end private - def add_header + def add_date_header response.set_header('Date', Time.now.httpdate) end end diff --git a/frameworks/Ruby/rails/config/application.rb b/frameworks/Ruby/rails/config/application.rb index 963357fb4e6..8f5abd7901b 100644 --- a/frameworks/Ruby/rails/config/application.rb +++ b/frameworks/Ruby/rails/config/application.rb @@ -21,7 +21,7 @@ module Hello class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults Rails::VERSION::STRING.to_f # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. diff --git a/frameworks/Ruby/roda-sequel/Gemfile.lock b/frameworks/Ruby/roda-sequel/Gemfile.lock index 283bf222111..cb136ca6029 100644 --- a/frameworks/Ruby/roda-sequel/Gemfile.lock +++ b/frameworks/Ruby/roda-sequel/Gemfile.lock @@ -2,26 +2,26 @@ GEM remote: https://rubygems.org/ specs: base64 (0.2.0) - bigdecimal (3.1.8) - erubi (1.13.0) + bigdecimal (3.1.9) + erubi (1.13.1) iodine (0.7.58) - json (2.9.1) + json (2.10.1) kgio (2.11.4) mysql2 (0.5.6) nio4r (2.7.4) - pg (1.5.8) - puma (6.5.0) + pg (1.5.9) + puma (6.6.0) nio4r (~> 2.0) - rack (3.1.8) + rack (3.1.11) raindrops (0.20.1) - roda (3.85.0) + roda (3.89.0) rack - sequel (5.85.0) + sequel (5.90.0) bigdecimal sequel_pg (1.17.1) pg (>= 0.18.0, != 1.2.0) sequel (>= 4.38.0) - tilt (2.4.0) + tilt (2.6.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) diff --git a/frameworks/Ruby/sinatra-sequel/Gemfile.lock b/frameworks/Ruby/sinatra-sequel/Gemfile.lock index 4f084bcd3b9..40b1cad63db 100644 --- a/frameworks/Ruby/sinatra-sequel/Gemfile.lock +++ b/frameworks/Ruby/sinatra-sequel/Gemfile.lock @@ -2,44 +2,48 @@ GEM remote: https://rubygems.org/ specs: base64 (0.2.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) iodine (0.7.58) - json (2.9.1) + json (2.10.1) kgio (2.11.4) + logger (1.6.6) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) mysql2 (0.5.6) nio4r (2.7.4) - passenger (6.0.24) + passenger (6.0.26) rack (>= 1.6.13) rackup (>= 2.0.0) rake (>= 12.3.3) - pg (1.5.8) - puma (6.5.0) + pg (1.5.9) + puma (6.6.0) nio4r (~> 2.0) - rack (3.1.8) - rack-protection (4.0.0) + rack (3.1.12) + rack-protection (4.1.1) base64 (>= 0.1.0) + logger (>= 1.6.0) rack (>= 3.0.0, < 4) - rack-session (2.0.0) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) rackup (2.2.1) rack (>= 3) raindrops (0.20.1) rake (13.2.1) ruby2_keywords (0.0.5) - sequel (5.85.0) + sequel (5.90.0) bigdecimal sequel_pg (1.17.1) pg (>= 0.18.0, != 1.2.0) sequel (>= 4.38.0) - sinatra (4.0.0) + sinatra (4.1.1) + logger (>= 1.6.0) mustermann (~> 3.0) rack (>= 3.0.0, < 4) - rack-protection (= 4.0.0) + rack-protection (= 4.1.1) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) - tilt (2.4.0) + tilt (2.6.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) diff --git a/frameworks/Ruby/sinatra-sequel/hello_world.rb b/frameworks/Ruby/sinatra-sequel/hello_world.rb index 454c77e5a16..3f4380aecb5 100644 --- a/frameworks/Ruby/sinatra-sequel/hello_world.rb +++ b/frameworks/Ruby/sinatra-sequel/hello_world.rb @@ -10,6 +10,9 @@ class HelloWorld < Sinatra::Base # XSS, CSRF, IP spoofing, etc. protection are not explicitly required disable :protection + # disable host_authorization for all environments + set :host_authorization, { permitted_hosts: [] } + # Only add the charset parameter to specific content types per the requirements set :add_charset, [mime_type(:html)] end diff --git a/frameworks/Ruby/sinatra/Gemfile b/frameworks/Ruby/sinatra/Gemfile index c80246d6a35..70a541e6be1 100644 --- a/frameworks/Ruby/sinatra/Gemfile +++ b/frameworks/Ruby/sinatra/Gemfile @@ -12,6 +12,10 @@ group :postgresql, optional: true do gem 'pg', '~> 1.5', platforms: [:ruby, :mswin] end +group :iodine, optional: true do + gem 'iodine', '~> 0.7', platforms: [:ruby, :mswin], require: false +end + group :passenger, optional: true do gem 'passenger', '~> 6.0', platforms: [:ruby, :mswin], require: false end @@ -20,7 +24,7 @@ group :puma, optional: true do gem 'puma', '~> 6.4', require: false end -group :unicorn do +group :unicorn, optional: true do gem 'unicorn', '~> 6.1', platforms: [:ruby, :mswin], require: false end diff --git a/frameworks/Ruby/sinatra/Gemfile.lock b/frameworks/Ruby/sinatra/Gemfile.lock index 76b66f8fedd..93710d657af 100644 --- a/frameworks/Ruby/sinatra/Gemfile.lock +++ b/frameworks/Ruby/sinatra/Gemfile.lock @@ -23,33 +23,35 @@ GEM agoo (2.15.13) base64 (0.2.0) benchmark (0.4.0) - bigdecimal (3.1.8) - concurrent-ruby (1.3.4) - connection_pool (2.4.1) + bigdecimal (3.1.9) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) drb (2.2.1) - i18n (1.14.6) + i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.9.1) + iodine (0.7.58) + json (2.10.1) kgio (2.11.4) - logger (1.6.4) + logger (1.6.6) minitest (5.25.4) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) mysql2 (0.5.6) nio4r (2.7.4) - passenger (6.0.24) + passenger (6.0.26) rack (>= 1.6.13) rackup (>= 2.0.0) rake (>= 12.3.3) pg (1.5.9) - puma (6.5.0) + puma (6.6.0) nio4r (~> 2.0) - rack (3.1.8) + rack (3.1.11) rack-protection (4.1.1) base64 (>= 0.1.0) logger (>= 1.6.0) rack (>= 3.0.0, < 4) - rack-session (2.0.0) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) rackup (2.2.1) rack (>= 3) @@ -64,14 +66,14 @@ GEM rack-protection (= 4.1.1) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) - tilt (2.5.0) + tilt (2.6.0) timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) - uri (1.0.2) + uri (1.0.3) PLATFORMS ruby @@ -80,6 +82,7 @@ PLATFORMS DEPENDENCIES activerecord (~> 8.0) agoo + iodine (~> 0.7) json (~> 2.8) mysql2 (~> 0.5) passenger (~> 6.0) diff --git a/frameworks/Ruby/sinatra/benchmark_config.json b/frameworks/Ruby/sinatra/benchmark_config.json index 3e318c9aa58..611f763606b 100644 --- a/frameworks/Ruby/sinatra/benchmark_config.json +++ b/frameworks/Ruby/sinatra/benchmark_config.json @@ -66,6 +66,28 @@ "versus": "rack-postgres-agoo-mri", "notes": "" }, + "postgres-iodine-mri": { + "json_url": "/json", + "db_url": "/db", + "query_url": "/queries?queries=", + "fortune_url": "/fortunes", + "update_url": "/updates?queries=", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "sinatra", + "language": "Ruby", + "orm": "Full", + "platform": "Rack", + "webserver": "Iodine", + "os": "Linux", + "database_os": "Linux", + "display_name": "sinatra-postgres-iodine-mri", + "versus": "rack-postgres-iodine-mri", + "notes": "" + }, "postgres-passenger-mri": { "db_url": "/db", "query_url": "/queries?queries=", diff --git a/frameworks/Ruby/sinatra/boot.rb b/frameworks/Ruby/sinatra/boot.rb index 261e12f1145..c0c905d21ee 100644 --- a/frameworks/Ruby/sinatra/boot.rb +++ b/frameworks/Ruby/sinatra/boot.rb @@ -15,6 +15,8 @@ 'puma' elsif defined?(Unicorn) 'unicorn' + elsif defined?(Iodine) + 'iodine' elsif defined?(Agoo) 'agoo' end diff --git a/frameworks/Ruby/sinatra/hello_world.rb b/frameworks/Ruby/sinatra/hello_world.rb index 4cad26711d4..54afe906d6a 100644 --- a/frameworks/Ruby/sinatra/hello_world.rb +++ b/frameworks/Ruby/sinatra/hello_world.rb @@ -10,6 +10,9 @@ class HelloWorld < Sinatra::Base # XSS, CSRF, IP spoofing, etc. protection are not explicitly required disable :protection + # disable it for all environments + set :host_authorization, { permitted_hosts: [] } + # Only add the charset parameter to specific content types per the requirements set :add_charset, [mime_type(:html)] end diff --git a/frameworks/Ruby/sinatra/sinatra-postgres-iodine-mri.dockerfile b/frameworks/Ruby/sinatra/sinatra-postgres-iodine-mri.dockerfile new file mode 100644 index 00000000000..30dac9dc01a --- /dev/null +++ b/frameworks/Ruby/sinatra/sinatra-postgres-iodine-mri.dockerfile @@ -0,0 +1,20 @@ +FROM ruby:3.4 + +ENV RUBY_YJIT_ENABLE=1 + +# Use Jemalloc +RUN apt-get update && \ + apt-get install -y --no-install-recommends libjemalloc2 +ENV LD_PRELOAD=libjemalloc.so.2 + +ADD ./ /sinatra +WORKDIR /sinatra + +ENV BUNDLE_WITH=postgresql:iodine +RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile + +ENV DBTYPE=postgresql + +EXPOSE 8080 + +CMD bundle exec iodine -p 8080 -w $(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1) diff --git a/frameworks/Rust/actix/Cargo.lock b/frameworks/Rust/actix/Cargo.lock index 5bce2a3656e..321ff2870fa 100644 --- a/frameworks/Rust/actix/Cargo.lock +++ b/frameworks/Rust/actix/Cargo.lock @@ -1,16 +1,17 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "actix" -version = "0.13.0" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" +checksum = "de7fa236829ba0841304542f7614c42b80fca007455315c45c785ccfa873a85b" dependencies = [ + "actix-macros", "actix-rt", "actix_derive", - "bitflags", + "bitflags 2.9.0", "bytes", "crossbeam-channel", "futures-core", @@ -23,24 +24,7 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", - "tokio-util 0.7.8", -] - -[[package]] -name = "actix-codec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36c014a3e811624313b51a227b775ecba55d36ef9462bbaac7d4f13e54c9271" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-sink", - "log", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util 0.6.10", + "tokio-util", ] [[package]] @@ -49,30 +33,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-sink", "memchr", "pin-project-lite", "tokio", - "tokio-util 0.7.8", + "tokio-util", "tracing", ] [[package]] name = "actix-http" -version = "3.3.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" +checksum = "d48f96fc3003717aeb9856ca3d02a8c7de502667ad76eeacd830b48d2e91fac4" dependencies = [ - "actix-codec 0.5.1", + "actix-codec", "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.3", - "base64 0.21.2", - "bitflags", + "ahash", + "base64 0.22.1", + "bitflags 2.9.0", "brotli", "bytes", "bytestring", @@ -84,17 +68,17 @@ dependencies = [ "http", "httparse", "httpdate", - "itoa 1.0.8", + "itoa", "language-tags", "local-channel", "mime", "percent-encoding", "pin-project-lite", - "rand", + "rand 0.8.5", "sha1", "smallvec", "tokio", - "tokio-util 0.7.8", + "tokio-util", "tracing", "zstd", ] @@ -111,22 +95,24 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" dependencies = [ "bytestring", + "cfg-if", "http", "regex", + "regex-lite", "serde", "tracing", ] [[package]] name = "actix-rt" -version = "2.8.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" dependencies = [ "actix-macros", "futures-core", @@ -174,11 +160,11 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.3.1" +version = "4.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" +checksum = "9180d76e5cc7ccbc4d60a506f2c727730b154010262df5b910eb17dbe4b8cb38" dependencies = [ - "actix-codec 0.5.1", + "actix-codec", "actix-http", "actix-macros", "actix-router", @@ -187,7 +173,7 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.7.6", + "ahash", "bytes", "bytestring", "cfg-if", @@ -196,33 +182,34 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "http", - "itoa 1.0.8", + "impl-more", + "itoa", "language-tags", "log", "mime", "once_cell", "pin-project-lite", "regex", + "regex-lite", "serde", "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.4.9", - "time 0.3.23", + "socket2 0.5.8", + "time 0.3.37", "url", ] [[package]] name = "actix-web-codegen" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9" +checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -251,17 +238,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.3" @@ -269,7 +245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -300,9 +276,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -330,40 +306,88 @@ dependencies = [ ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "anstream" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ - "winapi", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "askama" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb98f10f371286b177db5eeb9a6e5396609555686a35e1d4f7b9a9c6d8af0139" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" dependencies = [ "askama_derive", "askama_escape", - "askama_shared", + "humansize", + "num-traits", + "percent-encoding", ] [[package]] name = "askama_derive" -version = "0.11.2" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87bf87e6e8b47264efa9bde63d6225c6276a52e05e91bf37eaa8afd0032d6b71" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" dependencies = [ - "askama_shared", + "askama_parser", + "basic-toml", + "mime", + "mime_guess", "proc-macro2", - "syn 1.0.109", + "quote", + "serde", + "syn 2.0.98", ] [[package]] @@ -373,45 +397,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" [[package]] -name = "askama_shared" -version = "0.12.2" +name = "askama_parser" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf722b94118a07fcbc6640190f247334027685d4e218b794dbfe17c32bf38ed0" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" dependencies = [ - "askama_escape", - "humansize", - "mime", - "mime_guess", "nom", - "num-traits", - "percent-encoding", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", - "toml", ] [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "syn 2.0.98", ] [[package]] @@ -447,27 +449,39 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "basic-toml" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +dependencies = [ + "serde", +] + [[package]] name = "bindgen" -version = "0.59.2" +version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ - "bitflags", + "bitflags 2.9.0", "cexpr", "clang-sys", - "clap", - "env_logger", - "lazy_static", - "lazycell", + "itertools", "log", - "peeking_take_while", + "prettyplease 0.2.29", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "which", + "syn 2.0.98", ] [[package]] @@ -476,6 +490,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + [[package]] name = "bitvec" version = "1.0.1" @@ -499,9 +519,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.3.4" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -510,9 +530,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -520,31 +540,25 @@ dependencies = [ [[package]] name = "bson" -version = "2.6.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aeb8bae494e49dbc330dd23cf78f6f7accee22f640ce3ab17841badaa4ce232" +checksum = "068208f2b6fcfa27a7f1ee37488d2bb8ba2640f68f5475d08e1d9130696aba59" dependencies = [ - "ahash 0.7.6", + "ahash", "base64 0.13.1", "bitvec", "hex", - "indexmap 1.9.3", + "indexmap 2.7.1", "js-sys", - "lazy_static", - "rand", + "once_cell", + "rand 0.8.5", "serde", "serde_bytes", "serde_json", - "time 0.3.23", + "time 0.3.37", "uuid", ] -[[package]] -name = "buf-min" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4531c8a9fe2fb94e0d2afdf6bb4effd4797baf98dd26b6e20be71a92ac78e8d" - [[package]] name = "buf-min" version = "0.7.1" @@ -580,11 +594,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", + "libc", + "shlex", ] [[package]] @@ -612,6 +628,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "time 0.1.45", "wasm-bindgen", "winapi", @@ -629,27 +646,38 @@ dependencies = [ ] [[package]] -name = "clap" -version = "2.34.0" +name = "cmake" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap", - "unicode-width", - "vec_map", + "cc", ] [[package]] -name = "cmake" -version = "0.1.50" +name = "colorchoice" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" dependencies = [ - "cc", + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "tiny-keccak", ] [[package]] @@ -665,7 +693,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" dependencies = [ "percent-encoding", - "time 0.3.23", + "time 0.3.37", "version_check", ] @@ -712,6 +740,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + [[package]] name = "crypto-common" version = "0.1.6" @@ -724,9 +758,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -734,27 +768,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 1.0.109", + "strsim", + "syn 2.0.98", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -765,27 +799,27 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "deadpool" -version = "0.9.5" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +checksum = "5ed5957ff93768adf7a65ab167a17835c3d2c3c50d084fe305174c112f468e2f" dependencies = [ - "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", "tokio", ] [[package]] name = "deadpool-postgres" -version = "0.10.5" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a24a9d49deefe610b8b60c767a7412e9a931d79a89415cd2d2d71630ca8d7" +checksum = "3d697d376cbfa018c23eb4caab1fd1883dd9c906a8c034e8d9a3cb06a7e0bef9" dependencies = [ + "async-trait", "deadpool", - "log", + "getrandom 0.2.10", "tokio", "tokio-postgres", + "tracing", ] [[package]] @@ -798,14 +832,35 @@ dependencies = [ ] [[package]] -name = "derivative" -version = "2.2.0" +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive-syn-parse" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", +] + +[[package]] +name = "derive-where" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -817,31 +872,43 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.109", ] [[package]] name = "diesel" -version = "1.4.8" +version = "2.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d" +checksum = "04001f23ba8843dc315804fa324000376084dfb1c30794ff68dd279e6e5696d5" dependencies = [ - "bitflags", + "bitflags 2.9.0", "byteorder", "diesel_derives", + "itoa", "pq-sys", ] [[package]] name = "diesel_derives" -version = "1.4.1" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" +checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" dependencies = [ + "diesel_table_macro_syntax", + "dsl_auto_type", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +dependencies = [ + "syn 2.0.98", ] [[package]] @@ -855,6 +922,31 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "dsl_auto_type" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +dependencies = [ + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "dtoa" version = "1.0.8" @@ -878,27 +970,37 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", +] + +[[package]] +name = "env_filter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", ] [[package]] name = "env_logger" -version = "0.9.3" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ - "atty", + "anstream", + "anstyle", + "env_filter", "humantime", "log", - "regex", - "termcolor", ] [[package]] @@ -925,9 +1027,9 @@ dependencies = [ [[package]] name = "float-cmp" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" dependencies = [ "num-traits", ] @@ -940,9 +1042,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -955,9 +1057,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -970,9 +1072,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -980,15 +1082,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -997,38 +1099,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1065,6 +1167,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.27.3" @@ -1089,23 +1203,13 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.0.0", + "indexmap 2.7.1", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util", "tracing", ] -[[package]] -name = "halfbrown" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2a3c70a9c00cc1ee87b54e89f9505f73bb17d63f1b25c9a462ba8ef885444f" -dependencies = [ - "hashbrown 0.13.2", - "serde", -] - [[package]] name = "halfbrown" version = "0.2.5" @@ -1122,39 +1226,27 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - [[package]] name = "hashbrown" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ - "ahash 0.8.3", + "ahash", "allocator-api2", ] [[package]] -name = "heck" -version = "0.4.1" +name = "hashbrown" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -1169,21 +1261,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "hmac" -version = "0.12.1" +name = "hickory-proto" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" dependencies = [ - "digest", + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.8.5", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", ] [[package]] -name = "hostname" -version = "0.3.1" +name = "hickory-resolver" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" dependencies = [ - "libc", + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", "match_cfg", "winapi", ] @@ -1196,7 +1333,7 @@ checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", - "itoa 1.0.8", + "itoa", ] [[package]] @@ -1213,9 +1350,12 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humansize" -version = "1.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02296996cb8796d7c6e3bc2d9211b7802812d36999a51bb754123ead7d37d026" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] [[package]] name = "humantime" @@ -1247,187 +1387,246 @@ dependencies = [ ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "idna" -version = "0.4.0" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "indexmap" -version = "2.0.0" +name = "icu_locid_transform_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" [[package]] -name = "ipconfig" -version = "0.3.2" +name = "icu_normalizer" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "socket2 0.5.3", - "widestring", - "windows-sys", - "winreg", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "ipnet" -version = "2.8.0" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" [[package]] -name = "itoa" -version = "0.4.8" +name = "icu_properties" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] [[package]] -name = "itoa" -version = "1.0.8" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "jobserver" -version = "0.1.26" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "libc", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "js-sys" -version = "0.3.64" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "wasm-bindgen", + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] -name = "language-tags" -version = "0.3.2" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] [[package]] -name = "lazycell" -version = "1.3.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] [[package]] -name = "lexical-core" -version = "0.8.5" +name = "impl-more" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" + +[[package]] +name = "indexmap" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", + "autocfg", + "hashbrown 0.12.3", + "serde", ] [[package]] -name = "lexical-parse-float" -version = "0.8.5" +name = "indexmap" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", + "equivalent", + "hashbrown 0.15.2", + "serde", ] [[package]] -name = "lexical-parse-integer" -version = "0.8.6" +name = "ipconfig" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "lexical-util", - "static_assertions", + "socket2 0.5.8", + "widestring", + "windows-sys 0.48.0", + "winreg", ] [[package]] -name = "lexical-util" -version = "0.8.5" +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "static_assertions", + "either", ] [[package]] -name = "lexical-write-float" -version = "0.8.5" +name = "itoa" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" + +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", + "libc", ] [[package]] -name = "lexical-write-integer" -version = "0.8.5" +name = "js-sys" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ - "lexical-util", - "static_assertions", + "wasm-bindgen", ] +[[package]] +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" + [[package]] name = "libc" -version = "0.2.147" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libloading" @@ -1439,12 +1638,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + [[package]] name = "linked-hash-map" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + [[package]] name = "local-channel" version = "0.1.3" @@ -1475,9 +1686,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "lru-cache" @@ -1489,16 +1700,58 @@ dependencies = [ ] [[package]] -name = "match_cfg" -version = "0.1.0" +name = "macro_magic" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.98", +] [[package]] -name = "matches" -version = "0.1.10" +name = "macro_magic_core" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "macro_magic_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "md-5" @@ -1555,33 +1808,37 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "mongodb" -version = "2.6.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd85ec209a5b84fd9f54b9e381f6fa17462bc74160d018fc94fd8b9f61faa8" +checksum = "9a93560fa3ec754ed9aa0954ae8307c5997150dbba7aa735173b514660088475" dependencies = [ "async-trait", "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "bson", "chrono", - "derivative", + "derive-where", "derive_more", "futures-core", "futures-executor", "futures-io", "futures-util", "hex", + "hickory-proto", + "hickory-resolver", "hmac", - "lazy_static", + "macro_magic", "md-5", + "mongodb-internal-macros", + "once_cell", "pbkdf2", "percent-encoding", - "rand", + "rand 0.8.5", "rustc_version_runtime", "rustls", "rustls-pemfile", @@ -1590,21 +1847,31 @@ dependencies = [ "serde_with", "sha-1", "sha2", - "socket2 0.4.9", + "socket2 0.5.8", "stringprep", - "strsim 0.10.0", + "strsim", "take_mut", "thiserror", "tokio", "tokio-rustls", - "tokio-util 0.7.8", - "trust-dns-proto", - "trust-dns-resolver", + "tokio-util", "typed-builder", "uuid", "webpki-roots", ] +[[package]] +name = "mongodb-internal-macros" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b3dace6c4f33db61d492b3d3b02f4358687a1eb59457ffef6f6cfe461cdb54" +dependencies = [ + "macro_magic", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "nom" version = "7.1.3" @@ -1615,6 +1882,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.15" @@ -1630,7 +1903,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi", "libc", ] @@ -1645,9 +1918,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "parking_lot" @@ -1667,9 +1940,9 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-targets", + "windows-targets 0.48.1", ] [[package]] @@ -1687,17 +1960,11 @@ dependencies = [ "digest", ] -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -1719,9 +1986,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1731,39 +1998,45 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "postgres-protocol" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" dependencies = [ - "base64 0.21.2", + "base64 0.22.1", "byteorder", "bytes", "fallible-iterator", "hmac", "md-5", "memchr", - "rand", + "rand 0.9.0", "sha2", "stringprep", ] [[package]] name = "postgres-types" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" dependencies = [ "bytes", "fallible-iterator", "postgres-protocol", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1789,11 +2062,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" +dependencies = [ + "proc-macro2", + "syn 2.0.98", +] + [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -1806,9 +2089,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.29" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1826,8 +2109,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "zerocopy", ] [[package]] @@ -1837,7 +2131,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -1846,7 +2150,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.10", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.1", ] [[package]] @@ -1855,7 +2168,36 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -1881,6 +2223,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-lite" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" + [[package]] name = "regex-syntax" version = "0.7.4" @@ -1897,12 +2245,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "ring" version = "0.16.20" @@ -1913,11 +2255,25 @@ dependencies = [ "libc", "once_cell", "spin", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.10", + "libc", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1926,18 +2282,9 @@ 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.2.3" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -1945,29 +2292,29 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver", ] [[package]] name = "rustc_version_runtime" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31b7153270ebf48bf91c65ae5b0c00e749c4cfad505f66530ac74950249582f" +checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d" dependencies = [ - "rustc_version 0.2.3", - "semver 0.9.0", + "rustc_version", + "semver", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring", + "ring 0.17.11", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -1979,6 +2326,16 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.11", + "untrusted 0.9.0", +] + [[package]] name = "ryu" version = "1.0.14" @@ -1997,17 +2354,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -2016,17 +2364,11 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" -version = "1.0.171" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] @@ -2042,13 +2384,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", ] [[package]] @@ -2057,8 +2399,8 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" dependencies = [ - "indexmap 2.0.0", - "itoa 1.0.8", + "indexmap 2.7.1", + "itoa", "ryu", "serde", ] @@ -2070,31 +2412,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.8", + "itoa", "ryu", "serde", ] [[package]] name = "serde_with" -version = "1.14.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.7.1", "serde", + "serde_derive", + "serde_json", "serde_with_macros", + "time 0.3.37", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -2147,56 +2497,45 @@ dependencies = [ [[package]] name = "simd-json" -version = "0.4.15" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3aaa7729b636ed4843efa96722f0d5823825b4f388d74c83757a3227f64d4" +checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" dependencies = [ - "halfbrown 0.1.18", + "getrandom 0.2.10", + "halfbrown", + "ref-cast", "serde", "serde_json", "simdutf8", - "value-trait 0.2.12", -] - -[[package]] -name = "simd-json" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f07a84c7456b901b8dd2c1d44caca8b0fd2c2616206ee5acc9d9da61e8d9ec" -dependencies = [ - "getrandom", - "halfbrown 0.2.5", - "lexical-core", - "serde", - "serde_json", - "simdutf8", - "value-trait 0.6.1", + "value-trait", ] [[package]] name = "simd-json-derive" -version = "0.12.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601202a467f1d17a37b20d6d4d7bd679764ac3e9e9fc0f7a24524ba35bd55552" +checksum = "dde9e4ab4322320af4f9709170ca77dec74ef4e44db7c0600cf6f3d601b74cee" dependencies = [ "chrono", - "itoa 1.0.8", + "itoa", "ryu", - "simd-json 0.12.0", + "simd-json", "simd-json-derive-int", - "value-trait 0.6.1", + "thiserror", + "value-trait", ] [[package]] name = "simd-json-derive-int" -version = "0.12.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4826470c4520fac1e3b57c413a6e83a198bac992e3222d1c290f7909881d3df1" +checksum = "cebcbb57e77f41aee1cef06b800c6c79288b133054a478135a9a0e8e79c938dd" dependencies = [ "proc-macro2", "quote", - "simd-json 0.12.0", - "syn 2.0.25", + "simd-json", + "syn 2.0.98", + "thiserror", ] [[package]] @@ -2222,24 +2561,24 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "snmalloc-rs" -version = "0.2.28" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36acaace2719c972eab3ef6a6b3aee4495f0bf300f59715bb9cff6c5acf4ae20" +checksum = "eb317153089fdfa4d8a2eec059d40a5a23c3bde43995ea23b19121c3f621e74a" dependencies = [ "snmalloc-sys", ] [[package]] name = "snmalloc-sys" -version = "0.2.28" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35a7e6e7d5fe756bee058ddedefc7e0a9f9c8dbaa9401b48ed3c17d6578e40b5" +checksum = "065fea53d32bb77bc36cca466cb191f2e5216ebfd0ed360b1d64889ee6e559ea" dependencies = [ "cmake", ] @@ -2256,12 +2595,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2271,10 +2610,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "static_assertions" -version = "1.1.0" +name = "stable_deref_trait" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stringprep" @@ -2288,15 +2627,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" @@ -2317,15 +2650,26 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -2338,30 +2682,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "tfb-actix" -version = "3.0.0" +version = "4.0.0" dependencies = [ "actix", - "actix-codec 0.4.2", + "actix-codec", "actix-http", "actix-rt", "actix-server", @@ -2375,42 +2701,41 @@ dependencies = [ "diesel", "env_logger", "futures", - "http", "log", "mongodb", "num_cpus", - "rand", + "rand 0.9.0", "serde", "serde_json", - "simd-json 0.4.15", + "simd-json", "simd-json-derive", "snmalloc-rs", "tokio", "tokio-postgres", - "tokio-util 0.7.8", + "tokio-util", "url", - "v_htmlescape 0.14.1", + "v_htmlescape", "yarte", ] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", ] [[package]] @@ -2426,29 +2751,52 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ - "itoa 1.0.8", - "serde", + "num-conv", "time-core", - "time-macros", ] [[package]] -name = "time-core" -version = "0.1.1" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] [[package]] -name = "time-macros" -version = "0.2.10" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "time-core", + "displaydoc", + "zerovec", ] [[package]] @@ -2483,7 +2831,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.4.9", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2494,14 +2842,14 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", ] [[package]] name = "tokio-postgres" -version = "0.7.8" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" dependencies = [ "async-trait", "byteorder", @@ -2516,41 +2864,28 @@ dependencies = [ "pin-project-lite", "postgres-protocol", "postgres-types", - "socket2 0.5.3", + "rand 0.9.0", + "socket2 0.5.8", "tokio", - "tokio-util 0.7.8", + "tokio-util", + "whoami", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", -] - -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -2558,7 +2893,6 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -2579,61 +2913,28 @@ dependencies = [ "cfg-if", "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] [[package]] -name = "tracing-core" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "trust-dns-proto" -version = "0.21.2" +name = "tracing-attributes" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "log", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "url", + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] -name = "trust-dns-resolver" -version = "0.21.2" +name = "tracing-core" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto", + "once_cell", ] [[package]] @@ -2701,44 +3002,49 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna", "percent-encoding", ] [[package]] -name = "uuid" -version = "1.4.0" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" -dependencies = [ - "getrandom", - "serde", -] +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "v_escape" -version = "0.18.0" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d297315e8ca0b98255614f409699ea189e5929e820f07f69afcebf96c41f9b" -dependencies = [ - "buf-min 0.6.1", - "v_escape_derive", -] +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "v_escape_derive" -version = "0.9.1" +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe81cf194472e6ddd6545f8e91ee9780de636194c2e896b8ac201ac78389809" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ - "syn 1.0.109", + "getrandom 0.2.10", + "serde", ] [[package]] @@ -2751,46 +3057,24 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "v_htmlescape" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04b32732bcd549ad15fcb01ee63ad03dd6a0289e9ba72b8164707d1f9fa80478" -dependencies = [ - "cfg-if", - "v_escape", -] - [[package]] name = "v_htmlescape" version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" dependencies = [ - "buf-min 0.7.1", -] - -[[package]] -name = "value-trait" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe40a74a6f052b10668ef021c8c3ae56ab38269f9c0f401daa6ed36f96662fd" -dependencies = [ - "float-cmp", - "halfbrown 0.1.18", - "itoa 0.4.8", - "ryu", + "buf-min", ] [[package]] name = "value-trait" -version = "0.6.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a5b6c8ceb01263b969cac48d4a6705134d490ded13d889e52c0cfc80c6945e" +checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" dependencies = [ "float-cmp", - "halfbrown 0.2.5", - "itoa 1.0.8", + "halfbrown", + "itoa", "ryu", ] @@ -2800,12 +3084,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -2824,6 +3102,21 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[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.87" @@ -2845,7 +3138,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", "wasm-bindgen-shared", ] @@ -2867,7 +3160,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2888,34 +3181,21 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ecc0cd7cac091bf682ec5efa18b1cff79d617b84181f38b3951dbe135f607f" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] -name = "which" -version = "4.4.0" +name = "whoami" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "either", - "libc", - "once_cell", + "redox_syscall 0.5.9", + "wasite", + "web-sys", ] [[package]] @@ -2940,15 +3220,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2961,7 +3232,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.1", ] [[package]] @@ -2970,7 +3241,25 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2979,13 +3268,29 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2994,42 +3299,90 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winreg" version = "0.50.0" @@ -3037,9 +3390,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.9.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -3064,7 +3438,7 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfce1df93f3b16e5272221a559e60bbbaaa71dbc042a43996d223e51a690aab2" dependencies = [ - "buf-min 0.7.1", + "buf-min", "yarte_derive", "yarte_helpers", ] @@ -3103,15 +3477,15 @@ version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0d1076f8cee9541ea5ffbecd9102f751252c91f085e7d30a18a3ce805ebd3ee" dependencies = [ - "buf-min 0.7.1", + "buf-min", "dtoa", - "itoa 1.0.8", - "prettyplease", + "itoa", + "prettyplease 0.1.25", "ryu", "serde", "syn 1.0.109", "toml", - "v_htmlescape 0.15.8", + "v_htmlescape", ] [[package]] @@ -3125,7 +3499,7 @@ dependencies = [ "quote", "syn 1.0.109", "v_eval", - "v_htmlescape 0.15.8", + "v_htmlescape", "yarte_helpers", "yarte_parser", ] @@ -3146,32 +3520,117 @@ dependencies = [ "yarte_helpers", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ - "libc", "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/frameworks/Rust/actix/Cargo.toml b/frameworks/Rust/actix/Cargo.toml index 9544e873c89..b4862239793 100644 --- a/frameworks/Rust/actix/Cargo.toml +++ b/frameworks/Rust/actix/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tfb-actix" -version = "3.0.0" -edition = "2018" +version = "4.0.0" +edition = "2024" [[bin]] name = "tfb-web" @@ -28,41 +28,40 @@ name = "tfb-web-pg-deadpool" path = "src/main_pg_deadpool.rs" [dependencies] -anyhow = "1" -actix = "0.13" -actix-web = "4.3.1" -actix-http = "3.3.1" -actix-rt = "2" -actix-codec = "0.4" +anyhow = "1.0.96" +actix = "0.13.5" +actix-web = "4.9.0" +actix-http = "3.9.0" +actix-rt = "2.10.0" +actix-codec = "0.5" actix-server = "2" actix-service = "2" -askama = "0.11" +askama = "0.12" bytes = "1" -diesel = { version = "1.4", features = ["postgres"] } -env_logger = "0.9" -futures = "0.3.7" -http = "0.2" +diesel = { version = "2.2.7", features = ["postgres"] } +env_logger = "0.11" +futures = "0.3.31" log = { version = "0.4", features = ["release_max_level_debug"] } num_cpus = "1.13" -rand = { version = "0.8", features = ["small_rng"] } +rand = { version = "0.9", features = ["small_rng"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -simd-json = "0.4" -simd-json-derive = "0.12" -snmalloc-rs = "0.2.6" +simd-json = "0.14" +simd-json-derive = "0.15" +snmalloc-rs = "0.3.8" tokio = { version = "1", features = ["full"] } -tokio-util = "0.7.8" -tokio-postgres = "0.7.5" -deadpool-postgres = "0.10.1" -mongodb = "2.2.0" -url = "2.1" -v_htmlescape = "0.14" +tokio-util = "0.7.13" +tokio-postgres = "0.7.13" +deadpool-postgres = "0.14.1" +mongodb = "3.2.1" +url = "2.5" +v_htmlescape = "0.15" yarte = { version = "0.15", features = ["bytes-buf"] } [build-dependencies] -askama = "0.11" -bindgen = "0.59" +askama = "0.12" +bindgen = "0.71" [profile.release] lto = true diff --git a/frameworks/Rust/actix/actix-http.dockerfile b/frameworks/Rust/actix/actix-http.dockerfile index 1e2723b175d..e22a047c11a 100644 --- a/frameworks/Rust/actix/actix-http.dockerfile +++ b/frameworks/Rust/actix/actix-http.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.58 +FROM rust:1.85 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/actix/actix-server.dockerfile b/frameworks/Rust/actix/actix-server.dockerfile index ae54cdea548..6c4adac18e7 100644 --- a/frameworks/Rust/actix/actix-server.dockerfile +++ b/frameworks/Rust/actix/actix-server.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.58 +FROM rust:1.85 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/actix/actix-web-diesel.dockerfile b/frameworks/Rust/actix/actix-web-diesel.dockerfile index 43fc2424510..145ccb2fe5d 100644 --- a/frameworks/Rust/actix/actix-web-diesel.dockerfile +++ b/frameworks/Rust/actix/actix-web-diesel.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.58 +FROM rust:1.85 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/actix/actix-web-mongodb.dockerfile b/frameworks/Rust/actix/actix-web-mongodb.dockerfile index f89e9552660..beb5f47fcd3 100644 --- a/frameworks/Rust/actix/actix-web-mongodb.dockerfile +++ b/frameworks/Rust/actix/actix-web-mongodb.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.57.0 +FROM rust:1.85 ENV ACTIX_TECHEMPOWER_MONGODB_URL=mongodb://tfb-database:27017 diff --git a/frameworks/Rust/actix/actix-web-pg-deadpool.dockerfile b/frameworks/Rust/actix/actix-web-pg-deadpool.dockerfile index 0ce0a4dbaac..e3674b64588 100644 --- a/frameworks/Rust/actix/actix-web-pg-deadpool.dockerfile +++ b/frameworks/Rust/actix/actix-web-pg-deadpool.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.57.0 +FROM rust:1.85 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/actix/actix.dockerfile b/frameworks/Rust/actix/actix.dockerfile index 75e192e25f8..abe34444ab8 100644 --- a/frameworks/Rust/actix/actix.dockerfile +++ b/frameworks/Rust/actix/actix.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.58 +FROM rust:1.85.0 RUN apt-get update -yqq && apt-get install -yqq cmake g++ diff --git a/frameworks/Rust/actix/benchmark_config.json b/frameworks/Rust/actix/benchmark_config.json old mode 100755 new mode 100644 diff --git a/frameworks/Rust/actix/src/db.rs b/frameworks/Rust/actix/src/db.rs index b1a2f0673dd..1630a68a567 100644 --- a/frameworks/Rust/actix/src/db.rs +++ b/frameworks/Rust/actix/src/db.rs @@ -6,7 +6,7 @@ use bytes::{Bytes, BytesMut}; use futures::{ stream::futures_unordered::FuturesUnordered, FutureExt, StreamExt, TryStreamExt, }; -use rand::{rngs::SmallRng, thread_rng, Rng, SeedableRng}; +use rand::{rngs::SmallRng, Rng, SeedableRng}; use tokio_postgres::{connect, types::ToSql, Client, NoTls, Statement}; use crate::{ @@ -101,9 +101,9 @@ impl PgConnection { } pub async fn get_world(&self) -> Result { - let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + let mut rng = SmallRng::from_rng(&mut rand::rng()); - let random_id = (rng.gen::() % 10_000 + 1) as i32; + let random_id = (rng.random::() % 10_000 + 1) as i32; let world = self.query_one_world(random_id).await?; let mut body = BytesMut::with_capacity(40); @@ -113,12 +113,12 @@ impl PgConnection { } pub async fn get_worlds(&self, num: usize) -> Result, PgError> { - let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + let mut rng = SmallRng::from_rng(&mut rand::rng()); let worlds = FuturesUnordered::new(); for _ in 0..num { - let w_id = (rng.gen::() % 10_000 + 1) as i32; + let w_id = (rng.random::() % 10_000 + 1) as i32; worlds.push(self.query_one_world(w_id)); } @@ -126,13 +126,13 @@ impl PgConnection { } pub async fn update(&self, num: u16) -> Result, PgError> { - let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + let mut rng = SmallRng::from_rng(&mut rand::rng()); let worlds = FuturesUnordered::new(); for _ in 0..num { - let id = (rng.gen::() % 10_000 + 1) as i32; - let w_id = (rng.gen::() % 10_000 + 1) as i32; + let id = (rng.random::() % 10_000 + 1) as i32; + let w_id = (rng.random::() % 10_000 + 1) as i32; worlds.push(self.query_one_world(w_id).map(move |res| match res { Ok(mut world) => { diff --git a/frameworks/Rust/actix/src/db_diesel.rs b/frameworks/Rust/actix/src/db_diesel.rs index 9d38d0b96c6..7675e3d4b52 100644 --- a/frameworks/Rust/actix/src/db_diesel.rs +++ b/frameworks/Rust/actix/src/db_diesel.rs @@ -3,7 +3,7 @@ use std::io; use actix::prelude::*; -use diesel::{prelude::*, result::Error}; +use diesel::prelude::*; use rand::{rngs::SmallRng, Rng, SeedableRng}; use crate::models; @@ -18,7 +18,7 @@ impl DbExecutor { DbExecutor { conn: PgConnection::establish(db_url) .unwrap_or_else(|_| panic!("Error connecting to {}", db_url)), - rng: SmallRng::from_entropy(), + rng: SmallRng::from_os_rng(), } } } @@ -39,10 +39,10 @@ impl Handler for DbExecutor { fn handle(&mut self, _: RandomWorld, _: &mut Self::Context) -> Self::Result { use crate::schema::world::dsl::*; - let random_id = self.rng.gen_range(1..10_001); + let random_id = self.rng.random_range(1..10_001); match world .filter(id.eq(random_id)) - .load::(&self.conn) + .load::(&mut self.conn) { Ok(mut items) => Ok(items.pop().unwrap()), Err(_) => Err(io::Error::new(io::ErrorKind::Other, "Database error")), @@ -64,8 +64,8 @@ impl Handler for DbExecutor { let mut worlds = Vec::with_capacity(msg.0 as usize); for _ in 0..msg.0 { - let w_id = self.rng.gen_range(1..10_001); - let w = match world.filter(id.eq(w_id)).load::(&self.conn) { + let w_id = self.rng.random_range(1..10_001); + let w = match world.filter(id.eq(w_id)).load::(&mut self.conn) { Ok(mut items) => items.pop().unwrap(), Err(_) => { return Err(io::Error::new(io::ErrorKind::Other, "Database error")); @@ -91,27 +91,28 @@ impl Handler for DbExecutor { let mut worlds = Vec::with_capacity(msg.0 as usize); for _ in 0..msg.0 { - let w_id: i32 = self.rng.gen_range(1..10_001); - let mut w = match world.filter(id.eq(w_id)).load::(&self.conn) { + let w_id: i32 = self.rng.random_range(1..10_001); + let mut w = match world.filter(id.eq(w_id)).load::(&mut self.conn) { Ok(mut items) => items.pop().unwrap(), Err(_) => { return Err(io::Error::new(io::ErrorKind::Other, "Database error")); } }; - w.randomnumber = self.rng.gen_range(1..10_001); + w.randomnumber = self.rng.random_range(1..10_001); worlds.push(w); } worlds.sort_by_key(|w| w.id); - let _ = self.conn.transaction::<(), Error, _>(|| { + self.conn.transaction(|conn| { for w in &worlds { - let _ = diesel::update(world) + diesel::update(world) .filter(id.eq(w.id)) .set(randomnumber.eq(w.randomnumber)) - .execute(&self.conn); + .execute(conn)?; } Ok(()) - }); + }) + .map_err(|e: diesel::result::Error| io::Error::new(io::ErrorKind::Other, e))?; Ok(worlds) } @@ -129,7 +130,7 @@ impl Handler for DbExecutor { fn handle(&mut self, _: TellFortune, _: &mut Self::Context) -> Self::Result { use crate::schema::fortune::dsl::*; - match fortune.load::(&self.conn) { + match fortune.load::(&mut self.conn) { Ok(mut items) => { items.push(models::Fortune { id: 0, diff --git a/frameworks/Rust/actix/src/main_http.rs b/frameworks/Rust/actix/src/main_http.rs index a8ab73c1f55..a1e76742320 100644 --- a/frameworks/Rust/actix/src/main_http.rs +++ b/frameworks/Rust/actix/src/main_http.rs @@ -23,6 +23,7 @@ use crate::{ utils::Writer, }; +#[allow(dead_code)] #[derive(Debug)] enum Error { Pg(PgError), @@ -134,7 +135,7 @@ impl Service for App { } _ => Box::pin(ok(Response::with_body( - http::StatusCode::NOT_FOUND, + StatusCode::NOT_FOUND, Bytes::new(), ))), } diff --git a/frameworks/Rust/actix/src/main_mongodb.rs b/frameworks/Rust/actix/src/main_mongodb.rs index 251060fe2e1..ae26914f2d4 100644 --- a/frameworks/Rust/actix/src/main_mongodb.rs +++ b/frameworks/Rust/actix/src/main_mongodb.rs @@ -28,12 +28,12 @@ async fn find_random_world(data: web::Data) -> Result { let runtime = data.tokio_runtime.clone(); runtime .spawn(async move { - let mut rng = SmallRng::from_entropy(); - let id = (rng.gen::() % 10_000 + 1) as i32; + let mut rng = SmallRng::from_os_rng(); + let id = (rng.random::() % 10_000 + 1) as i32; let coll = data.client.database("hello_world").collection("world"); let world = coll - .find_one(doc! { "id": id as f32 }, None) + .find_one(doc! { "id": id as f32 }) .await? .expect("should find world"); Ok(world) @@ -101,10 +101,10 @@ async fn updates( let mut worlds = find_random_worlds(data, query.q).await?; - let mut rng = SmallRng::from_entropy(); + let mut rng = SmallRng::from_os_rng(); let mut updates = Vec::new(); for world in worlds.iter_mut() { - let new_random_number = (rng.gen::() % 10_000 + 1) as i32; + let new_random_number = (rng.random::() % 10_000 + 1) as i32; updates.push(doc! { "q": { "id": world.id }, "u": { "$set": { "randomNumber": new_random_number }} }); @@ -121,7 +121,6 @@ async fn updates( "updates": updates, "ordered": false, }, - None, ) .await }) @@ -145,7 +144,7 @@ async fn fortune(data: web::Data) -> Result>> { let fortunes_cursor = client .database("hello_world") .collection::("fortune") - .find(None, None) + .find(doc! {}) .await?; let mut fortunes: Vec = fortunes_cursor.try_collect().await?; diff --git a/frameworks/Rust/actix/src/main_pg_deadpool.rs b/frameworks/Rust/actix/src/main_pg_deadpool.rs index b24d5753d20..da0ff484eef 100644 --- a/frameworks/Rust/actix/src/main_pg_deadpool.rs +++ b/frameworks/Rust/actix/src/main_pg_deadpool.rs @@ -27,8 +27,8 @@ async fn find_random_world(pool: &Pool) -> Result { .await .unwrap(); - let mut rng = SmallRng::from_entropy(); - let id = (rng.gen::() % 10_000 + 1) as i32; + let mut rng = SmallRng::from_os_rng(); + let id = (rng.random::() % 10_000 + 1) as i32; let row = conn.query_one(&world, &[&id]).await?; @@ -95,14 +95,14 @@ async fn updates( ) -> Result>> { let mut worlds = find_random_worlds(&data, query.q).await?; - let mut rng = SmallRng::from_entropy(); + let mut rng = SmallRng::from_os_rng(); let mut updates = "UPDATE world SET randomnumber = CASE id ".to_string(); let mut params: Vec<&(dyn ToSql + Sync)> = Vec::with_capacity(query.q as usize * 3); let mut n_params = 1; for world in worlds.iter_mut() { - let new_random_number = (rng.gen::() % 10_000 + 1) as i32; + let new_random_number = (rng.random::() % 10_000 + 1) as i32; write!(&mut updates, "when ${} then ${} ", n_params, n_params + 1).unwrap(); world.randomnumber = new_random_number; n_params += 2; diff --git a/frameworks/Rust/anansi/Cargo.toml b/frameworks/Rust/anansi/Cargo.toml deleted file mode 100644 index a717e96e70b..00000000000 --- a/frameworks/Rust/anansi/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[workspace] -members = [ - ".", -] - -[package] -name = "tfb-anansi" -version = "0.1.0" -edition = "2021" - -[features] -raw = [] - -[dependencies] -anansi = { git = "https://github.com/saru-tora/anansi", rev = "c350a23", features = ["postgres", "minimal", "redis"] } -async-trait = "0.1.57" -rand = "0.8.4" -serde = "1" -serde_json = "1" -tokio-postgres = "0.7.7" - -[profile.release] -lto = true -opt-level = 3 -codegen-units = 1 diff --git a/frameworks/Rust/anansi/README.md b/frameworks/Rust/anansi/README.md deleted file mode 100755 index ebddef843ca..00000000000 --- a/frameworks/Rust/anansi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# [Anansi](https://saru-tora.github.io/anansi/) Benchmarking Test - -Anansi is a simple full-stack web framework for Rust. - -### Test Type Implementation Source Code - -All tests can be found in: src/hello/world/ - -## Test URLs -### JSON - -http://localhost:8080/json - -### PLAINTEXT - -http://localhost:8080/plaintext - -### DB - -http://localhost:8080/db - -### QUERY - -http://localhost:8080/query?queries= - -### CACHED QUERY - -http://localhost:8080/cached_query?queries= - -### UPDATE - -http://localhost:8080/update?queries= - -### FORTUNES - -http://localhost:8080/fortunes diff --git a/frameworks/Rust/anansi/anansi-raw.dockerfile b/frameworks/Rust/anansi/anansi-raw.dockerfile deleted file mode 100644 index 96c284a8b7a..00000000000 --- a/frameworks/Rust/anansi/anansi-raw.dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM rust:1.64 - -ADD ./ /anansi -WORKDIR /anansi - -RUN cargo clean -RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features raw - -EXPOSE 8080 - -CMD RUST_LOG=off ./target/release/tfb-anansi 0.0.0.0:8080 diff --git a/frameworks/Rust/anansi/anansi.dockerfile b/frameworks/Rust/anansi/anansi.dockerfile deleted file mode 100644 index bf6f7596193..00000000000 --- a/frameworks/Rust/anansi/anansi.dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM rust:1.64 - -RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-server - -ADD ./ /anansi -WORKDIR /anansi - -RUN cargo clean -RUN RUSTFLAGS="-C target-cpu=native" cargo build --release - -EXPOSE 8080 - -ENV RUST_LOG=off -CMD service redis-server start && ./target/release/tfb-anansi 0.0.0.0:8080 diff --git a/frameworks/Rust/anansi/benchmark_config.json b/frameworks/Rust/anansi/benchmark_config.json deleted file mode 100755 index dd1c17b71bd..00000000000 --- a/frameworks/Rust/anansi/benchmark_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "framework": "anansi", - "tests": [ - { - "default": { - "json_url": "/json", - "plaintext_url": "/plaintext", - "db_url": "/db", - "fortune_url": "/fortunes", - "query_url": "/queries?q=", - "update_url": "/updates?q=", - "cached_query_url": "/cached-queries?q=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "Anansi", - "language": "Rust", - "flavor": "None", - "orm": "Full", - "platform": "None", - "webserver": "hyper", - "os": "Linux", - "database_os": "Linux", - "display_name": "Anansi [minimal]", - "notes": "", - "versus": "None" - }, - "raw": { - "db_url": "/db", - "fortune_url": "/fortunes", - "query_url": "/queries?q=", - "update_url": "/updates?q=", - "cached_query_url": "/cached-queries?q=", - "port": 8080, - "approach": "Realistic", - "classification": "Fullstack", - "database": "postgres", - "framework": "Anansi", - "language": "Rust", - "flavor": "None", - "orm": "Raw", - "platform": "None", - "webserver": "hyper", - "os": "Linux", - "database_os": "Linux", - "display_name": "Anansi [minimal, raw]", - "notes": "", - "versus": "None" - } - } - ] -} diff --git a/frameworks/Rust/anansi/settings.toml b/frameworks/Rust/anansi/settings.toml deleted file mode 100644 index 6089347e428..00000000000 --- a/frameworks/Rust/anansi/settings.toml +++ /dev/null @@ -1,18 +0,0 @@ -secret_key = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -login_url = "/login" -smtp_relay = "" -smtp_username = "" -smtp_password = "" - -[caches] - -[caches.default] -location = "redis://127.0.0.1/" - -[databases] - -[databases.default] -name = "hello_world" -user = "benchmarkdbuser" -password = "benchmarkdbpass" -address = "tfb-database" diff --git a/frameworks/Rust/anansi/src/hello/middleware.rs b/frameworks/Rust/anansi/src/hello/middleware.rs deleted file mode 100644 index be369cb827d..00000000000 --- a/frameworks/Rust/anansi/src/hello/middleware.rs +++ /dev/null @@ -1,94 +0,0 @@ -use std::fmt::{self, Write}; -use std::sync::Arc; -use anansi::db::postgres::{PgDbPool, PgDbRow, PgDbRowVec, PgStatement}; - -#[macro_export] -macro_rules! impl_pg { - () => { - #[async_trait::async_trait] - impl crate::hello::middleware::Pg for HttpRequest { - async fn get_world(&self) -> anansi::web::Result { - use anansi::web::BaseRequest; - self.raw().app_state().stmt.0.world.fetch_one(&[&Self::random_num()], self.raw().pool()).await - } - async fn update_worlds(&self, n: usize, params: &[&(dyn tokio_postgres::types::ToSql + Sync)]) -> anansi::web::Result<()> { - use anansi::web::BaseRequest; - self.raw().app_state().stmt.0.updates[n].execute(params, self.raw().pool()).await - } - async fn get_fortunes(&self) -> anansi::web::Result { - use anansi::web::BaseRequest; - self.raw().app_state().stmt.0.fortune.fetch_all(&[], self.raw().pool()).await - } - } - impl crate::hello::middleware::AsStmt for AppData { - fn as_stmt(&self) -> &crate::hello::middleware::Stmt { - &self.stmt - } - } - } -} - -fn update_statement(num: u16) -> String { - let mut pl = 1; - let mut q = "UPDATE world SET randomnumber = CASE id ".to_string(); - for _ in 1..=num { - let _ = write!(q, "WHEN ${} THEN ${} ", pl, pl + 1); - pl += 2; - } - - q.push_str("ELSE randomnumber END WHERE id IN ("); - - for _ in 1..=num { - let _ = write!(q, "${},", pl); - pl += 1; - } - - q.pop(); - q.push(')'); - q -} - -#[derive(Clone)] -pub struct Stmt(pub Arc); - -impl fmt::Debug for Stmt { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Stmt") - .finish() - } -} - -impl Stmt { - pub async fn new(pool: &PgDbPool) -> anansi::web::Result { - let mut updates = vec![]; - for n in 1..=500 { - updates.push(PgStatement::new(&update_statement(n), pool).await?); - } - Ok(Self(Arc::new(State { - world: PgStatement::new("SELECT * FROM world WHERE id = $1", pool).await?, - updates, - fortune: PgStatement::new("SELECT * FROM fortune", pool).await?, - }))) - } -} - -pub struct State { - pub world: PgStatement, - pub updates: Vec, - pub fortune: PgStatement, -} - -pub trait AsStmt { - fn as_stmt(&self) -> &Stmt; -} - -#[async_trait::async_trait] -pub trait Pg { - fn random_num() -> i32 { - use rand::Rng; - rand::thread_rng().gen_range(1..=10_000) - } - async fn get_world(&self) -> anansi::web::Result; - async fn update_worlds(&self, n: usize, params: &[&(dyn tokio_postgres::types::ToSql + Sync)]) -> anansi::web::Result<()>; - async fn get_fortunes(&self) -> anansi::web::Result; -} diff --git a/frameworks/Rust/anansi/src/hello/migrations/mod.rs b/frameworks/Rust/anansi/src/hello/migrations/mod.rs deleted file mode 100644 index 72ca3a1f046..00000000000 --- a/frameworks/Rust/anansi/src/hello/migrations/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -use anansi::migrations::prelude::*; - -local_migrations! {} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/hello/mod.rs b/frameworks/Rust/anansi/src/hello/mod.rs deleted file mode 100644 index 74ca45e2a9d..00000000000 --- a/frameworks/Rust/anansi/src/hello/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod records; -pub mod migrations; - -pub const APP_NAME: &'static str = "hello"; -pub mod world; - -#[cfg(feature = "raw")] -pub mod middleware; diff --git a/frameworks/Rust/anansi/src/hello/records.rs b/frameworks/Rust/anansi/src/hello/records.rs deleted file mode 100644 index 6dc93a9c95c..00000000000 --- a/frameworks/Rust/anansi/src/hello/records.rs +++ /dev/null @@ -1,48 +0,0 @@ -#![allow(non_snake_case)] -use async_trait::async_trait; -use anansi::web::{Result, BaseRequest}; -use anansi::record; -use anansi::records::{Relate, Int, Text, random_int}; -use serde::Serialize; - -#[record(table_name = "World")] -#[derive(Serialize)] -pub struct World { - #[field(primary_key = "true", default_fn = "random_int")] - pub id: Int, - pub randomNumber: Int, -} - -#[async_trait] -impl Relate for World { - async fn on_save(&self, _req: &mut R) -> Result<()> { - unimplemented!(); - } - async fn on_delete(&self, _req: &R) -> Result<()> { - unimplemented!(); - } -} - -#[record(table_name = "Fortune")] -pub struct Fortune { - #[field(primary_key = "true", default_fn = "random_int")] - pub id: Int, - pub message: Text, -} - -#[cfg(not(feature = "raw"))] -impl Fortune { - pub fn additional() -> Self { - Self {id: Int::new(0), message: Text::from("Additional fortune added at request time.".to_string())} - } -} - -#[async_trait] -impl Relate for Fortune { - async fn on_save(&self, _req: &mut R) -> Result<()> { - unimplemented!(); - } - async fn on_delete(&self, _req: &R) -> Result<()> { - unimplemented!(); - } -} diff --git a/frameworks/Rust/anansi/src/hello/world/mod.rs b/frameworks/Rust/anansi/src/hello/world/mod.rs deleted file mode 100644 index 2d3508e5707..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[cfg(not(feature = "raw"))] -pub mod views; -#[cfg(feature = "raw")] -pub mod raw; -pub mod util; diff --git a/frameworks/Rust/anansi/src/hello/world/raw.rs b/frameworks/Rust/anansi/src/hello/world/raw.rs deleted file mode 100644 index 6199bf0fb2e..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/raw.rs +++ /dev/null @@ -1,110 +0,0 @@ -use crate::prelude::*; -use crate::hello::middleware::Pg; -use serde::Serialize; -use anansi::check; -use super::util::get_query; -use rand::Rng; -use tokio_postgres::types::ToSql; - -fn random_num() -> i32 { - rand::thread_rng().gen_range(1..=10_000) -} - -#[derive(Copy, Clone, Serialize, Debug)] -pub struct World { - id: i32, - randomnumber: i32, -} - -#[derive(Serialize, Debug)] -pub struct Fortune<'a> { - id: i32, - message: &'a str, -} - -#[base_view] -fn base(_req: &mut R) -> Result {} - -#[viewer] -impl WorldView { - async fn one_world(req: &R) -> Result { - let row = req.get_world().await?; - let world = World { - id: row.get_i32(0), - randomnumber: row.get_i32(1), - }; - Ok(world) - } - async fn get_worlds(req: &R) -> Result> { - let q = get_query(req.params()); - let mut worlds = Vec::with_capacity(q as usize); - for _ in 0..q { - let world = Self::one_world(req).await?; - worlds.push(world); - } - Ok(worlds) - } - #[check(Site::is_visitor)] - pub async fn db(req: &mut R) -> Result { - let world = Self::one_world(req).await?; - Response::json(&world) - } - #[check(Site::is_visitor)] - pub async fn queries(req: &mut R) -> Result { - let worlds = Self::get_worlds(req).await?; - Response::json(&worlds) - } - #[view(Site::is_visitor)] - pub async fn raw_fortunes(req: &mut R) -> Result { - let title = "Fortunes"; - let rows = req.get_fortunes().await?; - let mut fortunes = Vec::with_capacity(rows.len() + 1); - fortunes.push(Fortune { - id: 0, - message: "Additional fortune added at request time.", - }); - fortunes.extend(rows.iter().map(|row| Fortune { - id: row.get(0), - message: row.get(1), - })); - fortunes.sort_by(|it, next| it.message.cmp(&next.message)); - } - #[check(Site::is_visitor)] - pub async fn updates(req: &mut R) -> Result { - let q = get_query(req.params()) as usize; - let mut worlds = Vec::with_capacity(q); - let mut params: Vec<&(dyn ToSql + Sync)> = Vec::with_capacity(q * 3); - for _ in 0..q { - let row = req.get_world().await?; - let world = World { - id: row.get_i32(0), - randomnumber: random_num(), - }; - worlds.push(world); - } - for world in &worlds { - params.push(&world.id); - params.push(&world.randomnumber); - } - for world in &worlds { - params.push(&world.id); - } - req.update_worlds(q - 1, params.as_slice()).await?; - Response::json(&worlds) - } - #[check(Site::is_visitor)] - pub async fn cached_queries(req: &mut R) -> Result { - let q = get_query(req.params()); - let mut ids = vec![]; - for _ in 0..q { - ids.push(random_num().to_string()); - } - let mut worlds = vec!['[' as u8]; - for mut world in req.cache().get_many(ids).await? { - worlds.append(&mut world); - } - worlds.pop(); - worlds.push(']' as u8); - Response::json_bytes(worlds) - } -} diff --git a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base.in b/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base.in deleted file mode 100644 index 0473720779d..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base.in +++ /dev/null @@ -1,9 +0,0 @@ -{let mut _c = String::new();_c.push_str(" - - - ");_c.push_str(&_base_args._title);_c.push_str(" - - - ");_c.push_str(&_base_args._content);_c.push_str(" - -");_c.into_bytes()} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base_args.in b/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base_args.in deleted file mode 100644 index 9ad5b91f42b..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/base_args.in +++ /dev/null @@ -1 +0,0 @@ -pub struct Args {pub _title: String,pub _content: String,}impl anansi::cache::Cacheable for Args {fn to_bytes(&self) -> Vec {let mut v = vec![];v.append(&mut self._title.len().to_ne_bytes().to_vec());v.append(&mut self._title.as_bytes().to_vec());v.append(&mut self._content.len().to_ne_bytes().to_vec());v.append(&mut self._content.as_bytes().to_vec());v} fn from_bytes(mut __b: Vec) -> anansi::web::Result {let mut buf = __b.split_off(8); let l = usize::from_ne_bytes(__b.try_into().unwrap()); let mut __b = buf.split_off(l); let _title = String::from_utf8(buf)?;let mut buf = __b.split_off(8); let l = usize::from_ne_bytes(__b.try_into().unwrap()); let mut __b = buf.split_off(l); let _content = String::from_utf8(buf)?;Ok(Self {_title, _content, })}} impl Args {pub fn new() -> Self {Self {_title: String::new(), _content: String::new(), }}} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/fortunes.in b/frameworks/Rust/anansi/src/hello/world/templates/.parsed/fortunes.in deleted file mode 100644 index 7cf8984f743..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/fortunes.in +++ /dev/null @@ -1,6 +0,0 @@ -{_args._title = {let mut _c = String::new();_c.push_str("");_c.push_str(&anansi::web::html_escape(&format!("{}", title)));_c.push_str(""); _c};_args._content = {let mut _c = String::new();_c.push_str(" - - ");for fortune in fortunes {_c.push_str(" - - ");}_c.push_str(" -
idmessage
");_c.push_str(&anansi::web::html_escape(&format!("{}", fortune.pk())));_c.push_str("");_c.push_str(&anansi::web::html_escape(&format!("{}", fortune.message)));_c.push_str("
"); _c};_args} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/index.in b/frameworks/Rust/anansi/src/hello/world/templates/.parsed/index.in deleted file mode 100644 index 17b9c49d56b..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/index.in +++ /dev/null @@ -1 +0,0 @@ -{_args._title = {let mut _c = String::new();_c.push_str("");_c.push_str(&anansi::web::html_escape(&format!("{}", title)));_c.push_str(""); _c};_args._content = {let mut _c = String::new();_c.push_str("

");_c.push_str(&anansi::web::html_escape(&format!("{}", title)));_c.push_str("

"); _c};_args} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/raw_fortunes.in b/frameworks/Rust/anansi/src/hello/world/templates/.parsed/raw_fortunes.in deleted file mode 100644 index 83c5b13e6cf..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/.parsed/raw_fortunes.in +++ /dev/null @@ -1,4 +0,0 @@ -{_args._content = {let mut _c = String::new();_c.push_str(""); -for fortune in fortunes {_c.push_str(&format!("");} -_c.push_str("
idmessage
{}", fortune.id));anansi::web::html_escape2(&mut _c, fortune.message);_c.push_str("
"); _c}; -_args._title = {let mut _c = String::new();_c.push_str(&format!("{}", title)); _c};_args} diff --git a/frameworks/Rust/anansi/src/hello/world/templates/base.rs.html b/frameworks/Rust/anansi/src/hello/world/templates/base.rs.html deleted file mode 100644 index 440d37a95eb..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/base.rs.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - @block title - - - @block content - - diff --git a/frameworks/Rust/anansi/src/hello/world/templates/fortunes.rs.html b/frameworks/Rust/anansi/src/hello/world/templates/fortunes.rs.html deleted file mode 100644 index 0d4e369792a..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/fortunes.rs.html +++ /dev/null @@ -1,10 +0,0 @@ -@block title {@title} - -@block content { - - - @for fortune in fortunes { - - } -
idmessage
@fortune.pk()@fortune.message
-} diff --git a/frameworks/Rust/anansi/src/hello/world/templates/raw_fortunes.rs.html b/frameworks/Rust/anansi/src/hello/world/templates/raw_fortunes.rs.html deleted file mode 100644 index 22edc654ba9..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/templates/raw_fortunes.rs.html +++ /dev/null @@ -1,10 +0,0 @@ -@block title {@unescape title} - -@block content { - - - @for fortune in fortunes { - - } -
idmessage
@unescape fortune.id@fortune.message
-} diff --git a/frameworks/Rust/anansi/src/hello/world/util.rs b/frameworks/Rust/anansi/src/hello/world/util.rs deleted file mode 100644 index 8e8998f2b1f..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/util.rs +++ /dev/null @@ -1,16 +0,0 @@ -use anansi::web::Parameters; - -pub fn get_query(params: &Parameters) -> i16 { - if let Ok(q) = params.get("q") { - if let Ok(q) = q.parse() { - if q > 1 { - return if q <= 500 { - q - } else { - 500 - }; - } - } - } - 1 -} diff --git a/frameworks/Rust/anansi/src/hello/world/views.rs b/frameworks/Rust/anansi/src/hello/world/views.rs deleted file mode 100644 index c75b2fcd4cb..00000000000 --- a/frameworks/Rust/anansi/src/hello/world/views.rs +++ /dev/null @@ -1,90 +0,0 @@ -use crate::prelude::*; -use anansi::cache::prelude::*; -use anansi::records::Int; -use super::super::records::{World, Fortune}; -use super::util::get_query; -use serde::Serialize; -use anansi::{check, raw_bulk_update}; -use rand::Rng; - -fn random_i32() -> i32 { - rand::thread_rng().gen_range(1..=10_000) -} - -fn random_int() -> Int { - Int::new(random_i32()) -} - -#[derive(Serialize)] -struct Message { - message: &'static str, -} - -#[base_view] -fn base(_req: &mut R) -> Result {} - -#[viewer] -impl WorldView { - #[check(Site::is_visitor)] - pub async fn json(req: &mut R) -> Result { - let message = Message {message: "Hello, World!"}; - Response::json(&message) - } - async fn get_world(req: &R) -> Result { - World::find(random_int()).get(req).await - } - async fn get_worlds(req: &R) -> Result> { - let q = get_query(req.params()); - let mut worlds = Vec::with_capacity(q as usize); - for _ in 0..q { - let world = Self::get_world(req).await?; - worlds.push(world); - } - Ok(worlds) - } - #[check(Site::is_visitor)] - pub async fn db(req: &mut R) -> Result { - let world = Self::get_world(req).await?; - Response::json(&world) - } - #[check(Site::is_visitor)] - pub async fn queries(req: &mut R) -> Result { - let worlds = Self::get_worlds(req).await?; - Response::json(&worlds) - } - #[view(Site::is_visitor)] - pub async fn fortunes(req: &mut R) -> Result { - let title = "Fortunes"; - let mut fortunes = Fortune::get_all().query(req).await?; - fortunes.push(Fortune::additional()); - fortunes.sort_by(|it, next| it.message.cmp(&next.message)); - } - #[check(Site::is_visitor)] - pub async fn updates(req: &mut R) -> Result { - let mut worlds = Self::get_worlds(req).await?; - for world in &mut worlds { - world.randomNumber = random_int(); - } - raw_bulk_update!(req, World, &worlds, randomNumber).await?; - Response::json(&worlds) - } - #[check(Site::is_visitor)] - pub async fn plaintext(req: &mut R) -> Result { - Ok(Response::text("Hello, World!".to_string())) - } - #[check(Site::is_visitor)] - pub async fn cached_queries(req: &mut R) -> Result { - let q = get_query(req.params()); - let mut ids = vec![]; - for _ in 0..q { - ids.push(random_i32().to_string()); - } - let mut worlds = vec!['[' as u8]; - for mut world in req.cache().get_many(ids).await? { - worlds.append(&mut world); - } - worlds.pop(); - worlds.push(']' as u8); - Response::json_bytes(worlds) - } -} diff --git a/frameworks/Rust/anansi/src/http_errors/500.html b/frameworks/Rust/anansi/src/http_errors/500.html deleted file mode 100644 index 1c14f7cd7f3..00000000000 --- a/frameworks/Rust/anansi/src/http_errors/500.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - 500 Internal Server Error - - -

Internal Server Error

-

Sorry, something went wrong.

- - diff --git a/frameworks/Rust/anansi/src/http_errors/mod.rs b/frameworks/Rust/anansi/src/http_errors/mod.rs deleted file mode 100644 index 38b44033152..00000000000 --- a/frameworks/Rust/anansi/src/http_errors/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod views; diff --git a/frameworks/Rust/anansi/src/http_errors/templates/.parsed/not_found.in b/frameworks/Rust/anansi/src/http_errors/templates/.parsed/not_found.in deleted file mode 100644 index c13f6730bf5..00000000000 --- a/frameworks/Rust/anansi/src/http_errors/templates/.parsed/not_found.in +++ /dev/null @@ -1,11 +0,0 @@ -{let mut _c = String::new();_c.push_str(" - - - - Not Found - - -

404

-

Page not found.

- -");_c.into_bytes()} \ No newline at end of file diff --git a/frameworks/Rust/anansi/src/http_errors/templates/not_found.rs.html b/frameworks/Rust/anansi/src/http_errors/templates/not_found.rs.html deleted file mode 100644 index eaf9a979ee7..00000000000 --- a/frameworks/Rust/anansi/src/http_errors/templates/not_found.rs.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Not Found - - -

404

-

Page not found.

- - diff --git a/frameworks/Rust/anansi/src/http_errors/views.rs b/frameworks/Rust/anansi/src/http_errors/views.rs deleted file mode 100644 index 04872858818..00000000000 --- a/frameworks/Rust/anansi/src/http_errors/views.rs +++ /dev/null @@ -1,12 +0,0 @@ -use anansi::{check, viewer, render}; -use anansi::web::{Result, Response}; -use anansi::site::Site; -use crate::project::Request; - -#[viewer] -impl ErrorView { - #[check(Site::is_visitor)] - pub async fn not_found(_req: &mut R) -> Result { - render!("not_found") - } -} diff --git a/frameworks/Rust/anansi/src/main.rs b/frameworks/Rust/anansi/src/main.rs deleted file mode 100644 index 24e3fd87292..00000000000 --- a/frameworks/Rust/anansi/src/main.rs +++ /dev/null @@ -1,28 +0,0 @@ -use anansi::*; - -mod urls; -mod project; -mod http_errors; -mod hello; - -apps! { - hello, -} - -app_statics! {} - -min_main!(server, { - use anansi::cache::prelude::*; - use hello::records::World; - use anansi::records::Record; - use anansi::db::AsDb; - let worlds = World::get_all().raw_query(server.app_data.as_db()).await.expect("problem fetching worlds"); - let mut items = vec![]; - for world in worlds { - let id = world.pk().to_string(); - let mut bytes = serde_json::to_vec(&world).expect("problem serializing world"); - bytes.push(',' as u8); - items.push((id, bytes)); - } - server.cache.set_many(&items).await.expect("problem caching world"); -}); diff --git a/frameworks/Rust/anansi/src/project.rs b/frameworks/Rust/anansi/src/project.rs deleted file mode 100644 index 074460a6b46..00000000000 --- a/frameworks/Rust/anansi/src/project.rs +++ /dev/null @@ -1,62 +0,0 @@ -use anansi::project::prelude::*; -use crate::app_migrations; - -#[cfg(feature = "raw")] -use super::hello::middleware::Stmt; - -#[cfg(feature = "raw")] -use crate::impl_pg; - -#[cfg(feature = "raw")] -app_cache!(local); - -#[cfg(not(feature = "raw"))] -app_cache!(redis); - -database!(postgres); - -#[cfg(feature = "raw")] -raw_middleware!(); - -#[cfg(feature = "raw")] -anansi::setup!(); - -#[cfg(feature = "raw")] -impl_pg!(); - -#[cfg(not(feature = "raw"))] -middleware!(); - -#[derive(Clone, Debug)] -pub struct AppData { - pub pool: Pool, - #[cfg(feature = "raw")] - pub stmt: Stmt, -} - -#[cfg(feature = "raw")] -impl AppData { - pub async fn new() -> Self { - let pool = anansi::server::get_db::(app_migrations).await; - let stmt = Stmt::new(&pool).await.unwrap(); - Self {pool, stmt} - } -} - -#[cfg(not(feature = "raw"))] -impl AppData { - pub async fn new() -> Self { - let pool = anansi::server::get_db::(app_migrations).await; - Self {pool} - } -} - -impl anansi::db::AsDb for AppData { - type SqlDb = Pool; - fn as_db(&self) -> &Pool { - &self.pool - } - fn as_db_mut(&mut self) -> &mut Pool { - &mut self.pool - } -} diff --git a/frameworks/Rust/anansi/src/urls.rs b/frameworks/Rust/anansi/src/urls.rs deleted file mode 100644 index bd04cbaad43..00000000000 --- a/frameworks/Rust/anansi/src/urls.rs +++ /dev/null @@ -1,32 +0,0 @@ -use anansi::web::prelude::*; -use crate::prelude::Request; -#[cfg(not(feature = "raw"))] -use crate::hello::world::views::WorldView; - -#[cfg(not(feature = "raw"))] -pub fn routes() -> Router { - Router::new() - .route("/json", WorldView::json) - .route("/db", WorldView::db) - .route("/queries", WorldView::queries) - .route("/fortunes", WorldView::fortunes) - .route("/updates", WorldView::updates) - .route("/plaintext", WorldView::plaintext) - .route("/cached-queries", WorldView::cached_queries) -} - -#[cfg(feature = "raw")] -use crate::hello::world::raw::WorldView; - -#[cfg(feature = "raw")] -use crate::hello::middleware::Pg; - -#[cfg(feature = "raw")] -pub fn routes() -> Router { - Router::new() - .route("/db", WorldView::db) - .route("/queries", WorldView::queries) - .route("/fortunes", WorldView::raw_fortunes) - .route("/updates", WorldView::updates) - .route("/cached-queries", WorldView::cached_queries) -} diff --git a/frameworks/Rust/hyperlane/Cargo.lock b/frameworks/Rust/hyperlane/Cargo.lock new file mode 100644 index 00000000000..8d66da54a3c --- /dev/null +++ b/frameworks/Rust/hyperlane/Cargo.lock @@ -0,0 +1,1795 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "async-func" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8882ceb09bc57f9b7a52d48cffab866310aeeb6a5aa1c9420640e7689660c9ee" +dependencies = [ + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bb8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d8b8e1a22743d9241575c6ba822cf9c8fef34771c86ab7e477a4fbfd254e5" +dependencies = [ + "futures-util", + "parking_lot", + "tokio", +] + +[[package]] +name = "bb8-postgres" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e570e6557cd0f88d28d32afa76644873271a70dc22656df565b2021c4036aa9c" +dependencies = [ + "bb8", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clonelicious" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c61986b9f0347d401ef41468e7aadba2ab6dfc2547df1862f2563250fbfa8d3" + +[[package]] +name = "color-output" +version = "6.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc537d9d2e7e15fa40da2a6a451afedea17808a63f8339863e3a6b5ae93db596" +dependencies = [ + "hyperlane-time", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "file-operation" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaba2fa080e689c4ec9a0666c5b7eb074182fdba13a34e97b19b56ac2a855556" +dependencies = [ + "tokio", +] + +[[package]] +name = "flate2" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +dependencies = [ + "num-traits", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "halfbrown" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" +dependencies = [ + "hashbrown", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http-compress" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8646f4e10f8fc48d8f2a595e6ef303189e49e386d6863d771f028c969f0c5e42" +dependencies = [ + "brotli", + "flate2", + "http-constant", +] + +[[package]] +name = "http-constant" +version = "1.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3567340a02df4ec03fa5475e2b273aa183d875b3bf09674403407aadda1cd1" + +[[package]] +name = "http-type" +version = "3.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f21786d19bad67be1eb85b528e65722d44812d6e9bed878147f767573a2586" +dependencies = [ + "hex", + "http-compress", + "http-constant", + "lombok-macros", + "serde", + "serde-xml-rs", + "serde_json", + "serde_urlencoded", + "tokio", + "url", +] + +[[package]] +name = "hyperlane" +version = "4.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74319ece1df44e8ddd62a9e1ae13040ba34fd1500eb240fa449ca8fbc7210727" +dependencies = [ + "async-func", + "clonelicious", + "color-output", + "file-operation", + "futures", + "http-compress", + "http-type", + "hyperlane-log", + "lombok-macros", + "once_cell", + "recoverable-spawn", + "recoverable-thread-pool", + "serde", + "serde_json", + "server-manager", + "simd-json", + "std-macro-extensions", + "tokio", +] + +[[package]] +name = "hyperlane-log" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf652414e2c385beb37c36341ae91f6eb686062f3cfff6c0cff8526deafbb65" +dependencies = [ + "file-operation", + "hyperlane-time", + "lombok-macros", + "once_cell", + "recoverable-spawn", +] + +[[package]] +name = "hyperlane-time" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11dcc4ca08d1ebfc1f70e7a40033483219f77909a7ef6c4af302a14aa97da3d2" + +[[package]] +name = "hyperlane_techempower" +version = "0.0.1" +dependencies = [ + "bb8", + "bb8-postgres", + "chrono", + "hyperlane", + "rand", + "serde", + "tokio-postgres", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "lombok-macros" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe4fc0110b8bdb29b2423a2be59fa7b9b3e0e1b225553514895564420887bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres-protocol" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" +dependencies = [ + "base64", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", + "uuid", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha", + "rand_core", + "zerocopy 0.8.23", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.1", +] + +[[package]] +name = "recoverable-spawn" +version = "3.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5081593fb6a36af3e9ca8c4f23735f9d454a252cba0629509baa3947983846d" +dependencies = [ + "once_cell", + "tokio", +] + +[[package]] +name = "recoverable-thread-pool" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4190261c8a4823ceaf4b9cd68bf28deca98aa5697d2e1ec66e8053dac2a817fa" +dependencies = [ + "lombok-macros", + "recoverable-spawn", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-xml-rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3aa78ecda1ebc9ec9847d5d3aba7d618823446a049ba2491940506da6e2782" +dependencies = [ + "log", + "serde", + "thiserror", + "xml-rs", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "server-manager" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5144bc130554928fb304af2e7590742db173a40f82672613dc293f7567e8730e" +dependencies = [ + "tokio", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "simd-json" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" +dependencies = [ + "getrandom 0.2.15", + "halfbrown", + "ref-cast", + "serde", + "serde_json", + "simdutf8", + "value-trait", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "std-macro-extensions" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b44c771c1591df90e3b49f618362dc1c431a8df6a7a6cc69dbe00757b158522" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand", + "socket2", + "tokio", + "tokio-util", + "whoami", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "value-trait" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" +dependencies = [ + "float-cmp", + "halfbrown", + "itoa", + "ryu", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[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.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall", + "wasite", + "web-sys", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xml-rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/frameworks/Rust/hyperlane/Cargo.toml b/frameworks/Rust/hyperlane/Cargo.toml new file mode 100644 index 00000000000..cb0eccc2e0b --- /dev/null +++ b/frameworks/Rust/hyperlane/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "hyperlane_techempower" +version = "0.0.1" +edition = "2021" +authors = ["ltpp-universe "] +license = "MIT" +description = """Hyperlane is a lightweight and high-performance Rust HTTP server library designed to simplify network service development. It supports HTTP request parsing, response building, and TCP communication, making it ideal for building modern web services. Additionally, it provides support for request and response middleware, WebSocket, and Server-Sent Events (SSE), enabling flexible and efficient real-time communication.""" +keywords = ["http", "request", "response", "tcp", "redirect"] +repository = "https://github.com/ltpp-universe/hyperlane.git" +categories = ["network-programming", "web-programming"] +exclude = [ + "target", + "Cargo.lock", + "sh", + ".github", + "logs", + "**/*.log" +] + +[dependencies] +hyperlane = "4.31.1" +bb8 = "0.9.0" +bb8-postgres = "0.9.0" +rand = "0.9.0" +tokio-postgres = { version = "0.7.13", features = ["with-uuid-0_8"] } +chrono = "0.4.40" +serde = "1.0.219" + +[profile.dev] +incremental = false +opt-level = 3 +lto = true +panic = "unwind" +debug = false +codegen-units = 1 +strip = "debuginfo" + +[profile.release] +incremental = false +opt-level = 3 +lto = true +panic = "unwind" +debug = false +codegen-units = 1 +strip = "debuginfo" diff --git a/frameworks/Rust/hyperlane/README.md b/frameworks/Rust/hyperlane/README.md new file mode 100644 index 00000000000..96bf0620a7e --- /dev/null +++ b/frameworks/Rust/hyperlane/README.md @@ -0,0 +1,27 @@ +# [hyperlane](https://github.com/ltpp-universe/hyperlane) web framework + +## Description + +Hyperlane is a lightweight and high-performance Rust HTTP server library designed to simplify network service development. It supports HTTP request parsing, response building, and TCP communication, making it ideal for building modern web services. Additionally, it provides support for request and response middleware, WebSocket, and Server-Sent Events (SSE), enabling flexible and efficient real-time communication. + +## Database + +PostgreSQL + +## Test URLs + +### Test 1: JSON Encoding + + http://localhost:8080/json + +### Test 2: Single Row Query + + http://localhost:8080/db + +### Test 3: Multi Row Query + + http://localhost:8080/queries?q=20 + +### Test 4: Plaintext + + http://localhost:8080/plaintext diff --git a/frameworks/Rust/hyperlane/benchmark_config.json b/frameworks/Rust/hyperlane/benchmark_config.json new file mode 100644 index 00000000000..b52090969ec --- /dev/null +++ b/frameworks/Rust/hyperlane/benchmark_config.json @@ -0,0 +1,26 @@ +{ + "framework": "hyperlane", + "tests": [ + { + "default": { + "dockerfile": "hyperlane.dockerfile", + "json_url": "/json", + "plaintext_url": "/plaintext", + "db_url": "/db", + "query_url": "/queries?q=", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "hyperlane", + "language": "Rust", + "orm": "raw", + "platform": "Rust", + "webserver": "hyperlane", + "os": "Linux", + "database_os": "Linux", + "display_name": "hyperlane" + } + } + ] +} diff --git a/frameworks/Python/vibora/config.toml b/frameworks/Rust/hyperlane/config.toml similarity index 59% rename from frameworks/Python/vibora/config.toml rename to frameworks/Rust/hyperlane/config.toml index 03952ecdb41..3871bc56afe 100644 --- a/frameworks/Python/vibora/config.toml +++ b/frameworks/Rust/hyperlane/config.toml @@ -1,16 +1,17 @@ [framework] -name = "vibora" +name = "hyperlane" [main] urls.plaintext = "/plaintext" urls.json = "/json" urls.db = "/db" +urls.query = "/queries?q=" approach = "Realistic" -classification = "Platform" +classification = "Micro" database = "Postgres" database_os = "Linux" os = "Linux" -orm = "Full" -platform = "None" -webserver = "None" +orm = "raw" +platform = "Rust" +webserver = "hyperlane" versus = "None" diff --git a/frameworks/Rust/hyperlane/hyperlane.dockerfile b/frameworks/Rust/hyperlane/hyperlane.dockerfile new file mode 100644 index 00000000000..480553c8c7a --- /dev/null +++ b/frameworks/Rust/hyperlane/hyperlane.dockerfile @@ -0,0 +1,13 @@ +FROM rust:1.85 + +ENV POSTGRES_URL=postgres://benchmarkdbuser:benchmarkdbpass@tfb-database:5432/hello_world + +ADD ./ /hyperlane_techempower +WORKDIR /hyperlane_techempower + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release + +EXPOSE 8080 + +CMD ./target/release/hyperlane_techempower diff --git a/frameworks/Rust/hyperlane/src/constant.rs b/frameworks/Rust/hyperlane/src/constant.rs new file mode 100644 index 00000000000..adc58ac641e --- /dev/null +++ b/frameworks/Rust/hyperlane/src/constant.rs @@ -0,0 +1,10 @@ +pub static RESPONSEDATA: &str = "Hello, World!"; +pub static DATABASE_TYPE: &str = "postgres"; +pub static DATABASE_HOST: &str = "tfb-database"; +pub static DATABASE_USER_NAME: &str = "benchmarkdbuser"; +pub static DATABASE_USER_PASSWORD: &str = "benchmarkdbpass"; +pub static DATABASE_PORT: usize = 5432; +pub static DATABASE_NAME: &str = "hello_world"; +pub static TABLE_NAME: &str = "World"; +pub static ROW_LIMIT: i32 = 500; +pub static HYPERLANE: &str = "hyperlane"; diff --git a/frameworks/Rust/hyperlane/src/db.rs b/frameworks/Rust/hyperlane/src/db.rs new file mode 100644 index 00000000000..81120b548bb --- /dev/null +++ b/frameworks/Rust/hyperlane/src/db.rs @@ -0,0 +1,135 @@ +use crate::*; + +pub async fn get_db_connection() -> DbPoolConnection { + let db_pool: DbPoolConnection = DB.read().await.clone().unwrap(); + db_pool +} + +pub async fn create_batabase() { + let db_pool: DbPoolConnection = get_db_connection().await; + let connection: DbConnection = db_pool.get().await.unwrap(); + let db_exists: bool = connection + .query_one( + "SELECT EXISTS(SELECT 1 FROM pg_database WHERE datname = $1);", + &[&DATABASE_NAME], + ) + .await + .unwrap() + .get(0); + if !db_exists { + println_warning!( + "database `", + DATABASE_NAME, + "` not found. Creating database..." + ); + connection + .batch_execute(&format!("CREATE DATABASE {};", DATABASE_NAME)) + .await + .unwrap(); + println_success!("database `", DATABASE_NAME, "` created successfully"); + } + println_success!("database `", DATABASE_NAME, "` ready"); +} + +pub async fn create_table() { + let db_pool: DbPoolConnection = get_db_connection().await; + let connection: DbConnection = db_pool.get().await.unwrap(); + connection + .batch_execute(&format!( + "CREATE TABLE IF NOT EXISTS {} ( + id SERIAL PRIMARY KEY, + randomNumber INTEGER NOT NULL + );", + TABLE_NAME + )) + .await + .unwrap(); + println_success!("table `", TABLE_NAME, "` ready"); +} + +pub async fn insert_records() { + let db_pool: DbPoolConnection = get_db_connection().await; + let connection: DbConnection = db_pool.get().await.unwrap(); + let row: Row = connection + .query_one(&format!("SELECT COUNT(*) FROM {}", TABLE_NAME), &[]) + .await + .unwrap(); + let count: i64 = row.get(0); + let limit: i64 = ROW_LIMIT as i64; + if count >= limit { + println_warning!(format!( + "table '{}' already has {} records. No need to insert.", + TABLE_NAME, count + )); + return; + } + let missing_count: i64 = limit - count; + println_warning!(format!( + "table '{}' has {} records. Inserting {} missing records...", + TABLE_NAME, count, missing_count + )); + let mut rng: rand::prelude::ThreadRng = rand::rng(); + let mut values: Vec = Vec::new(); + for _ in 0..missing_count { + let random_number: i32 = rng.random_range(1..=10000); + values.push(format!("(DEFAULT, {})", random_number)); + } + let query: String = format!( + "INSERT INTO {} (id, randomNumber) VALUES {}", + TABLE_NAME, + values.join(",") + ); + connection.batch_execute(&query).await.unwrap(); + println_success!(format!( + "successfully inserted {} missing records into '{}' table.", + TABLE_NAME, missing_count + )); +} + +pub async fn init_db() { + let db_url: &str = match option_env!("POSTGRES_URL") { + Some(it) => it, + _ => &format!( + "{}://{}:{}@{}:{}/{}", + DATABASE_TYPE, + DATABASE_USER_NAME, + DATABASE_USER_PASSWORD, + DATABASE_HOST, + DATABASE_PORT, + DATABASE_NAME + ), + }; + println_warning!("db url: ", db_url); + let config: Config = db_url.parse::().unwrap(); + let db_manager: PostgresConnectionManager = + PostgresConnectionManager::new(config, NoTls); + let db_pool: DbPoolConnection = Pool::builder().build(db_manager).await.unwrap(); + { + let mut db_pool_lock: RwLockWriteGuard<'_, Option> = DB.write().await; + *db_pool_lock = Some(db_pool.clone()); + } + create_batabase().await; + create_table().await; + insert_records().await; +} + +pub async fn random_world_row() -> Result> { + let random_id: i32 = rand::rng().random_range(1..ROW_LIMIT); + let db_pool: DbPoolConnection = get_db_connection().await; + let connection: DbConnection = db_pool + .get() + .await + .map_err(|e| io::Error::new(io::ErrorKind::Other, format!("timeout: {}", e)))?; + let stmt: Statement = connection + .prepare(&format!( + "SELECT id, randomNumber FROM {} WHERE id = $1", + TABLE_NAME + )) + .await?; + if let Some(rows) = connection.query_opt(&stmt, &[&random_id]).await? { + let id: i32 = rows.get(0); + let random_number: i32 = rows.get(1); + return Ok(QueryRow::new(id, random_number)); + } + return Ok(QueryRow::new(0, 0)); +} diff --git a/frameworks/Rust/hyperlane/src/lazy.rs b/frameworks/Rust/hyperlane/src/lazy.rs new file mode 100644 index 00000000000..5b701e371bd --- /dev/null +++ b/frameworks/Rust/hyperlane/src/lazy.rs @@ -0,0 +1,4 @@ +use crate::*; + +pub static DB: Lazy>> = + Lazy::new(|| Arc::new(RwLock::new(None))); diff --git a/frameworks/Rust/hyperlane/src/main.rs b/frameworks/Rust/hyperlane/src/main.rs new file mode 100644 index 00000000000..d0145b343da --- /dev/null +++ b/frameworks/Rust/hyperlane/src/main.rs @@ -0,0 +1,43 @@ +pub(crate) mod constant; +pub(crate) mod db; +pub(crate) mod lazy; +pub(crate) mod request_middleware; +pub(crate) mod response_middleware; +pub(crate) mod route; +pub(crate) mod server; +pub(crate) mod r#type; +pub(crate) mod utils; + +pub(crate) use bb8::{Pool, PooledConnection}; +pub(crate) use bb8_postgres::PostgresConnectionManager; +pub(crate) use chrono::{DateTime, Utc}; +pub(crate) use constant::*; +pub(crate) use db::*; +pub(crate) use hyperlane::{ + once_cell::sync::Lazy, + serde::*, + serde_json::json, + tokio::sync::{RwLock, RwLockWriteGuard}, + *, +}; +pub(crate) use lazy::*; +pub(crate) use r#type::*; +pub(crate) use rand::Rng; +pub(crate) use request_middleware::*; +pub(crate) use response_middleware::*; +pub(crate) use route::*; + +pub(crate) use server::*; +pub(crate) use std::time::SystemTime; +pub(crate) use std::{io, sync::Arc}; +pub(crate) use tokio_postgres::{Config, NoTls, Row, Statement}; +pub(crate) use utils::*; + +#[tokio::main] +async fn main() { + println_warning!("start connect db"); + init_db().await; + println_success!("connect db finish"); + println_warning!("start init server"); + run_server().await; +} diff --git a/frameworks/Rust/hyperlane/src/request_middleware.rs b/frameworks/Rust/hyperlane/src/request_middleware.rs new file mode 100644 index 00000000000..b1ffc0fd2fa --- /dev/null +++ b/frameworks/Rust/hyperlane/src/request_middleware.rs @@ -0,0 +1,18 @@ +use crate::*; + +pub async fn request(controller_data: ControllerData) { + let _ = controller_data + .set_response_header(CONNECTION, CONNECTION_KEEP_ALIVE) + .await + .set_response_header( + CONTENT_TYPE, + format!("{}; {}", APPLICATION_JSON, CHARSET_UTF_8), + ) + .await + .set_response_header(SERVER, HYPERLANE) + .await + .set_response_header(DATE, generate_rfc1123_timestamp()) + .await + .set_response_status_code(200) + .await; +} diff --git a/frameworks/Rust/hyperlane/src/response_middleware.rs b/frameworks/Rust/hyperlane/src/response_middleware.rs new file mode 100644 index 00000000000..81fb0c368e9 --- /dev/null +++ b/frameworks/Rust/hyperlane/src/response_middleware.rs @@ -0,0 +1,5 @@ +use crate::*; + +pub async fn response(controller_data: ControllerData) { + let _ = controller_data.send().await; +} diff --git a/frameworks/Rust/hyperlane/src/route.rs b/frameworks/Rust/hyperlane/src/route.rs new file mode 100644 index 00000000000..fce11dbc1ca --- /dev/null +++ b/frameworks/Rust/hyperlane/src/route.rs @@ -0,0 +1,44 @@ +use crate::*; + +pub async fn json(controller_data: ControllerData) { + let json: serde_json::Value = json!({ + "message": RESPONSEDATA + }); + let _ = controller_data + .set_response_body(serde_json::to_string(&json).unwrap_or_default()) + .await; +} + +pub async fn plaintext(controller_data: ControllerData) { + let _ = controller_data + .set_response_header(CONTENT_TYPE, TEXT_PLAIN) + .await + .set_response_body(RESPONSEDATA) + .await; +} + +pub async fn db(controller_data: ControllerData) { + let query_row: QueryRow = random_world_row().await.unwrap(); + let _ = controller_data + .set_response_body(serde_json::to_string(&query_row).unwrap_or_default()) + .await; +} + +pub async fn queries(controller_data: ControllerData) { + let queries: Queries = controller_data + .get_request_query("q") + .await + .and_then(|queries| queries.parse::().ok()) + .unwrap_or_default() + .min(ROW_LIMIT as usize) + .max(1); + let mut data: Vec = Vec::with_capacity(queries); + for _ in 0..queries { + let _ = random_world_row().await.map(|row| { + data.push(row); + }); + } + let _ = controller_data + .set_response_body(serde_json::to_string(&data).unwrap_or_default()) + .await; +} diff --git a/frameworks/Rust/hyperlane/src/server.rs b/frameworks/Rust/hyperlane/src/server.rs new file mode 100644 index 00000000000..7042eab442b --- /dev/null +++ b/frameworks/Rust/hyperlane/src/server.rs @@ -0,0 +1,18 @@ +use crate::*; + +pub async fn run_server() { + let mut server: Server = Server::new(); + server.host("0.0.0.0").await; + server.port(8080).await; + server.log_dir("./logs").await; + server.log_interval_millis(1_000_000_000).await; + server.disable_print().await; + server.route("/json", json).await; + server.route("/plaintext", plaintext).await; + server.route("/db", db).await; + server.route("/queries", queries).await; + server.request_middleware(request).await; + server.response_middleware(response).await; + println_success!("server initialization completed"); + server.listen().await; +} diff --git a/frameworks/Rust/hyperlane/src/type.rs b/frameworks/Rust/hyperlane/src/type.rs new file mode 100644 index 00000000000..5e524ede2e9 --- /dev/null +++ b/frameworks/Rust/hyperlane/src/type.rs @@ -0,0 +1,21 @@ +use crate::*; + +pub type DbPoolConnection = bb8::Pool>; +pub type DbConnection<'a> = PooledConnection<'a, PostgresConnectionManager>; +pub type Queries = usize; + +#[allow(bad_style)] +#[derive(Serialize)] +pub struct QueryRow { + id: i32, + randomNumber: i32, +} + +impl QueryRow { + pub fn new(id: i32, random_number: i32) -> Self { + Self { + id: id, + randomNumber: random_number, + } + } +} diff --git a/frameworks/Rust/hyperlane/src/utils.rs b/frameworks/Rust/hyperlane/src/utils.rs new file mode 100644 index 00000000000..c189f0be8db --- /dev/null +++ b/frameworks/Rust/hyperlane/src/utils.rs @@ -0,0 +1,6 @@ +use crate::*; + +pub fn generate_rfc1123_timestamp() -> String { + let now: DateTime = SystemTime::now().into(); + now.format("%a, %d %b %Y %H:%M:%S GMT").to_string() +} diff --git a/frameworks/Rust/hyperlane/templates/fortune.hbs b/frameworks/Rust/hyperlane/templates/fortune.hbs new file mode 100644 index 00000000000..b9e25a52a8e --- /dev/null +++ b/frameworks/Rust/hyperlane/templates/fortune.hbs @@ -0,0 +1,5 @@ +Fortunes + {{~# each fortunes ~}} + + {{~/each ~}} +
idmessage
{{id}}{{message}}
diff --git a/frameworks/Rust/ntex/Cargo.toml b/frameworks/Rust/ntex/Cargo.toml index 3bbf3dffa0f..ba3133f31b8 100755 --- a/frameworks/Rust/ntex/Cargo.toml +++ b/frameworks/Rust/ntex/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ntex-bench" -version = "2.0.0" +version = "2.1.0" edition = "2018" [[bin]] @@ -11,6 +11,14 @@ path = "src/main.rs" name = "ntex-compio" path = "src/main.rs" +[[bin]] +name = "ntex-neon" +path = "src/main.rs" + +[[bin]] +name = "ntex-neon-uring" +path = "src/main.rs" + [[bin]] name = "ntex-db" path = "src/main_db.rs" @@ -19,6 +27,14 @@ path = "src/main_db.rs" name = "ntex-db-compio" path = "src/main_db.rs" +[[bin]] +name = "ntex-db-neon" +path = "src/main_db.rs" + +[[bin]] +name = "ntex-db-neon-uring" +path = "src/main_db.rs" + [[bin]] name = "ntex-plt" path = "src/main_plt.rs" @@ -27,6 +43,14 @@ path = "src/main_plt.rs" name = "ntex-plt-compio" path = "src/main_plt.rs" +[[bin]] +name = "ntex-plt-neon" +path = "src/main_plt.rs" + +[[bin]] +name = "ntex-plt-neon-uring" +path = "src/main_plt.rs" + [features] default = [] @@ -36,8 +60,14 @@ tokio = ["ntex/tokio"] # compio runtime compio = ["ntex/compio"] +# neon runtime +neon = ["ntex/neon"] + +# neon runtime +neon-uring = ["ntex/neon-uring"] + [dependencies] -ntex = "2.8" +ntex = "2.12" ntex-compio = "0.2" ntex-bytes = { version = "0.1.21", features=["simd"] } mimalloc = { version = "0.1.25", default-features = false } @@ -47,9 +77,8 @@ buf-min = { version = "0.7", features = ["ntex-bytes"] } env_logger = "0.11" nanorand = { version = "0.7", default-features = false, features = ["std", "wyrand", "tls"] } atoi = "2.0" -core_affinity = "0.8" futures = "0.3" -sonic-rs = "0.3.16" +sonic-rs = "0.4.0" serde = { version = "1", features = ["derive"] } serde_json = "1" log = { version = "0.4", features = ["release_max_level_off"] } @@ -59,6 +88,12 @@ tokio-postgres = { git="https://github.com/fafhrd91/postgres.git", branch="ntex- [target.'cfg(target_os = "linux")'.dependencies] compio-driver = { version = "*", features = ["io-uring"]} +[patch.crates-io] +ntex = { git = "https://github.com/ntex-rs/ntex.git" } +ntex-io = { git = "https://github.com/ntex-rs/ntex.git" } +ntex-net = { git = "https://github.com/ntex-rs/ntex.git" } +ntex-rt = { git = "https://github.com/ntex-rs/ntex.git" } + [profile.release] opt-level = 3 codegen-units = 1 diff --git a/frameworks/Rust/ntex/benchmark_config.json b/frameworks/Rust/ntex/benchmark_config.json index 9ed29c64b97..16615823f11 100755 --- a/frameworks/Rust/ntex/benchmark_config.json +++ b/frameworks/Rust/ntex/benchmark_config.json @@ -19,7 +19,7 @@ "notes": "", "versus": "" }, - "compio": { + "neon": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -33,7 +33,25 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio]", + "display_name": "ntex [neon]", + "notes": "", + "versus": "" + }, + "neon-uring": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "ntex", + "language": "Rust", + "orm": "Raw", + "platform": "None", + "webserver": "ntex", + "os": "Linux", + "database_os": "Linux", + "display_name": "ntex [neon(io-uring)]", "notes": "", "versus": "" }, @@ -57,7 +75,27 @@ "notes": "", "versus": "" }, - "db-compio": { + "db-neon": { + "fortune_url": "/fortunes", + "db_url": "/db", + "query_url": "/query?q=", + "update_url": "/update?q=", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "Postgres", + "framework": "ntex", + "language": "Rust", + "orm": "Raw", + "platform": "None", + "webserver": "ntex", + "os": "Linux", + "database_os": "Linux", + "display_name": "ntex [neon,db]", + "notes": "", + "versus": "" + }, + "db-neon-uring": { "fortune_url": "/fortunes", "db_url": "/db", "query_url": "/query?q=", @@ -73,7 +111,7 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio,db]", + "display_name": "ntex [neon(io-uring),db]", "notes": "", "versus": "" }, @@ -95,7 +133,25 @@ "notes": "", "versus": "" }, - "plt-compio": { + "plt-neon": { + "json_url": "/json", + "plaintext_url": "/plaintext", + "port": 8080, + "approach": "Realistic", + "classification": "Platform", + "database": "Postgres", + "framework": "ntex", + "language": "Rust", + "orm": "Raw", + "platform": "None", + "webserver": "ntex", + "os": "Linux", + "database_os": "Linux", + "display_name": "ntex [neon,platform]", + "notes": "", + "versus": "" + }, + "plt-neon-uring": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -109,7 +165,7 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio,platform]", + "display_name": "ntex [neon(io-uring),platform]", "notes": "", "versus": "" } diff --git a/frameworks/Rust/ntex/config.toml b/frameworks/Rust/ntex/config.toml index 759dca26c70..ad8a0276411 100644 --- a/frameworks/Rust/ntex/config.toml +++ b/frameworks/Rust/ntex/config.toml @@ -27,6 +27,32 @@ platform = "None" webserver = "ntex" versus = "" +[neon] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + +[neon-uring] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + [db] urls.db = "/db" urls.query = "/query?q=" @@ -57,6 +83,36 @@ platform = "None" webserver = "ntex" versus = "" +[db-neon] +urls.db = "/db" +urls.query = "/query?q=" +urls.update = "/update?q=" +urls.fortune = "/fortunes" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + +[db-neon-uring] +urls.db = "/db" +urls.query = "/query?q=" +urls.update = "/update?q=" +urls.fortune = "/fortunes" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + [plt] urls.plaintext = "/plaintext" urls.json = "/json" @@ -82,3 +138,29 @@ orm = "Raw" platform = "None" webserver = "ntex" versus = "" + +[plt-neon] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Platform" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + +[plt-neon-uring] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Platform" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" diff --git a/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile new file mode 100644 index 00000000000..2b65aaa1556 --- /dev/null +++ b/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-db-neon-uring diff --git a/frameworks/Rust/ntex/ntex-db-neon.dockerfile b/frameworks/Rust/ntex/ntex-db-neon.dockerfile new file mode 100644 index 00000000000..0bd30d7d49c --- /dev/null +++ b/frameworks/Rust/ntex/ntex-db-neon.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon" + +EXPOSE 8080 + +CMD ./target/release/ntex-db-neon diff --git a/frameworks/Rust/ntex/ntex-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-neon-uring.dockerfile new file mode 100644 index 00000000000..f69e45e7f8d --- /dev/null +++ b/frameworks/Rust/ntex/ntex-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-neon-uring diff --git a/frameworks/Rust/ntex/ntex-neon.dockerfile b/frameworks/Rust/ntex/ntex-neon.dockerfile new file mode 100644 index 00000000000..91b0ac1acba --- /dev/null +++ b/frameworks/Rust/ntex/ntex-neon.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon" + +EXPOSE 8080 + +CMD ./target/release/ntex-neon diff --git a/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile new file mode 100644 index 00000000000..943c6ef2373 --- /dev/null +++ b/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-plt-neon-uring diff --git a/frameworks/Rust/ntex/ntex-plt-neon.dockerfile b/frameworks/Rust/ntex/ntex-plt-neon.dockerfile new file mode 100644 index 00000000000..766886f6997 --- /dev/null +++ b/frameworks/Rust/ntex/ntex-plt-neon.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon" + +EXPOSE 8080 + +CMD ./target/release/ntex-plt-neon diff --git a/frameworks/Rust/ntex/src/db.rs b/frameworks/Rust/ntex/src/db.rs index cd4443f3c00..da33f1f6c35 100644 --- a/frameworks/Rust/ntex/src/db.rs +++ b/frameworks/Rust/ntex/src/db.rs @@ -173,7 +173,7 @@ impl PgConnection { utils::reserve(&mut body, 4 * 1024); FortunesTemplate { - fortunes: &*fortunes, + fortunes: &fortunes, } .write_call(&mut body); fortunes.clear(); diff --git a/frameworks/Rust/ntex/src/main.rs b/frameworks/Rust/ntex/src/main.rs index 5210d85863f..b0e53b3f05c 100644 --- a/frameworks/Rust/ntex/src/main.rs +++ b/frameworks/Rust/ntex/src/main.rs @@ -2,7 +2,7 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; use ntex::http::header::{CONTENT_TYPE, SERVER}; -use ntex::{http, time::Seconds, util::BytesMut, util::PoolId, util::Ready, web}; +use ntex::{http, time::Seconds, util::BytesMut, util::PoolId, web}; use sonic_rs::Serialize; mod utils; @@ -48,13 +48,10 @@ async fn plaintext() -> web::HttpResponse { async fn main() -> std::io::Result<()> { println!("Started http server: 127.0.0.1:8080"); - let cores = core_affinity::get_core_ids().unwrap(); - let total_cores = cores.len(); - let cores = std::sync::Arc::new(std::sync::Mutex::new(cores)); - // start http server ntex::server::build() .backlog(1024) + .enable_affinity() .bind("techempower", "0.0.0.0:8080", |cfg| { cfg.memory_pool(PoolId::P1); PoolId::P1.set_read_params(65535, 2048); @@ -67,17 +64,6 @@ async fn main() -> std::io::Result<()> { .payload_read_rate(Seconds::ZERO, Seconds::ZERO, 0) .h1(web::App::new().service(json).service(plaintext).finish()) })? - .configure(move |cfg| { - let cores = cores.clone(); - cfg.on_worker_start(move |_| { - if let Some(core) = cores.lock().unwrap().pop() { - core_affinity::set_for_current(core); - } - Ready::<_, &str>::Ok(()) - }); - Ok(()) - })? - .workers(total_cores) .run() .await } diff --git a/frameworks/Rust/ntex/src/main_db.rs b/frameworks/Rust/ntex/src/main_db.rs index 4197322bc13..544921fb594 100644 --- a/frameworks/Rust/ntex/src/main_db.rs +++ b/frameworks/Rust/ntex/src/main_db.rs @@ -6,7 +6,7 @@ use ntex::http::header::{CONTENT_TYPE, SERVER}; use ntex::http::{HttpService, KeepAlive, Request, Response, StatusCode}; use ntex::service::{Service, ServiceCtx, ServiceFactory}; use ntex::web::{Error, HttpResponse}; -use ntex::{time::Seconds, util::PoolId, util::Ready}; +use ntex::{time::Seconds, util::PoolId}; mod db; mod utils; @@ -82,12 +82,9 @@ impl ServiceFactory for AppFactory { async fn main() -> std::io::Result<()> { println!("Starting http server: 127.0.0.1:8080"); - let cores = core_affinity::get_core_ids().unwrap(); - let total_cores = cores.len(); - let cores = std::sync::Arc::new(std::sync::Mutex::new(cores)); - ntex::server::build() .backlog(1024) + .enable_affinity() .bind("techempower", "0.0.0.0:8080", |cfg| { cfg.memory_pool(PoolId::P1); PoolId::P1.set_read_params(65535, 2048); @@ -100,17 +97,6 @@ async fn main() -> std::io::Result<()> { .payload_read_rate(Seconds::ZERO, Seconds::ZERO, 0) .h1(AppFactory) })? - .configure(move |cfg| { - let cores = cores.clone(); - cfg.on_worker_start(move |_| { - if let Some(core) = cores.lock().unwrap().pop() { - core_affinity::set_for_current(core); - } - Ready::<_, &str>::Ok(()) - }); - Ok(()) - })? - .workers(total_cores) .run() .await } diff --git a/frameworks/Rust/ntex/src/main_plt.rs b/frameworks/Rust/ntex/src/main_plt.rs index 9cc80ac9952..e16070f0b63 100644 --- a/frameworks/Rust/ntex/src/main_plt.rs +++ b/frameworks/Rust/ntex/src/main_plt.rs @@ -1,10 +1,9 @@ #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -use std::{future::Future, io, pin::Pin, task::Context, task::Poll}; +use std::{future::Future, io, pin::Pin, task::ready, task::Context, task::Poll}; -use ntex::util::{ready, PoolId, Ready}; -use ntex::{fn_service, http::h1, io::Io, io::RecvError}; +use ntex::{fn_service, http::h1, io::Io, io::RecvError, util::PoolId}; use sonic_rs::Serialize; mod utils; @@ -79,13 +78,10 @@ impl Future for App { async fn main() -> io::Result<()> { println!("Started http server: 127.0.0.1:8080"); - let cores = core_affinity::get_core_ids().unwrap(); - let total_cores = cores.len(); - let cores = std::sync::Arc::new(std::sync::Mutex::new(cores)); - // start http server ntex::server::build() .backlog(1024) + .enable_affinity() .bind("techempower", "0.0.0.0:8080", |cfg| { cfg.memory_pool(PoolId::P1); PoolId::P1.set_read_params(65535, 2048); @@ -96,17 +92,6 @@ async fn main() -> io::Result<()> { codec: h1::Codec::default(), }) })? - .configure(move |cfg| { - let cores = cores.clone(); - cfg.on_worker_start(move |_| { - if let Some(core) = cores.lock().unwrap().pop() { - core_affinity::set_for_current(core); - } - Ready::<_, &str>::Ok(()) - }); - Ok(()) - })? - .workers(total_cores) .run() .await } diff --git a/frameworks/Rust/ntex/src/utils.rs b/frameworks/Rust/ntex/src/utils.rs index 7a2e6bf1df1..6fd48e6e265 100644 --- a/frameworks/Rust/ntex/src/utils.rs +++ b/frameworks/Rust/ntex/src/utils.rs @@ -34,7 +34,7 @@ pub fn reserve(buf: &mut BytesMut, lw: usize) { pub struct BytesWriter<'a>(pub &'a mut BytesMut); -impl<'a> Write for BytesWriter<'a> { +impl Write for BytesWriter<'_> { fn write(&mut self, src: &[u8]) -> Result { self.0.extend_from_slice(src); Ok(src.len()) @@ -45,7 +45,7 @@ impl<'a> Write for BytesWriter<'a> { } } -impl<'a> WriteExt for BytesWriter<'a> { +impl WriteExt for BytesWriter<'_> { #[inline(always)] fn reserve_with(&mut self, additional: usize) -> Result<&mut [MaybeUninit], io::Error> { self.0.reserve(additional); @@ -57,10 +57,11 @@ impl<'a> WriteExt for BytesWriter<'a> { } #[inline(always)] - unsafe fn flush_len(&mut self, additional: usize) { + unsafe fn flush_len(&mut self, additional: usize) -> io::Result<()> { unsafe { let new_len = self.0.len() + additional; self.0.set_len(new_len); } + Ok(()) } } diff --git a/frameworks/Rust/ohkami/benchmark_config.json b/frameworks/Rust/ohkami/benchmark_config.json index 3f0647c3927..654faa24d48 100644 --- a/frameworks/Rust/ohkami/benchmark_config.json +++ b/frameworks/Rust/ohkami/benchmark_config.json @@ -22,9 +22,7 @@ "fortune_url": "/fortunes", "update_url": "/updates?q=", "plaintext_url": "/plaintext" - } - }, - { + }, "rt_async-std": { "dockerfile": "rt_async-std.dockerfile", "display_name": "Ohkami [async-std]", @@ -45,9 +43,7 @@ "fortune_url": "/fortunes", "update_url": "/updates?q=", "plaintext_url": "/plaintext" - } - }, - { + }, "rt_smol": { "dockerfile": "rt_smol.dockerfile", "display_name": "Ohkami [smol]", @@ -64,9 +60,7 @@ "port": 8000, "json_url": "/json", "plaintext_url": "/plaintext" - } - }, - { + }, "rt_glommio": { "dockerfile": "rt_glommio.dockerfile", "display_name": "Ohkami [glommio]", @@ -83,9 +77,7 @@ "port": 8000, "json_url": "/json", "plaintext_url": "/plaintext" - } - }, - { + }, "rt_nio": { "dockerfile": "rt_nio.dockerfile", "display_name": "Ohkami [nio]", diff --git a/frameworks/Rust/rocket/Cargo.lock b/frameworks/Rust/rocket/Cargo.lock index 99bf76ca11b..68a60d48670 100644 --- a/frameworks/Rust/rocket/Cargo.lock +++ b/frameworks/Rust/rocket/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -195,11 +195,11 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.83" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -873,9 +873,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libm" @@ -1451,15 +1451,14 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.17.8" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", "getrandom", "libc", - "spin 0.9.8", "untrusted", "windows-sys 0.52.0", ] @@ -1775,6 +1774,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.1" diff --git a/frameworks/Rust/xitca-web/Cargo.lock b/frameworks/Rust/xitca-web/Cargo.lock index 8411895981c..d57f388c2aa 100644 --- a/frameworks/Rust/xitca-web/Cargo.lock +++ b/frameworks/Rust/xitca-web/Cargo.lock @@ -37,9 +37,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", @@ -102,9 +102,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -135,9 +135,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.15" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] @@ -150,9 +150,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "core_affinity" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622892f5635ce1fc38c8f16dfc938553ed64af482edb5e150bf4caedbfcb2304" +checksum = "a034b3a7b624016c6e13f5df875747cc25f884156aad2abd12b6c46797971342" dependencies = [ "libc", "num_cpus", @@ -215,11 +215,11 @@ dependencies = [ [[package]] name = "diesel" -version = "2.2.7" +version = "2.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04001f23ba8843dc315804fa324000376084dfb1c30794ff68dd279e6e5696d5" +checksum = "470eb10efc8646313634c99bb1593f402a6434cbd86e266770c6e39219adb86a" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "byteorder", "diesel_derives", "itoa", @@ -243,9 +243,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f2c3de51e2ba6bf2a648285696137aaf0f5f487bcbea93972fe8a364e131a4" +checksum = "a93958254b70bea63b4187ff73d10180599d9d8d177071b7f91e6da4e0c0ad55" dependencies = [ "diesel_table_macro_syntax", "dsl_auto_type", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "fallible-iterator" @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -501,9 +501,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "itoap" @@ -523,9 +523,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libmimalloc-sys" @@ -741,18 +741,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -776,7 +776,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha", "rand_core", - "zerocopy 0.8.20", + "zerocopy 0.8.21", ] [[package]] @@ -791,37 +791,36 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.20", ] [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] name = "ref-cast" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ "proc-macro2", "quote", @@ -836,9 +835,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "sailfish" @@ -897,9 +896,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1059,9 +1058,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -1090,9 +1089,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -1204,9 +1203,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" @@ -1447,13 +1446,13 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] name = "xitca-codegen" version = "0.4.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" dependencies = [ "quote", "syn", @@ -1462,7 +1461,7 @@ dependencies = [ [[package]] name = "xitca-http" version = "0.7.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" dependencies = [ "futures-core", "http", @@ -1512,7 +1511,7 @@ dependencies = [ [[package]] name = "xitca-postgres" version = "0.3.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" dependencies = [ "fallible-iterator", "futures-core", @@ -1550,7 +1549,7 @@ dependencies = [ [[package]] name = "xitca-server" version = "0.5.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" dependencies = [ "socket2 0.5.8", "tokio", @@ -1564,7 +1563,7 @@ dependencies = [ [[package]] name = "xitca-service" version = "0.3.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" [[package]] name = "xitca-unsafe-collection" @@ -1608,7 +1607,7 @@ dependencies = [ [[package]] name = "xitca-web" version = "0.7.0" -source = "git+http://github.com/HFQR/xitca-web?rev=c2de532#c2de53223e778154e400dc25347ef557c1cec51e" +source = "git+http://github.com/HFQR/xitca-web?rev=915b14d#915b14dfed1aaed0da9450cba70b629c9c415353" dependencies = [ "futures-core", "pin-project-lite", @@ -1635,11 +1634,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" +checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" dependencies = [ - "zerocopy-derive 0.8.20", + "zerocopy-derive 0.8.21", ] [[package]] @@ -1655,9 +1654,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" dependencies = [ "proc-macro2", "quote", diff --git a/frameworks/Rust/xitca-web/Cargo.toml b/frameworks/Rust/xitca-web/Cargo.toml index 64362b8eb1f..9fcea2ad8b4 100644 --- a/frameworks/Rust/xitca-web/Cargo.toml +++ b/frameworks/Rust/xitca-web/Cargo.toml @@ -104,9 +104,9 @@ xitca-postgres-diesel = { git = "https://github.com/fakeshadow/xitca-postgres-di diesel-async = { git = "https://github.com/weiznich/diesel_async", rev = "5b8262b" } mio = { git = "https://github.com/fakeshadow/mio", rev = "9bae6012b7ecfc6083350785f71a5e8265358178" } -xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } -xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } -xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } -xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } -xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } -xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "c2de532" } +xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } +xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } +xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } +xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } +xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } +xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" } diff --git a/frameworks/Rust/xitca-web/src/main.rs b/frameworks/Rust/xitca-web/src/main.rs index e49e684cbb4..449651ed129 100755 --- a/frameworks/Rust/xitca-web/src/main.rs +++ b/frameworks/Rust/xitca-web/src/main.rs @@ -18,18 +18,58 @@ use xitca_service::{Service, ServiceExt, fn_service}; use db::Client; use ser::{IntoResponse, Message, Request, Response, error_response}; -use util::{HandleResult, QueryParse, SERVER_HEADER_VALUE, State}; +use util::{QueryParse, SERVER_HEADER_VALUE, State}; type Ctx<'a> = Context<'a, Request, State>; fn main() -> std::io::Result<()> { let service = Router::new() - .insert("/plaintext", get(fn_service(plain_text))) - .insert("/json", get(fn_service(json))) - .insert("/db", get(fn_service(db))) - .insert("/fortunes", get(fn_service(fortunes))) - .insert("/queries", get(fn_service(queries))) - .insert("/updates", get(fn_service(updates))) + .insert( + "/plaintext", + get(fn_service(async |ctx: Ctx| ctx.into_parts().0.text_response())), + ) + .insert( + "/json", + get(fn_service(async |ctx: Ctx| { + let (req, state) = ctx.into_parts(); + req.json_response(state, &Message::new()) + })), + ) + .insert( + "/db", + get(fn_service(async |ctx: Ctx| { + let (req, state) = ctx.into_parts(); + let world = state.client.get_world().await?; + req.json_response(state, &world) + })), + ) + .insert( + "/fortunes", + get(fn_service(async |ctx: Ctx| { + let (req, state) = ctx.into_parts(); + use sailfish::TemplateOnce; + let fortunes = state.client.tell_fortune().await?.render_once()?; + req.html_response(fortunes) + })), + ) + .insert( + "/queries", + get(fn_service(async |ctx: Ctx| { + let (req, state) = ctx.into_parts(); + let num = req.uri().query().parse_query(); + let worlds = state.client.get_worlds(num).await?; + req.json_response(state, &worlds) + })), + ) + .insert( + "/updates", + get(fn_service(async |ctx: Ctx| { + let (req, state) = ctx.into_parts(); + let num = req.uri().query().parse_query(); + let worlds = state.client.update(num).await?; + req.json_response(state, &worlds) + })), + ) .enclosed(ContextBuilder::new(|| async { db::create().await.map(State::new) })) .enclosed_fn(async |service, req| { let mut res = service.call(req).await.unwrap_or_else(error_handler); @@ -52,39 +92,3 @@ fn error_handler(e: RouterError) -> Response { RouterError::Service(_) => StatusCode::INTERNAL_SERVER_ERROR, }) } - -async fn plain_text(ctx: Ctx<'_>) -> HandleResult { - ctx.into_parts().0.text_response() -} - -async fn json(ctx: Ctx<'_>) -> HandleResult { - let (req, state) = ctx.into_parts(); - req.json_response(state, &Message::new()) -} - -async fn db(ctx: Ctx<'_>) -> HandleResult { - let (req, state) = ctx.into_parts(); - let world = state.client.get_world().await?; - req.json_response(state, &world) -} - -async fn fortunes(ctx: Ctx<'_>) -> HandleResult { - let (req, state) = ctx.into_parts(); - use sailfish::TemplateOnce; - let fortunes = state.client.tell_fortune().await?.render_once()?; - req.html_response(fortunes) -} - -async fn queries(ctx: Ctx<'_>) -> HandleResult { - let (req, state) = ctx.into_parts(); - let num = req.uri().query().parse_query(); - let worlds = state.client.get_worlds(num).await?; - req.json_response(state, &worlds) -} - -async fn updates(ctx: Ctx<'_>) -> HandleResult { - let (req, state) = ctx.into_parts(); - let num = req.uri().query().parse_query(); - let worlds = state.client.update(num).await?; - req.json_response(state, &worlds) -} diff --git a/frameworks/Scala/kyo-tapir/README.md b/frameworks/Scala/kyo-tapir/README.md new file mode 100644 index 00000000000..4fcc3d2c677 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/README.md @@ -0,0 +1,21 @@ +# Kyo Tapir Benchmarking Test + +This is a simple test to benchmark the performance of the Kyo and Tapir libraries in Scala. + +### Test Type Implementation Source Code + +* [JSON](src/main/scala/Main.scala) +* [PLAINTEXT](src/main/scala/Main.scala) + +## Software Versions + +* [Java OpenJDK 21](https://adoptium.net/temurin/releases/) +* [Scala 3.6.3](https://www.scala-lang.org/) +* [Kyo 0.16.2](https://github.com/getkyo/kyo) +* [Tapir 1.11.15](https://tapir.softwaremill.com) +* [ZIO Json 0.7.32](https://zio.dev/zio-json/) + +## Test URLs + +* JSON - http://localhost:9999/json +* PLAINTEXT - http://localhost:9999/plaintext diff --git a/frameworks/Lua/luxure/benchmark_config.json b/frameworks/Scala/kyo-tapir/benchmark_config.json old mode 100755 new mode 100644 similarity index 60% rename from frameworks/Lua/luxure/benchmark_config.json rename to frameworks/Scala/kyo-tapir/benchmark_config.json index 50717aa6951..3b005996a8f --- a/frameworks/Lua/luxure/benchmark_config.json +++ b/frameworks/Scala/kyo-tapir/benchmark_config.json @@ -1,26 +1,26 @@ { - "framework": "luxure", + "framework": "kyo-tapir", "tests": [ { "default": { - "json_url": "/json", "plaintext_url": "/plaintext", - "port": 8080, + "json_url": "/json", + "port": 9999, + "database": "None", "approach": "Realistic", "classification": "Micro", - "database": "None", - "framework": "Luxure", - "language": "Lua", + "framework": "kyo-tapir", + "language": "Scala", "flavor": "None", - "orm": "None", - "platform": "None", + "orm": "Raw", + "platform": "Netty", "webserver": "None", - "os": "Linux", "database_os": "Linux", - "display_name": "Luxure", + "os": "Linux", + "display_name": "kyo-tapir", "notes": "", - "versus": "Express" + "versus": "None" } } ] -} +} \ No newline at end of file diff --git a/frameworks/Scala/kyo-tapir/build.sbt b/frameworks/Scala/kyo-tapir/build.sbt new file mode 100644 index 00000000000..c7ee01108fc --- /dev/null +++ b/frameworks/Scala/kyo-tapir/build.sbt @@ -0,0 +1,17 @@ +name := "kyo-tapir" +version := "1.0.0" +scalaVersion := "3.6.3" +lazy val root = (project in file(".")) + .settings( + libraryDependencies ++= Seq( + "io.getkyo" %% "kyo-tapir" % "0.16.2", + "com.softwaremill.sttp.tapir" %% "tapir-json-zio" % "1.11.15", + "dev.zio" %% "zio-json" % "0.7.32" + ), + assembly / assemblyMergeStrategy := { + case x if x.contains("io.netty.versions.properties") => MergeStrategy.discard + case x => + val oldStrategy = (assembly / assemblyMergeStrategy).value + oldStrategy(x) + } + ) diff --git a/frameworks/Python/hug/config.toml b/frameworks/Scala/kyo-tapir/config.toml similarity index 71% rename from frameworks/Python/hug/config.toml rename to frameworks/Scala/kyo-tapir/config.toml index 18bf06c490a..f210a34bf48 100644 --- a/frameworks/Python/hug/config.toml +++ b/frameworks/Scala/kyo-tapir/config.toml @@ -1,14 +1,15 @@ [framework] -name = "hug" +name = "kyo-tapir" [main] urls.plaintext = "/plaintext" +urls.json = "/json" approach = "Realistic" classification = "Micro" database = "None" database_os = "Linux" os = "Linux" orm = "Raw" -platform = "Falcon" +platform = "Netty" webserver = "None" -versus = "wsgi" +versus = "None" \ No newline at end of file diff --git a/frameworks/Scala/kyo-tapir/kyo-tapir.dockerfile b/frameworks/Scala/kyo-tapir/kyo-tapir.dockerfile new file mode 100644 index 00000000000..4dc5370acf2 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/kyo-tapir.dockerfile @@ -0,0 +1,10 @@ +FROM sbtscala/scala-sbt:eclipse-temurin-21.0.6_7_1.10.7_3.6.3 + +WORKDIR /kyo-tapir +COPY src src +COPY project project +COPY build.sbt build.sbt +RUN sbt assembly + +EXPOSE 9999 +CMD ["java", "-Xms2G", "-Xmx2G", "-server", "-Dio.netty.leakDetection.level=disabled", "-Dio.netty.recycler.maxCapacityPerThread=0", "-jar", "/kyo-tapir/target/scala-3.6.3/kyo-tapir-assembly-1.0.0.jar"] \ No newline at end of file diff --git a/frameworks/Scala/kyo-tapir/project/build.properties b/frameworks/Scala/kyo-tapir/project/build.properties new file mode 100644 index 00000000000..0882e8a3906 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/project/build.properties @@ -0,0 +1 @@ +sbt.version = 1.10.7 \ No newline at end of file diff --git a/frameworks/Scala/kyo-tapir/project/plugins.sbt b/frameworks/Scala/kyo-tapir/project/plugins.sbt new file mode 100644 index 00000000000..f8ea5d0fbb0 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1") diff --git a/frameworks/Scala/kyo-tapir/src/main/scala/Main.scala b/frameworks/Scala/kyo-tapir/src/main/scala/Main.scala new file mode 100644 index 00000000000..6c543de17e2 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/src/main/scala/Main.scala @@ -0,0 +1,48 @@ +import kyo.* +import sttp.model.{Header, HeaderNames} +import sttp.tapir.* +import sttp.tapir.json.zio.* +import sttp.tapir.server.netty.* + +object Main extends KyoApp { + private val STATIC_SERVER_NAME = "kyo-tapir" + + private val plainTextMessage: String = "Hello, World!" + + run { + val plaintextRoute: Unit < Routes = + Routes.add( + _.get.in("plaintext") + .out(header(HeaderNames.Server, STATIC_SERVER_NAME)) + .out(header[String](HeaderNames.Date)) + .out(stringBody) + ) { _ => + for { + now <- Clock.now + } yield Header.toHttpDateString(now.toJava) -> plainTextMessage + } + + val jsonRoute: Unit < Routes = + Routes.add( + _.get.in("json") + .out(header(HeaderNames.Server, STATIC_SERVER_NAME)) + .out(header[String](HeaderNames.Date)) + .out(jsonBody[Payload]) + ) { _ => + for { + now <- Clock.now + } yield Header.toHttpDateString(now.toJava) -> Payload(plainTextMessage) + } + + val config = NettyConfig.default + .withSocketKeepAlive + .copy(lingerTimeout = None) + + val server = NettyKyoServer(config).host("0.0.0.0").port(9999) + + val binding: NettyKyoServerBinding < Async = + Routes.run(server)(plaintextRoute.andThen(jsonRoute)) + + binding + } +} \ No newline at end of file diff --git a/frameworks/Scala/kyo-tapir/src/main/scala/Payload.scala b/frameworks/Scala/kyo-tapir/src/main/scala/Payload.scala new file mode 100644 index 00000000000..53b27e476c2 --- /dev/null +++ b/frameworks/Scala/kyo-tapir/src/main/scala/Payload.scala @@ -0,0 +1,8 @@ +import sttp.tapir.Schema +import zio.json.* + +case class Payload(message: String) +object Payload { + given JsonCodec[Payload] = DeriveJsonCodec.gen + given Schema[Payload] = Schema.derived +} \ No newline at end of file diff --git a/frameworks/Scala/sharaf/.mill-version b/frameworks/Scala/sharaf/.mill-version new file mode 100644 index 00000000000..1b3f5e2da8a --- /dev/null +++ b/frameworks/Scala/sharaf/.mill-version @@ -0,0 +1 @@ +0.12.8 \ No newline at end of file diff --git a/frameworks/Scala/sharaf/README.md b/frameworks/Scala/sharaf/README.md new file mode 100644 index 00000000000..82ec706d260 --- /dev/null +++ b/frameworks/Scala/sharaf/README.md @@ -0,0 +1,45 @@ + +# Sharaf Benchmarking Test + +[Sharaf](https://sake92.github.io/sharaf/) is a minimalistic Scala 3 web framework. + +### Test Type Implementation Source Code + +* [JSON](src/routes.scala) +* [PLAINTEXT](src/routes.scala) +* [DB](src/routes.scala) +* [QUERY](src/routes.scala) +* [UPDATE](src/routes.scala) +* [FORTUNES](src/routes.scala) + +## Important Libraries +The tests were run with: +* [squery](https://sake92.github.io/squery/) for SQL +* [tupson](https://sake92.github.io/tupson/) for JSON +* [scalatags](https://com-lihaoyi.github.io/scalatags/) for HTML + +## Test URLs +### JSON + +http://localhost:8080/json + +### PLAINTEXT + +http://localhost:8080/plaintext + +### DB + +http://localhost:8080/db + +### QUERY + +http://localhost:8080/query?queries= + + +### UPDATE + +http://localhost:8080/update?queries= + +### FORTUNES + +http://localhost:8080/fortunes diff --git a/frameworks/Python/xpresso/benchmark_config.json b/frameworks/Scala/sharaf/benchmark_config.json old mode 100755 new mode 100644 similarity index 59% rename from frameworks/Python/xpresso/benchmark_config.json rename to frameworks/Scala/sharaf/benchmark_config.json index dcc76e906a7..2864f92059a --- a/frameworks/Python/xpresso/benchmark_config.json +++ b/frameworks/Scala/sharaf/benchmark_config.json @@ -1,29 +1,29 @@ { - "framework": "xpresso", + "framework": "sharaf", "tests": [ { "default": { - "json_url": "/json", - "fortune_url": "/fortunes", "plaintext_url": "/plaintext", + "json_url": "/json", "db_url": "/db", "query_url": "/queries?queries=", + "fortune_url": "/fortunes", "update_url": "/updates?queries=", "port": 8080, "approach": "Realistic", - "classification": "Micro", - "database": "Postgres", - "framework": "Xpresso", - "language": "Python", - "flavor": "Python3", - "orm": "Raw", - "platform": "None", + "classification": "Fullstack", + "database": "postgres", + "framework": "Sharaf", + "language": "Scala", + "flavor": "None", + "orm": "Micro", + "platform": "Undertow", "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "Xpresso", + "display_name": "Sharaf", "notes": "", - "versus": "None" + "versus": "Undertow" } } ] diff --git a/frameworks/Scala/sharaf/build.mill b/frameworks/Scala/sharaf/build.mill new file mode 100644 index 00000000000..be7a09e418d --- /dev/null +++ b/frameworks/Scala/sharaf/build.mill @@ -0,0 +1,14 @@ +package build + +import mill._ +import mill.scalalib._ + +object `package` extends RootModule with ScalaModule { + def scalaVersion = "3.6.2" + def ivyDeps = Agg( + ivy"ba.sake::sharaf:0.8.1", + ivy"ba.sake::squery:0.6.4", + ivy"org.postgresql:postgresql:42.6.0", + ivy"com.zaxxer:HikariCP:5.0.1" + ) +} \ No newline at end of file diff --git a/frameworks/Scala/sharaf/mill b/frameworks/Scala/sharaf/mill new file mode 100644 index 00000000000..5102f00fc92 --- /dev/null +++ b/frameworks/Scala/sharaf/mill @@ -0,0 +1,265 @@ +#!/usr/bin/env sh + +# This is a wrapper script, that automatically download mill from GitHub release pages +# You can give the required mill version with --mill-version parameter +# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION +# +# Original Project page: https://github.com/lefou/millw +# Script Version: 0.4.12 +# +# If you want to improve this script, please also contribute your changes back! +# +# Licensed under the Apache License, Version 2.0 + +set -e + +if [ -z "${DEFAULT_MILL_VERSION}" ] ; then + DEFAULT_MILL_VERSION="0.11.4" +fi + + +if [ -z "${GITHUB_RELEASE_CDN}" ] ; then + GITHUB_RELEASE_CDN="" +fi + + +MILL_REPO_URL="https://github.com/com-lihaoyi/mill" + +if [ -z "${CURL_CMD}" ] ; then + CURL_CMD=curl +fi + +# Explicit commandline argument takes precedence over all other methods +if [ "$1" = "--mill-version" ] ; then + shift + if [ "x$1" != "x" ] ; then + MILL_VERSION="$1" + shift + else + echo "You specified --mill-version without a version." 1>&2 + echo "Please provide a version that matches one provided on" 1>&2 + echo "${MILL_REPO_URL}/releases" 1>&2 + false + fi +fi + +# Please note, that if a MILL_VERSION is already set in the environment, +# We reuse it's value and skip searching for a value. + +# If not already set, read .mill-version file +if [ -z "${MILL_VERSION}" ] ; then + if [ -f ".mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)" + elif [ -f ".config/mill-version" ] ; then + MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)" + fi +fi + +MILL_USER_CACHE_DIR="${XDG_CACHE_HOME:-${HOME}/.cache}/mill" + +if [ -z "${MILL_DOWNLOAD_PATH}" ] ; then + MILL_DOWNLOAD_PATH="${MILL_USER_CACHE_DIR}/download" +fi + +# If not already set, try to fetch newest from Github +if [ -z "${MILL_VERSION}" ] ; then + # TODO: try to load latest version from release page + echo "No mill version specified." 1>&2 + echo "You should provide a version via '.mill-version' file or --mill-version option." 1>&2 + + mkdir -p "${MILL_DOWNLOAD_PATH}" + LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" 2>/dev/null || ( + # we might be on OSX or BSD which don't have -d option for touch + # but probably a -A [-][[hh]mm]SS + touch "${MILL_DOWNLOAD_PATH}/.expire_latest"; touch -A -010000 "${MILL_DOWNLOAD_PATH}/.expire_latest" + ) || ( + # in case we still failed, we retry the first touch command with the intention + # to show the (previously suppressed) error message + LANG=C touch -d '1 hour ago' "${MILL_DOWNLOAD_PATH}/.expire_latest" + ) + + # POSIX shell variant of bash's -nt operator, see https://unix.stackexchange.com/a/449744/6993 + # if [ "${MILL_DOWNLOAD_PATH}/.latest" -nt "${MILL_DOWNLOAD_PATH}/.expire_latest" ] ; then + if [ -n "$(find -L "${MILL_DOWNLOAD_PATH}/.latest" -prune -newer "${MILL_DOWNLOAD_PATH}/.expire_latest")" ]; then + # we know a current latest version + MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) + fi + + if [ -z "${MILL_VERSION}" ] ; then + # we don't know a current latest version + echo "Retrieving latest mill version ..." 1>&2 + LANG=C ${CURL_CMD} -s -i -f -I ${MILL_REPO_URL}/releases/latest 2> /dev/null | grep --ignore-case Location: | sed s'/^.*tag\///' | tr -d '\r\n' > "${MILL_DOWNLOAD_PATH}/.latest" + MILL_VERSION=$(head -n 1 "${MILL_DOWNLOAD_PATH}"/.latest 2> /dev/null) + fi + + if [ -z "${MILL_VERSION}" ] ; then + # Last resort + MILL_VERSION="${DEFAULT_MILL_VERSION}" + echo "Falling back to hardcoded mill version ${MILL_VERSION}" 1>&2 + else + echo "Using mill version ${MILL_VERSION}" 1>&2 + fi +fi + +MILL_NATIVE_SUFFIX="-native" +FULL_MILL_VERSION=$MILL_VERSION +ARTIFACT_SUFFIX="" +case "$MILL_VERSION" in + *"$MILL_NATIVE_SUFFIX") + MILL_VERSION=${MILL_VERSION%"$MILL_NATIVE_SUFFIX"} + if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then + if [ "$(uname -m)" = "aarch64" ]; then + ARTIFACT_SUFFIX="-native-linux-aarch64" + else + ARTIFACT_SUFFIX="-native-linux-amd64" + fi + elif [ "$(uname)" = "Darwin" ]; then + if [ "$(uname -m)" = "arm64" ]; then + ARTIFACT_SUFFIX="-native-mac-aarch64" + else + ARTIFACT_SUFFIX="-native-mac-amd64" + fi + else + echo "This native mill launcher supports only Linux and macOS." 1>&2 + exit 1 + fi +esac + +MILL="${MILL_DOWNLOAD_PATH}/${FULL_MILL_VERSION}" + +try_to_use_system_mill() { + if [ "$(uname)" != "Linux" ]; then + return 0 + fi + + MILL_IN_PATH="$(command -v mill || true)" + + if [ -z "${MILL_IN_PATH}" ]; then + return 0 + fi + + SYSTEM_MILL_FIRST_TWO_BYTES=$(head --bytes=2 "${MILL_IN_PATH}") + if [ "${SYSTEM_MILL_FIRST_TWO_BYTES}" = "#!" ]; then + # MILL_IN_PATH is (very likely) a shell script and not the mill + # executable, ignore it. + return 0 + fi + + SYSTEM_MILL_PATH=$(readlink -e "${MILL_IN_PATH}") + SYSTEM_MILL_SIZE=$(stat --format=%s "${SYSTEM_MILL_PATH}") + SYSTEM_MILL_MTIME=$(stat --format=%y "${SYSTEM_MILL_PATH}") + + if [ ! -d "${MILL_USER_CACHE_DIR}" ]; then + mkdir -p "${MILL_USER_CACHE_DIR}" + fi + + SYSTEM_MILL_INFO_FILE="${MILL_USER_CACHE_DIR}/system-mill-info" + if [ -f "${SYSTEM_MILL_INFO_FILE}" ]; then + parseSystemMillInfo() { + LINE_NUMBER="${1}" + # Select the line number of the SYSTEM_MILL_INFO_FILE, cut the + # variable definition in that line in two halves and return + # the value, and finally remove the quotes. + sed -n "${LINE_NUMBER}p" "${SYSTEM_MILL_INFO_FILE}" |\ + cut -d= -f2 |\ + sed 's/"\(.*\)"/\1/' + } + + CACHED_SYSTEM_MILL_PATH=$(parseSystemMillInfo 1) + CACHED_SYSTEM_MILL_VERSION=$(parseSystemMillInfo 2) + CACHED_SYSTEM_MILL_SIZE=$(parseSystemMillInfo 3) + CACHED_SYSTEM_MILL_MTIME=$(parseSystemMillInfo 4) + + if [ "${SYSTEM_MILL_PATH}" = "${CACHED_SYSTEM_MILL_PATH}" ] \ + && [ "${SYSTEM_MILL_SIZE}" = "${CACHED_SYSTEM_MILL_SIZE}" ] \ + && [ "${SYSTEM_MILL_MTIME}" = "${CACHED_SYSTEM_MILL_MTIME}" ]; then + if [ "${CACHED_SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then + MILL="${SYSTEM_MILL_PATH}" + return 0 + else + return 0 + fi + fi + fi + + SYSTEM_MILL_VERSION=$(${SYSTEM_MILL_PATH} --version | head -n1 | sed -n 's/^Mill.*version \(.*\)/\1/p') + + cat < "${SYSTEM_MILL_INFO_FILE}" +CACHED_SYSTEM_MILL_PATH="${SYSTEM_MILL_PATH}" +CACHED_SYSTEM_MILL_VERSION="${SYSTEM_MILL_VERSION}" +CACHED_SYSTEM_MILL_SIZE="${SYSTEM_MILL_SIZE}" +CACHED_SYSTEM_MILL_MTIME="${SYSTEM_MILL_MTIME}" +EOF + + if [ "${SYSTEM_MILL_VERSION}" = "${MILL_VERSION}" ]; then + MILL="${SYSTEM_MILL_PATH}" + fi +} +try_to_use_system_mill + +# If not already downloaded, download it +if [ ! -s "${MILL}" ] ; then + + # support old non-XDG download dir + MILL_OLD_DOWNLOAD_PATH="${HOME}/.mill/download" + OLD_MILL="${MILL_OLD_DOWNLOAD_PATH}/${MILL_VERSION}" + if [ -x "${OLD_MILL}" ] ; then + MILL="${OLD_MILL}" + else + case $MILL_VERSION in + 0.0.* | 0.1.* | 0.2.* | 0.3.* | 0.4.* ) + DOWNLOAD_SUFFIX="" + DOWNLOAD_FROM_MAVEN=0 + ;; + 0.5.* | 0.6.* | 0.7.* | 0.8.* | 0.9.* | 0.10.* | 0.11.0-M* ) + DOWNLOAD_SUFFIX="-assembly" + DOWNLOAD_FROM_MAVEN=0 + ;; + *) + DOWNLOAD_SUFFIX="-assembly" + DOWNLOAD_FROM_MAVEN=1 + ;; + esac + + DOWNLOAD_FILE=$(mktemp mill.XXXXXX) + + if [ "$DOWNLOAD_FROM_MAVEN" = "1" ] ; then + DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.jar" + else + MILL_VERSION_TAG=$(echo "$MILL_VERSION" | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/') + DOWNLOAD_URL="${GITHUB_RELEASE_CDN}${MILL_REPO_URL}/releases/download/${MILL_VERSION_TAG}/${MILL_VERSION}${DOWNLOAD_SUFFIX}" + unset MILL_VERSION_TAG + fi + + # TODO: handle command not found + echo "Downloading mill ${MILL_VERSION} from ${DOWNLOAD_URL} ..." 1>&2 + ${CURL_CMD} -f -L -o "${DOWNLOAD_FILE}" "${DOWNLOAD_URL}" + chmod +x "${DOWNLOAD_FILE}" + mkdir -p "${MILL_DOWNLOAD_PATH}" + mv "${DOWNLOAD_FILE}" "${MILL}" + + unset DOWNLOAD_FILE + unset DOWNLOAD_SUFFIX + fi +fi + +if [ -z "$MILL_MAIN_CLI" ] ; then + MILL_MAIN_CLI="${0}" +fi + +MILL_FIRST_ARG="" +if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then + # Need to preserve the first position of those listed options + MILL_FIRST_ARG=$1 + shift +fi + +unset MILL_DOWNLOAD_PATH +unset MILL_OLD_DOWNLOAD_PATH +unset OLD_MILL +unset MILL_VERSION +unset MILL_REPO_URL + +# We don't quote MILL_FIRST_ARG on purpose, so we can expand the empty value without quotes +# shellcheck disable=SC2086 +exec "${MILL}" $MILL_FIRST_ARG -D "mill.main.cli=${MILL_MAIN_CLI}" "$@" \ No newline at end of file diff --git a/frameworks/Scala/sharaf/sharaf.dockerfile b/frameworks/Scala/sharaf/sharaf.dockerfile new file mode 100644 index 00000000000..d15c119240b --- /dev/null +++ b/frameworks/Scala/sharaf/sharaf.dockerfile @@ -0,0 +1,14 @@ +FROM eclipse-temurin:21-jdk-ubi9-minimal +WORKDIR /sharaf + +COPY src src +COPY build.mill build.mill +COPY mill mill +RUN chmod 777 mill +COPY .mill-version .mill-version + +RUN ./mill assembly + +EXPOSE 8080 + +CMD ["java", "-server", "-Xms1g", "-Xmx1g", "-jar", "out/assembly.dest/out.jar"] diff --git a/frameworks/Scala/sharaf/src/db.scala b/frameworks/Scala/sharaf/src/db.scala new file mode 100644 index 00000000000..960715e9c12 --- /dev/null +++ b/frameworks/Scala/sharaf/src/db.scala @@ -0,0 +1,52 @@ +package ba.sake.sharaf.benchmark + +import java.util.concurrent.ThreadLocalRandom +import scala.collection.mutable +import ba.sake.squery.{*, given} +import scala.collection.decorators.* + +class DAO { + private val ds = com.zaxxer.hikari.HikariDataSource() + ds.setJdbcUrl("jdbc:postgresql://tfb-database:5432/hello_world") + ds.setUsername("benchmarkdbuser") + ds.setPassword("benchmarkdbpass") + ds.setMaximumPoolSize(48) + private val squeryContext = SqueryContext(ds) + + def getRandomWorld(): WorldRow = squeryContext.run { + sql"SELECT id, randomnumber FROM world WHERE id = ${getRandomRowId()}" + .readRow() + } + + def getRandomWorlds(queriesCount: Int): Seq[WorldRow] = squeryContext.run { + val buffer = new mutable.ArrayBuffer[WorldRow](queriesCount) + for i <- 0 until queriesCount do + buffer += sql"SELECT id, randomnumber FROM world WHERE id = ${getRandomRowId()}" + .readRow() + buffer.toSeq + } + + def updateWorlds(rows: Seq[WorldRow]): Unit = squeryContext.run { + val values = rows + .map(row => sql"(${row.id}, ${row.randomnumber})") + .intersperse(sql",") + .reduce(_ ++ _) + sql""" + UPDATE world as w + SET randomnumber = c.randomnumber + FROM (VALUES ${values}) AS c(id, randomnumber) + WHERE w.id = c.id + """.update() + } + + def getFortunes(): Seq[FortuneRow] = squeryContext.run { + sql"SELECT id, message FROM fortune".readRows() + } + + def getRandomRowId(): Int = + return 1 + ThreadLocalRandom.current().nextInt(10000) + +} + +case class WorldRow(id: Int, randomnumber: Int) derives SqlReadRow +case class FortuneRow(id: Int, message: String) derives SqlReadRow diff --git a/frameworks/Scala/sharaf/src/main.scala b/frameworks/Scala/sharaf/src/main.scala new file mode 100644 index 00000000000..a562900fd04 --- /dev/null +++ b/frameworks/Scala/sharaf/src/main.scala @@ -0,0 +1,22 @@ +package ba.sake.sharaf.benchmark + +import io.undertow.Undertow +import io.undertow.UndertowOptions +import ba.sake.sharaf.* + +@main def run(): Unit = { + val dao = DAO() + val benchmarkRoutes = BenchmarkRoutes(dao) + val server = Undertow + .builder() + .addHttpListener(8080, "0.0.0.0") + .setHandler(SharafHandler(benchmarkRoutes.routes)) + .setIoThreads(Runtime.getRuntime().availableProcessors() * 2) + // In HTTP/1.1, connections are persistent unless declared otherwise. + // Adding a "Connection: keep-alive" header to every response would only + // add useless bytes. + .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) + .build() + server.start() + println(s"Started HTTP server at localhost:8080") +} diff --git a/frameworks/Scala/sharaf/src/pages.scala b/frameworks/Scala/sharaf/src/pages.scala new file mode 100644 index 00000000000..659d7737b3b --- /dev/null +++ b/frameworks/Scala/sharaf/src/pages.scala @@ -0,0 +1,21 @@ +package ba.sake.sharaf.benchmark + +import scalatags.Text.all.* +import ba.sake.hepek.html.HtmlPage + +class FortunesPage(rows: Seq[FortuneRow]) extends HtmlPage { + override def pageSettings = super.pageSettings.withTitle("Fortunes") + + override def bodyContent = table( + tr( + th("id"), + th("message") + ), + rows.map { row => + tr( + td(row.id), + td(row.message) + ) + } + ) +} diff --git a/frameworks/Scala/sharaf/src/routes.scala b/frameworks/Scala/sharaf/src/routes.scala new file mode 100644 index 00000000000..01a456d7f39 --- /dev/null +++ b/frameworks/Scala/sharaf/src/routes.scala @@ -0,0 +1,59 @@ +package ba.sake.sharaf.benchmark + +import ba.sake.sharaf.*, routing.* +import ba.sake.querson.* +import ba.sake.tupson.* + +class BenchmarkRoutes(dao: DAO) { + + def routes: Routes = Routes { + case GET() -> Path("plaintext") => + Response.withBody("Hello, World!").settingHeader("Server", "sharaf") + + case GET() -> Path("json") => + Response + .withBody(MessageResponse("Hello, World!")) + .settingHeader("Server", "sharaf") + + case GET() -> Path("db") => + val row = dao.getRandomWorld() + val body = WorldResponse(row.id, row.randomnumber) + Response.withBody(body).settingHeader("Server", "sharaf") + + case GET() -> Path("queries") => + val queriesCountStr = Request.current.queryParams[QueriesQP].queries + var queriesCount = queriesCountStr.toIntOption.getOrElse(1) + if queriesCount < 1 then queriesCount = 1 + if queriesCount > 500 then queriesCount = 500 + val rows = dao.getRandomWorlds(queriesCount) + val body = rows.map(row => WorldResponse(row.id, row.randomnumber)) + Response.withBody(body).settingHeader("Server", "sharaf") + + case GET() -> Path("fortunes") => + val rows = dao + .getFortunes() + .appended(FortuneRow(0, "Additional fortune added at request time.")) + val rowsSorted = rows.sortBy(_.message) + val body = FortunesPage(rowsSorted) + Response.withBody(body).settingHeader("Server", "sharaf") + + case GET() -> Path("updates") => + val queriesCountStr = Request.current.queryParams[QueriesQP].queries + var queriesCount = queriesCountStr.toIntOption.getOrElse(1) + if queriesCount < 1 then queriesCount = 1 + if queriesCount > 500 then queriesCount = 500 + val rows = dao.getRandomWorlds(queriesCount) + val updatedRows = rows.map(_.copy(randomnumber = dao.getRandomRowId())) + dao.updateWorlds(updatedRows) + val body = updatedRows.map(row => WorldResponse(row.id, row.randomnumber)) + Response.withBody(body).settingHeader("Server", "sharaf") + + } +} + +// query params +case class QueriesQP(queries: String = "1") derives QueryStringRW + +// json responses +case class MessageResponse(message: String) derives JsonRW +case class WorldResponse(id: Int, randomNumber: Int) derives JsonRW diff --git a/frameworks/TypeScript/nest/package.json b/frameworks/TypeScript/nest/package.json index fe27e6fc40b..8b84a7e2ccc 100644 --- a/frameworks/TypeScript/nest/package.json +++ b/frameworks/TypeScript/nest/package.json @@ -21,9 +21,9 @@ "@nestjs/platform-fastify": "6.11.11", "@nestjs/typeorm": "7.1.5", "cache-manager": "3.1.0", - "fastify": "2.12.1", + "fastify": "2.15.1", "fastify-formbody": "3.1.0", - "handlebars": "4.7.3", + "handlebars": "4.7.7", "hbs": "4.1.0", "mongodb": "3.5.4", "mysql2": "3.9.8", diff --git a/frameworks/TypeScript/nextjs/README.md b/frameworks/TypeScript/nextjs/README.md index c6cb986eac7..10411041b28 100644 --- a/frameworks/TypeScript/nextjs/README.md +++ b/frameworks/TypeScript/nextjs/README.md @@ -27,21 +27,3 @@ [`app/updates/route.ts`]: ./app/updates/route.ts [`app/plaintext/route.ts`]: ./app/plaintext/route.ts [`app/cached-queries/route.ts`]: ./app/cached-queries/route.ts - -## TODO - -The Fortunes test is currently disabled because the benchmark expects exact HTML output — see [TechEmpower/FrameworkBenchmarks#9505](https://github.com/TechEmpower/FrameworkBenchmarks/pull/9505). After that issue is resolved, the Fortunes test can be re-enabled by applying the following diff: - -```diff ---- a/frameworks/TypeScript/nextjs/benchmark_config.json -+++ b/frameworks/TypeScript/nextjs/benchmark_config.json -@@ -20,7 +20,7 @@ - "json_url": "/json", - "db_url": "/db", - "query_url": "/queries?queries=", -- "TEMPORARILY DISABLED fortune_url": "/fortunes", -+ "fortune_url": "/fortunes", - "update_url": "/updates?queries=", - "plaintext_url": "/plaintext", - "cached_query_url": "/cached-queries?queries=" -``` diff --git a/frameworks/TypeScript/nextjs/benchmark_config.json b/frameworks/TypeScript/nextjs/benchmark_config.json index d0853b96419..72980fe5922 100644 --- a/frameworks/TypeScript/nextjs/benchmark_config.json +++ b/frameworks/TypeScript/nextjs/benchmark_config.json @@ -20,7 +20,7 @@ "json_url": "/json", "db_url": "/db", "query_url": "/queries?queries=", - "TEMPORARILY DISABLED fortune_url": "/fortunes", + "fortune_url": "/fortunes", "update_url": "/updates?queries=", "plaintext_url": "/plaintext", "cached_query_url": "/cached-queries?queries=" diff --git a/frameworks/TypeScript/nextjs/middleware.ts b/frameworks/TypeScript/nextjs/middleware.ts deleted file mode 100644 index 7983b8a3673..00000000000 --- a/frameworks/TypeScript/nextjs/middleware.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NextRequest, NextResponse } from "next/server" - -export function middleware(request: NextRequest) { - const response = NextResponse.next() - response.headers.set("Server", "Next.js") - return response -} diff --git a/frameworks/TypeScript/nextjs/next.config.ts b/frameworks/TypeScript/nextjs/next.config.ts index 68a6c64d279..7d67e37baf8 100644 --- a/frameworks/TypeScript/nextjs/next.config.ts +++ b/frameworks/TypeScript/nextjs/next.config.ts @@ -2,6 +2,17 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: "standalone", + + async headers() { + return [ + { + source: "/(.*?)", + headers: [ + { key: "Server", value: "Next.js" }, + ], + }, + ] + }, }; export default nextConfig; diff --git a/toolset/test_types/fortune/fortune_html_parser.py b/toolset/test_types/fortune/fortune_html_parser.py index c01a5870386..b076b367575 100644 --- a/toolset/test_types/fortune/fortune_html_parser.py +++ b/toolset/test_types/fortune/fortune_html_parser.py @@ -8,8 +8,17 @@ class FortuneHTMLParser(HTMLParser): + IGNORED_TAGS = ( + "", "", + "", "", + "", + "", "", + "", "", + ) + def __init__(self): HTMLParser.__init__(self, convert_charrefs=False) + self.ignore_content = False self.body = [] valid_fortune = ''' @@ -41,7 +50,7 @@ def handle_decl(self, decl): # and since we did not specify xml compliance (where # incorrect casing would throw a syntax error), we must # allow all casings. We will lower for our normalization. - self.body.append("".format(d=decl.lower())) + self.append("".format(d=decl.lower())) def handle_charref(self, name): ''' @@ -63,37 +72,37 @@ def handle_charref(self, name): # equality. if val == "34" or val == "034" or val == "x22": # Append our normalized entity reference to our body. - self.body.append(""") + self.append(""") # "'" is a valid escaping of "-", but it is not # required, so we normalize for equality checking. if val == "39" or val == "039" or val == "x27": - self.body.append("'") + self.append("'") # Again, "+" is a valid escaping of the "+", but # it is not required, so we need to normalize for out # final parse and equality check. if val == "43" or val == "043" or val == "x2b": - self.body.append("+") + self.append("+") # Again, ">" is a valid escaping of ">", but we # need to normalize to ">" for equality checking. if val == "62" or val == "062" or val == "x3e": - self.body.append(">") + self.append(">") # Again, "<" is a valid escaping of "<", but we # need to normalize to "<" for equality checking. if val == "60" or val == "060" or val == "x3c": - self.body.append("<") + self.append("<") # Not sure why some are escaping '/' if val == "47" or val == "047" or val == "x2f": - self.body.append("/") + self.append("/") # "(" is a valid escaping of "(", but # it is not required, so we need to normalize for out # final parse and equality check. if val == "40" or val == "040" or val == "x28": - self.body.append("(") + self.append("(") # ")" is a valid escaping of ")", but # it is not required, so we need to normalize for out # final parse and equality check. if val == "41" or val == "041" or val == "x29": - self.body.append(")") + self.append(")") def handle_entityref(self, name): ''' @@ -101,20 +110,20 @@ def handle_entityref(self, name): need to normalize to "—" for equality checking. ''' if name == "mdash": - self.body.append("—") + self.append("—") else: - self.body.append("&{n};".format(n=name)) + self.append("&{n};".format(n=name)) def handle_starttag(self, tag, attrs): ''' This is called every time a tag is opened. We append each one wrapped in "<" and ">". ''' - self.body.append("<{t}>".format(t=tag)) + self.append("<{t}>".format(t=tag)) # Append a newline after the and if tag.lower() == 'table' or tag.lower() == 'html': - self.body.append(os.linesep) + self.append(os.linesep) def handle_data(self, data): ''' @@ -146,18 +155,24 @@ def handle_data(self, data): data = data.replace('"', '"') data = data.replace('>', '>') - self.body.append("{d}".format(d=data)) + self.append("{d}".format(d=data)) def handle_endtag(self, tag): ''' This is called every time a tag is closed. We append each one wrapped in "". ''' - self.body.append("".format(t=tag)) + self.append("".format(t=tag)) # Append a newline after each and if tag.lower() == 'tr' or tag.lower() == 'head': - self.body.append(os.linesep) + self.append(os.linesep) + + def append(self, item): + self.ignore_content = item == "") + + if not (self.ignore_content or item in self.IGNORED_TAGS): + self.body.append(item) def isValidFortune(self, name, out): '''