diff --git a/frameworks/Java/smart-socket/pom.xml b/frameworks/Java/smart-socket/pom.xml index a4107b3d3e8..afdeea27141 100644 --- a/frameworks/Java/smart-socket/pom.xml +++ b/frameworks/Java/smart-socket/pom.xml @@ -11,7 +11,7 @@ 21 21 2.17.1 - 2.5 + 2.7 5.0.0 0.9.23 diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java index 9dda965e0be..4875d68c8d8 100755 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java @@ -11,11 +11,11 @@ import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import org.smartboot.Message; -import org.smartboot.http.server.HttpBootstrap; -import org.smartboot.http.server.HttpRequest; -import org.smartboot.http.server.HttpResponse; -import org.smartboot.http.server.HttpServerHandler; -import org.smartboot.http.server.handler.HttpRouteHandler; +import tech.smartboot.feat.core.server.HttpRequest; +import tech.smartboot.feat.core.server.HttpResponse; +import tech.smartboot.feat.core.server.HttpServer; +import tech.smartboot.feat.core.server.HttpServerHandler; +import tech.smartboot.feat.core.server.handler.HttpRouteHandler; import javax.sql.DataSource; @@ -25,9 +25,9 @@ public class Bootstrap { public static void main(String[] args) { int cpuNum = Runtime.getRuntime().availableProcessors(); // 定义服务器接受的消息类型以及各类消息对应的处理器 - HttpBootstrap bootstrap = new HttpBootstrap(); + HttpServer bootstrap = new HttpServer(); bootstrap.configuration() - .threadNum(cpuNum) + .threadNum(cpuNum + 1) .headerLimiter(0) .readBufferSize(1024 * 4) .writeBufferSize(1024 * 4); diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java index b20525ec571..31a7d546119 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/JsonUtil.java @@ -5,7 +5,7 @@ import com.jsoniter.spi.JsonException; import com.jsoniter.spi.Slice; import jakarta.servlet.http.HttpServletResponse; -import org.smartboot.http.server.HttpResponse; +import tech.smartboot.feat.core.server.HttpResponse; import java.io.IOException; diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/MultipleQueriesHandler.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/MultipleQueriesHandler.java index 61b9f66b344..ac4807a9284 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/MultipleQueriesHandler.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/MultipleQueriesHandler.java @@ -1,9 +1,10 @@ package org.smartboot.http; -import org.smartboot.http.common.utils.NumberUtils; -import org.smartboot.http.server.HttpRequest; -import org.smartboot.http.server.HttpResponse; -import org.smartboot.http.server.HttpServerHandler; + +import tech.smartboot.feat.core.common.utils.NumberUtils; +import tech.smartboot.feat.core.server.HttpRequest; +import tech.smartboot.feat.core.server.HttpResponse; +import tech.smartboot.feat.core.server.HttpServerHandler; import javax.sql.DataSource; import java.io.IOException; diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/SingleQueryHandler.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/SingleQueryHandler.java index b69495d1a5e..52a96b9ca57 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/SingleQueryHandler.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/SingleQueryHandler.java @@ -1,8 +1,9 @@ package org.smartboot.http; -import org.smartboot.http.server.HttpRequest; -import org.smartboot.http.server.HttpResponse; -import org.smartboot.http.server.HttpServerHandler; + +import tech.smartboot.feat.core.server.HttpRequest; +import tech.smartboot.feat.core.server.HttpResponse; +import tech.smartboot.feat.core.server.HttpServerHandler; import javax.sql.DataSource; import java.io.IOException; diff --git a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/UpdateHandler.java b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/UpdateHandler.java index 065bed5a9a6..3217adea343 100644 --- a/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/UpdateHandler.java +++ b/frameworks/Java/smart-socket/src/main/java/org/smartboot/http/UpdateHandler.java @@ -1,9 +1,10 @@ package org.smartboot.http; -import org.smartboot.http.common.utils.NumberUtils; -import org.smartboot.http.server.HttpRequest; -import org.smartboot.http.server.HttpResponse; -import org.smartboot.http.server.HttpServerHandler; + +import tech.smartboot.feat.core.common.utils.NumberUtils; +import tech.smartboot.feat.core.server.HttpRequest; +import tech.smartboot.feat.core.server.HttpResponse; +import tech.smartboot.feat.core.server.HttpServerHandler; import javax.sql.DataSource; import java.io.IOException; diff --git a/frameworks/Java/solon/pom.xml b/frameworks/Java/solon/pom.xml index d483a51b397..30701fd2661 100644 --- a/frameworks/Java/solon/pom.xml +++ b/frameworks/Java/solon/pom.xml @@ -5,7 +5,7 @@ org.noear solon-parent - 3.0.4 + 3.0.5 hello @@ -21,7 +21,12 @@ org.noear - solon-web + solon-lib + + + + org.noear + solon-boot-smarthttp diff --git a/frameworks/Java/tio-http-server/.dockerignore b/frameworks/Java/tio-http-server/.dockerignore new file mode 100644 index 00000000000..cba5dfe3c3b --- /dev/null +++ b/frameworks/Java/tio-http-server/.dockerignore @@ -0,0 +1,19 @@ +.github +.git +.DS_Store +docs +kubernetes +node_modules +/.svelte-kit +/package +.env +.env.* +vite.config.js.timestamp-* +vite.config.ts.timestamp-* +__pycache__ +.env +_old +uploads +.ipynb_checkpoints +**/*.db +_test \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/.gitignore b/frameworks/Java/tio-http-server/.gitignore new file mode 100644 index 00000000000..2f089945614 --- /dev/null +++ b/frameworks/Java/tio-http-server/.gitignore @@ -0,0 +1,3 @@ +/target/ +logs +.settings \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/README.md b/frameworks/Java/tio-http-server/README.md new file mode 100644 index 00000000000..bb1539e7db1 --- /dev/null +++ b/frameworks/Java/tio-http-server/README.md @@ -0,0 +1,114 @@ +# t-io Benchmarking Test + +This is the tio-server portion of a [benchmarking test suite](../) comparing a variety of web development platforms. + +## Controller + +These implementations use the tio-server's controller. + +### Plaintext Test + +* [Plaintext test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java) + +### JSON Serialization Test + +* [JSON test source](src/main/java/com/litongjava/tio/http/server/controller/IndexController.java) + +### Database Query Test + +* [Database Query test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) + +### Database Queries Test + +* [Database Queries test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) + +### Database Update Test + +* [Database Update test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) + +### Template rendering Test + +* [Template rendering test source](src/main/java/com/litongjava/tio/http/server/controller/DbController.java)) + +### Cache Query Test +* [Cache query test source](src/main/java/com/litongjava/tio/http/server/controller/CacheController.java)) + + +## Versions +3.7.3.v20231218-RELEASE (https://gitee.com/litongjava/t-io) + +## Test URLs + +All implementations use the same URLs. + +### Plaintext Test + + http://localhost:8080/plaintext + +### JSON Encoding Test + + http://localhost:8080/json + +### Database Query Test + + http://localhost:8080/db + +### Database Queries Test + + http://localhost:8080/queries?queries=5 + +### Cache Query Test + + http://localhost:8080/cacheQuery?queries=10000 + +### Template rendering Test + + http://localhost:8080/fortunes + +### Database Update Test + + http://localhost:8080/updates?queries=5 + + ## Hot to run + ### install mysql 8 + - 1.please instal mysql 8.0.32,example cmd + ``` + docker run --restart=always -d --name mysql_8 --hostname mysql \ +-p 3306:3306 \ +-e 'MYSQL_ROOT_PASSWORD=robot_123456#' -e 'MYSQL_ROOT_HOST=%' -e 'MYSQL_DATABASE=hello_world' \ +mysql/mysql-server:8.0.32 \ +--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --lower_case_table_names=1 + ``` + - 2.create database schema hello_world + - 3.create tablle,[example](sql/hello_world.sql) + - 4.import data + + ### docker + ``` + docker build -t tio-server-benchmark -f tio-server.dockerfile . +``` +The run is to specify the mysql database +``` +docker run --rm -p 8080:8080 \ +-e JDBC_URL="jdbc:mysql://192.168.3.9/hello_world" \ +-e JDBC_USER="root" \ +-e JDBC_PSWD="robot_123456#" \ +tio-server-benchmark +``` + +### windows + +-windows +``` +D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar --JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false --JDBC_USER=root --JDBC_PSWD=robot_123456# +``` +or +``` +set JDBC_URL=jdbc:mysql://192.168.3.9/hello_world +set jdbc.user=root +set JDBC_PSWD=robot_123456# +D:\java\jdk1.8.0_121\bin\java -jar target\tio-server-benchmark-1.0.jar +``` + + + diff --git a/frameworks/Java/tio-http-server/api/tio-server-benchmark.md b/frameworks/Java/tio-http-server/api/tio-server-benchmark.md new file mode 100644 index 00000000000..1d302df2d5d --- /dev/null +++ b/frameworks/Java/tio-http-server/api/tio-server-benchmark.md @@ -0,0 +1,227 @@ +--- +title: tio-server-benchmark v1.0.0 +language_tabs: + - shell: Shell + - http: HTTP + - javascript: JavaScript + - ruby: Ruby + - python: Python + - php: PHP + - java: Java + - go: Go +toc_footers: [] +includes: [] +search: true +code_clipboard: true +highlight_theme: darkula +headingLevel: 2 +generator: "@tarslib/widdershins v4.0.17" + +--- + +# tio-server-benchmark + +> v1.0.0 + +Base URLs: + +# Authentication + +# Default + +## GET plaintext + +GET /plaintext + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET json + +GET /json + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET db + +GET /db + +### 请求参数 + +|名称|位置|类型|必选|说明| +|---|---|---|---|---| +|id|query|string| 否 |none| + +> 返回示例 + +> 200 Response + +```json +{ + "id": 0, + "randomNumber": 0 +} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» id|integer|true|none||none| +|» randomNumber|integer|true|none||none| + +## GET updates + +GET /updates + +### 请求参数 + +|名称|位置|类型|必选|说明| +|---|---|---|---|---| +|queries|query|string| 否 |none| + +> 返回示例 + +> 成功 + +```json +[ + { + "id": 28, + "randomNumber": 5399, + "randomnumber": 1498 + } +] +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» id|integer|false|none||none| +|» randomNumber|integer|false|none||none| +|» randomnumber|integer|false|none||none| + +## GET fortunes + +GET /fortunes + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET cacheQuery + +GET /cacheQuery + +### 请求参数 + +|名称|位置|类型|必选|说明| +|---|---|---|---|---| +|queries|query|string| 否 |none| + +> 返回示例 + +> 200 Response + +```json +[ + { + "id": 0, + "randomNumber": 0 + } +] +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» id|integer|false|none||none| +|» randomNumber|integer|false|none||none| + +## GET cacheList + +GET /cacheList + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +# 数据模型 + diff --git a/frameworks/Java/tio-http-server/benchmark_config.json b/frameworks/Java/tio-http-server/benchmark_config.json new file mode 100644 index 00000000000..5cd4c92b275 --- /dev/null +++ b/frameworks/Java/tio-http-server/benchmark_config.json @@ -0,0 +1,29 @@ +{ + "framework": "tio-server", + "tests": [{ + "default": { + "plaintext_url": "/plaintext", + "json_url": "/json", + "db_url": "/db", + "query_url": "/queries?queries=", + "fortune_url": "/fortunes", + "update_url": "/updates?queries=", + "cached_query_url" : "/cachedQuery?queries=", + "port": 8080, + "approach": "Realistic", + "classification": "Micro", + "database": "MySQL", + "framework": "tio-server", + "language": "Java", + "flavor": "None", + "orm": "Raw", + "platform": "t-io", + "webserver": "None", + "os": "Linux", + "database_os": "Linux", + "display_name": "tio-server", + "notes": "tio-server", + "versus": "t-io" + } + }] +} diff --git a/frameworks/Java/tio-http-server/config.toml b/frameworks/Java/tio-http-server/config.toml new file mode 100644 index 00000000000..93dddb241c9 --- /dev/null +++ b/frameworks/Java/tio-http-server/config.toml @@ -0,0 +1,19 @@ +[framework] +name = "t-io" + +[main] +urls.plaintext = "/plaintext" +urls.json = "/json" +urls.query = "/queries?queries=" +urls.update = "/updates?queries=" +urls.fortune = "/fortunes" +urls.cached_query = "/cachedQuery?queries=" +approach = "Realistic" +classification = "Micro" +database = "None" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "t-io" +webserver = "None" +versus = "t-io" diff --git a/frameworks/Java/tio-http-server/pom.xml b/frameworks/Java/tio-http-server/pom.xml new file mode 100644 index 00000000000..2b16997b60e --- /dev/null +++ b/frameworks/Java/tio-http-server/pom.xml @@ -0,0 +1,209 @@ + + 4.0.0 + com.litongjava + tio-http-server-benchmark + 1.0 + ${project.artifactId} + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 23.1.1 + com.litongjava.tio.http.server.MainApp + + + + com.litongjava + tio-http-server + 3.7.3.v20240919-RELEASE + + + com.litongjava + java-db + 1.2.6 + + + junit + junit + 4.12 + test + + + + + + + + + com.alibaba.fastjson2 + fastjson2 + 2.0.52 + + + + net.sf.ehcache + ehcache-core + 2.6.11 + + + + mysql + mysql-connector-java + 5.1.46 + + + + com.zaxxer + HikariCP + 4.0.3 + + + + + + + development + + true + + + + ch.qos.logback + logback-classic + 1.2.13 + + + + + + + production + + + ch.qos.logback + logback-classic + 1.2.13 + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.7.4 + + ${main.class} + org.projectlombok + + + + + + repackage + + + + + + + + + + assembly + + + ch.qos.logback + logback-classic + 1.2.13 + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-assembly-plugin + 3.1.1 + + + + ${main.class} + + + + jar-with-dependencies + + false + + + + make-assembly + package + + single + + + + + + + + + native + + + + org.slf4j + slf4j-jdk14 + 1.7.31 + + + + org.graalvm.sdk + graal-sdk + ${graalvm.version} + provided + + + + ${project.artifactId} + + + org.graalvm.nativeimage + native-image-maven-plugin + 21.2.0 + + + + native-image + + package + + + + false + ${project.artifactId} + ${main.class} + + -H:+RemoveSaturatedTypeFlows + --allow-incomplete-classpath + --no-fallback + + + + + + + + \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/MainApp.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/MainApp.java new file mode 100644 index 00000000000..43a6bfc5804 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/MainApp.java @@ -0,0 +1,66 @@ +package com.litongjava.tio.http.server; + +import com.litongjava.tio.http.common.HttpConfig; +import com.litongjava.tio.http.common.handler.ITioHttpRequestHandler; +import com.litongjava.tio.http.server.config.EhCachePluginConfig; +import com.litongjava.tio.http.server.config.EnjoyEngineConfig; +import com.litongjava.tio.http.server.config.MysqlDbConfig; +import com.litongjava.tio.http.server.controller.CacheController; +import com.litongjava.tio.http.server.controller.DbController; +import com.litongjava.tio.http.server.controller.IndexController; +import com.litongjava.tio.http.server.handler.DefaultHttpRequestDispatcher; +import com.litongjava.tio.http.server.router.DefaultHttpReqeustRouter; +import com.litongjava.tio.http.server.router.HttpRequestRouter; +import com.litongjava.tio.server.ServerTioConfig; +import com.litongjava.tio.utils.environment.EnvUtils; + +public class MainApp { + + public static void main(String[] args) { + long start = System.currentTimeMillis(); + EnvUtils.load(); + // add route + IndexController controller = new IndexController(); + + HttpRequestRouter simpleHttpRoutes = new DefaultHttpReqeustRouter(); + simpleHttpRoutes.add("/", controller::index); + simpleHttpRoutes.add("/plaintext", controller::plaintext); + simpleHttpRoutes.add("/json", controller::json); + + DbController dbQueryController = new DbController(); + simpleHttpRoutes.add("/db", dbQueryController::db); + simpleHttpRoutes.add("/queries", dbQueryController::queries); + simpleHttpRoutes.add("/updates", dbQueryController::updates); + simpleHttpRoutes.add("/fortunes", dbQueryController::fortunes); + + CacheController cacheController = new CacheController(); + simpleHttpRoutes.add("/cachedQuery", cacheController::cachedQuery); + + // config server + HttpConfig httpConfig = new HttpConfig(8080, null, null, null); + httpConfig.setUseSession(false); + httpConfig.setWelcomeFile(null); + httpConfig.setCheckHost(false); + httpConfig.setCompatible1_0(false); + + ITioHttpRequestHandler requestHandler = new DefaultHttpRequestDispatcher(httpConfig, simpleHttpRoutes); + HttpServerStarter httpServerStarter = new HttpServerStarter(httpConfig, requestHandler); + ServerTioConfig serverTioConfig = httpServerStarter.getServerTioConfig(); + // close Heartbeat + serverTioConfig.setHeartbeatTimeout(0); + serverTioConfig.statOn = false; + // start server + try { + new MysqlDbConfig().init(); + new EnjoyEngineConfig().engine(); + new EhCachePluginConfig().ehCachePlugin(); + httpServerStarter.start(); + long end = System.currentTimeMillis(); + System.out.println((end - start) + "ms"); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + + } +} \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EhCachePluginConfig.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EhCachePluginConfig.java new file mode 100644 index 00000000000..f949432cd5b --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EhCachePluginConfig.java @@ -0,0 +1,12 @@ + package com.litongjava.tio.http.server.config; + +import com.litongjava.ehcache.EhCachePlugin; + +public class EhCachePluginConfig { + + public EhCachePlugin ehCachePlugin() { + EhCachePlugin ehCachePlugin = new EhCachePlugin(); + ehCachePlugin.start(); + return ehCachePlugin; + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EnjoyEngineConfig.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EnjoyEngineConfig.java new file mode 100644 index 00000000000..b40c74c448d --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/EnjoyEngineConfig.java @@ -0,0 +1,22 @@ +package com.litongjava.tio.http.server.config; + +import com.jfinal.template.Engine; + +public class EnjoyEngineConfig { + + private final String RESOURCE_BASE_PATH = "/templates/"; + + public Engine engine() { + Engine engine = Engine.use(); + engine.setBaseTemplatePath(RESOURCE_BASE_PATH); + engine.setToClassPathSourceFactory(); + // 支持模板热加载,绝大多数生产环境下也建议配置成 true,除非是极端高性能的场景 + // engine.setDevMode(true); + // 配置极速模式,性能提升 13% + Engine.setFastMode(true); + // jfinal 4.9.02 新增配置:支持中文表达式、中文变量名、中文方法名、中文模板函数名 + Engine.setChineseExpression(true); + return engine; + } + +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java new file mode 100644 index 00000000000..8a547854783 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/config/MysqlDbConfig.java @@ -0,0 +1,31 @@ +package com.litongjava.tio.http.server.config; + +import com.litongjava.db.activerecord.ActiveRecordPlugin; +import com.litongjava.db.activerecord.OrderedFieldContainerFactory; +import com.litongjava.db.hikaricp.HikariCpPlugin; +import com.litongjava.tio.utils.environment.EnvUtils; + +public class MysqlDbConfig { + + public void init() { + // start active recored + String jdbcUrl = EnvUtils.get("JDBC_URL"); + // String jdbcUrl = "jdbc:mysql://192.168.3.9/hello_world"; + + String jdbcUser = EnvUtils.get("JDBC_USER"); + // String jdbcUser = "root"; + + String jdbcPswd = EnvUtils.get("JDBC_PSWD"); + // String jdbcPswd = "robot_123456#"; + HikariCpPlugin hikariCpPlugin = new HikariCpPlugin(jdbcUrl, jdbcUser, jdbcPswd); + + ActiveRecordPlugin arp = new ActiveRecordPlugin(hikariCpPlugin); + arp.setContainerFactory(new OrderedFieldContainerFactory()); + + // arp.setShowSql(true); + + hikariCpPlugin.start(); + boolean start = arp.start(); + System.out.println("db started:" + start); + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/CacheController.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/CacheController.java new file mode 100644 index 00000000000..6ecd7664ac1 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/CacheController.java @@ -0,0 +1,41 @@ +package com.litongjava.tio.http.server.controller; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import com.alibaba.fastjson2.JSON; +import com.litongjava.db.activerecord.Db; +import com.litongjava.db.activerecord.Record; +import com.litongjava.tio.http.common.HeaderName; +import com.litongjava.tio.http.common.HeaderValue; +import com.litongjava.tio.http.common.HttpRequest; +import com.litongjava.tio.http.common.HttpResponse; +import com.litongjava.tio.http.server.utils.RandomUtils; + +public class CacheController { + // private Logger log = LoggerFactory.getLogger(this.getClass()); + + public HttpResponse cachedQuery(HttpRequest request) { + String queries = request.getParam("queries"); + List> recordMaps = RandomUtils.randomWorldNumbers() + // limit + .limit(RandomUtils.parseQueryCount(queries)) // 限制查询数量 + .mapToObj(id -> findByIdWithCache("world", id)) // 使用 mapToObj 将 int 映射为对象 + .filter(Objects::nonNull) // 过滤掉 null 值 + .map(Record::toMap) // 将每个 Record 对象转换为 Map + .collect(Collectors.toList()); // 收集到 List + + HttpResponse httpResponse = new HttpResponse(request); + httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); + httpResponse.setBody(JSON.toJSONBytes(recordMaps)); + return httpResponse; + + } + + private Record findByIdWithCache(String tableName, int id) { + String sql = "SELECT id, randomNumber FROM world WHERE id = ?"; + return Db.findFirstByCache(tableName, id, sql, id); + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/DbController.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/DbController.java new file mode 100644 index 00000000000..699b313bd69 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/DbController.java @@ -0,0 +1,127 @@ +package com.litongjava.tio.http.server.controller; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import com.alibaba.fastjson2.JSON; +import com.jfinal.template.Engine; +import com.jfinal.template.Template; +import com.litongjava.db.activerecord.Db; +import com.litongjava.db.activerecord.Record; +import com.litongjava.ehcache.EhCache; +import com.litongjava.tio.http.common.HeaderName; +import com.litongjava.tio.http.common.HeaderValue; +import com.litongjava.tio.http.common.HttpRequest; +import com.litongjava.tio.http.common.HttpResponse; +import com.litongjava.tio.http.server.model.Fortune; +import com.litongjava.tio.http.server.util.Resps; +import com.litongjava.tio.http.server.utils.BeanConverterUtils; +import com.litongjava.tio.http.server.utils.RandomUtils; + +public class DbController { + + public HttpResponse db(HttpRequest request) { + Integer id = request.getInt("id"); + if (id == null) { + id = RandomUtils.randomWorldNumber(); + } + + //System.out.println("id:" + id); + HttpResponse httpResponse = new HttpResponse(request); + + // int id = 11; + // String sql="SELECT id, randomNumber FROM world WHERE id = ?"; + + Record recored = Db.findById("world", id); + if (recored != null) { + httpResponse.setBody(JSON.toJSONBytes(recored.toMap())); + } else { + httpResponse.setBody("{}".getBytes()); + } + + httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); + + return httpResponse; + } + + // @GetMapping("/queries") + public HttpResponse queries(HttpRequest request) { + String queries = request.getParam("queries"); + List> recordMaps = RandomUtils.randomWorldNumbers() + // limit + .limit(RandomUtils.parseQueryCount(queries)) // 限制查询数量 + .mapToObj(id -> Db.findById("world", id)) // 使用 mapToObj 将 int 映射为对象 + .filter(Objects::nonNull) // 过滤掉 null 值 + .map(Record::toMap) // 将每个 Record 对象转换为 Map + .collect(Collectors.toList()); // 收集到 List + + HttpResponse httpResponse = new HttpResponse(request); + httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); + httpResponse.setBody(JSON.toJSONBytes(recordMaps)); + return httpResponse; + } + +//@GetMapping("/updates") + public HttpResponse updates(HttpRequest request) { + String queries = request.getParam("queries"); + + EhCache.removeAll("world"); + + List> updatedRecords = RandomUtils.randomWorldNumbers()// random numbers + // limit + .limit(RandomUtils.parseQueryCount(queries)) + // map + .mapToObj(id -> Db.findById("world", id)) + // not null + .filter(Objects::nonNull).map(record -> { + int currentRandomNumber = record.getInt("randomNumber"); // "randomnumber" + int newRandomNumber; + do { + newRandomNumber = RandomUtils.randomWorldNumber(); + } while (newRandomNumber == currentRandomNumber); + + record.set("randomnumber", newRandomNumber); + Db.update("world", "id", record); // update + return record; + }) + // tomap + .map(Record::toMap) + // to List + .collect(Collectors.toList()); + + HttpResponse httpResponse = new HttpResponse(request); + httpResponse.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); + httpResponse.setBody(JSON.toJSONBytes(updatedRecords)); + return httpResponse; + } + + public HttpResponse fortunes(HttpRequest request) throws IllegalAccessException, InstantiationException { + List records = Db.find("SELECT * FROM fortune"); + + List fortunes = new ArrayList<>(records.size()); + for (Record record : records) { + fortunes.add(BeanConverterUtils.toBean(record.toMap(), Fortune.class)); + } + // 添加额外的 Fortune + fortunes.add(new Fortune(0L, "Additional fortune added at request time.")); + + // 按照消息排序 + fortunes.sort(Comparator.comparing(Fortune::getMessage)); + + Map viewData = new HashMap<>(); + viewData.put("fortunes", fortunes); + + // 转换为 HTML + Engine engine = Engine.use(); + String filename = "fortunes.html"; + Template template = engine.getTemplate(filename); + String html = template.renderToString(viewData); + + return Resps.html(request, html); + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/IndexController.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/IndexController.java new file mode 100644 index 00000000000..cf87426dda3 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/controller/IndexController.java @@ -0,0 +1,40 @@ +package com.litongjava.tio.http.server.controller; + +import com.alibaba.fastjson2.JSON; +import com.litongjava.tio.http.common.HeaderName; +import com.litongjava.tio.http.common.HeaderValue; +import com.litongjava.tio.http.common.HttpRequest; +import com.litongjava.tio.http.common.HttpResponse; +import com.litongjava.tio.http.server.model.Message; +import com.litongjava.tio.http.server.util.Resps; + +/** + * ab -k -n1000000 -c10 http://127.0.0.1:8080/json + * ab -k -n1000000 -c10 http://127.0.0.1:8080/plaintext + */ +public class IndexController { + private static final String HELLO_WORLD = "Hello, World!"; + + private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD.getBytes(); + + public HttpResponse index(HttpRequest request) { + return Resps.txt(request, "tio-server"); + } + + public HttpResponse plaintext(HttpRequest request) { + // 更高性能的写法 + HttpResponse ret = new HttpResponse(request); + ret.setBody(HELLO_WORLD_BYTES); + ret.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_TXT); + return ret; + } + + // 在IndexController中添加 + public HttpResponse json(HttpRequest request) { + // 更高性能的写法 + HttpResponse ret = new HttpResponse(request); + ret.setBody(JSON.toJSONString(new Message(HELLO_WORLD)).getBytes()); + ret.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); + return ret; + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Fortune.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Fortune.java new file mode 100644 index 00000000000..728db88b837 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Fortune.java @@ -0,0 +1,23 @@ +package com.litongjava.tio.http.server.model; + +public final class Fortune { + + public Long id; + public String message; + + public Fortune() { + } + + public Fortune(Long id, String message) { + this.id = id; + this.message = message; + } + + public Long getId() { + return id; + } + + public String getMessage() { + return message; + } +} \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Message.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Message.java new file mode 100644 index 00000000000..2ad66214e0f --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/Message.java @@ -0,0 +1,12 @@ +package com.litongjava.tio.http.server.model; +public final class Message { + private final String message; + + public Message(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/World.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/World.java new file mode 100644 index 00000000000..06c4ed9a22b --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/model/World.java @@ -0,0 +1,32 @@ +package com.litongjava.tio.http.server.model; + +public final class World { + + public int id; + public int randomnumber; + + protected World() { + } + + public World(int id, int randomnumber) { + this.id = id; + this.randomnumber = randomnumber; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getRandomnumber() { + return randomnumber; + } + + public void setRandomnumber(int randomnumber) { + this.randomnumber = randomnumber; + } + +} \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheName.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheName.java new file mode 100644 index 00000000000..5707d4f05d4 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheName.java @@ -0,0 +1,50 @@ +package com.litongjava.tio.http.server.services; + +public class CacheName { + // `cacheName`(缓存名称) + private String name; + // `timeToLiveSeconds`(生存时间)和`timeToIdleSeconds`(闲置时间)。 + private Long timeToLiveSeconds; + private Long timeToIdleSeconds; + + public CacheName() { + } + + public CacheName(String name, Long timeToLiveSeconds, Long timeToIdleSeconds) { + super(); + this.name = name; + this.timeToLiveSeconds = timeToLiveSeconds; + this.timeToIdleSeconds = timeToIdleSeconds; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getTimeToLiveSeconds() { + return timeToLiveSeconds; + } + + public void setTimeToLiveSeconds(Long timeToLiveSeconds) { + this.timeToLiveSeconds = timeToLiveSeconds; + } + + public Long getTimeToIdleSeconds() { + return timeToIdleSeconds; + } + + public void setTimeToIdleSeconds(Long timeToIdleSeconds) { + this.timeToIdleSeconds = timeToIdleSeconds; + } + + @Override + public String toString() { + return "CacheName [name=" + name + ", timeToLiveSeconds=" + timeToLiveSeconds + ", timeToIdleSeconds=" + + timeToIdleSeconds + "]"; + } + +} \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheNameService.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheNameService.java new file mode 100644 index 00000000000..5ab5d7e58e6 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/services/CacheNameService.java @@ -0,0 +1,17 @@ +package com.litongjava.tio.http.server.services; + +import java.util.ArrayList; +import java.util.List; + +import com.litongjava.model.time.Time; + +public class CacheNameService { + private CacheName demo = new CacheName("world", null, Time.MINUTE_1 * 10); + + public List cacheNames() { + List list = new ArrayList<>(); + list.add(demo); + return list; + } + +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/BeanConverterUtils.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/BeanConverterUtils.java new file mode 100644 index 00000000000..11796feeb0f --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/BeanConverterUtils.java @@ -0,0 +1,31 @@ +package com.litongjava.tio.http.server.utils; + +import java.lang.reflect.Field; +import java.util.Map; + +public class BeanConverterUtils { + + /** + * Map to to bean + */ + public static T toBean(Map map, Class beanClass) + throws IllegalAccessException, InstantiationException { + + T bean = beanClass.newInstance(); // 创建 Bean 的实例 + + for (Field field : beanClass.getDeclaredFields()) { + field.setAccessible(true); // 确保私有字段也可以访问 + + if (map.containsKey(field.getName())) { + Object value = map.get(field.getName()); + + // 如果字段类型与值类型兼容,则设置字段的值 + if (value != null && field.getType().isAssignableFrom(value.getClass())) { + field.set(bean, value); + } + } + } + + return bean; + } +} diff --git a/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/RandomUtils.java b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/RandomUtils.java new file mode 100644 index 00000000000..e18e98ef880 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/utils/RandomUtils.java @@ -0,0 +1,36 @@ +package com.litongjava.tio.http.server.utils; + +import java.util.concurrent.ThreadLocalRandom; +import java.util.stream.IntStream; + +public class RandomUtils { + + private static final int MIN_WORLD_NUMBER = 1; + private static final int MAX_WORLD_NUMBER_PLUS_ONE = 10_001; +// private static final int MAX_WORLD_NUMBER_PLUS_ONE = 30; + + public static int randomWorldNumber() { + return ThreadLocalRandom.current().nextInt(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER_PLUS_ONE); + } + + public static IntStream randomWorldNumbers() { + return ThreadLocalRandom.current().ints(MIN_WORLD_NUMBER, MAX_WORLD_NUMBER_PLUS_ONE) + // distinct() allows us to avoid using Hibernate's first-level cache in + // the JPA-based implementation. Using a cache like that would bypass + // querying the database, which would violate the test requirements. + .distinct(); + } + + public static int parseQueryCount(String textValue) { + if (textValue == null) { + return 1; + } + int parsedValue; + try { + parsedValue = Integer.parseInt(textValue); + } catch (NumberFormatException e) { + return 1; + } + return Math.min(500, Math.max(1, parsedValue)); + } +} diff --git a/frameworks/Java/tio-http-server/src/main/resources/app.properties b/frameworks/Java/tio-http-server/src/main/resources/app.properties new file mode 100644 index 00000000000..b73b6ff144d --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/resources/app.properties @@ -0,0 +1,9 @@ +http.response.header.showServer=true + +#JDBC_URL=jdbc:mysql://192.168.3.9/hello_world?useSSL=false&allowPublicKeyRetrieval=true +#JDBC_USER=root +#JDBC_PSWD=robot_123456# + +JDBC_URL=jdbc:mysql://tfb-database/hello_world +JDBC_USER=benchmarkdbuser +JDBC_PSWD=benchmarkdbpass \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/resources/ehcache.xml b/frameworks/Java/tio-http-server/src/main/resources/ehcache.xml new file mode 100644 index 00000000000..79b79e49479 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/resources/ehcache.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/frameworks/Java/tio-http-server/src/main/resources/logback.xml b/frameworks/Java/tio-http-server/src/main/resources/logback.xml new file mode 100644 index 00000000000..aff0c711191 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/resources/logback.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + + + + ${CONSOLE_LOG_PATTERN} + + + + ${LOG_HOME}/project-name-%d{yyyy-MM-dd}.log + + 180 + + + + 10MB + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frameworks/Java/tio-http-server/src/main/resources/templates/fortunes.html b/frameworks/Java/tio-http-server/src/main/resources/templates/fortunes.html new file mode 100644 index 00000000000..1f6817df007 --- /dev/null +++ b/frameworks/Java/tio-http-server/src/main/resources/templates/fortunes.html @@ -0,0 +1,20 @@ + + + + Fortunes + + + + + + + + #for(fortune : fortunes) + + + + + #end +
idmessage
#(fortune.id)#escape(fortune.message)
+ + diff --git a/frameworks/Java/tio-http-server/src/test/java/com/litongjava/tio/http/server/MainAppTest.java b/frameworks/Java/tio-http-server/src/test/java/com/litongjava/tio/http/server/MainAppTest.java new file mode 100644 index 00000000000..e469fa256ef --- /dev/null +++ b/frameworks/Java/tio-http-server/src/test/java/com/litongjava/tio/http/server/MainAppTest.java @@ -0,0 +1,15 @@ +package com.litongjava.tio.http.server; + +import org.junit.Test; + +import com.litongjava.tio.utils.environment.EnvUtils; + +public class MainAppTest { + + @Test + public void test() { + boolean boolean1 = EnvUtils.getBoolean("native", false); + System.out.println(boolean1); + } + +} diff --git a/frameworks/Java/tio-http-server/tio-server-native.dockerfile b/frameworks/Java/tio-http-server/tio-server-native.dockerfile new file mode 100644 index 00000000000..8dd0f012ea0 --- /dev/null +++ b/frameworks/Java/tio-http-server/tio-server-native.dockerfile @@ -0,0 +1,9 @@ +FROM litongjava/maven:3.8.8-graalvm-jdk-21-slim +WORKDIR /t-io +COPY pom.xml pom.xml +COPY src src +RUN mvn package -Pnative -q + +EXPOSE 8080 + +CMD ["/t-io/target/tio-http-server-benchmark", " --native=true"] diff --git a/frameworks/Java/tio-http-server/tio-server.dockerfile b/frameworks/Java/tio-http-server/tio-server.dockerfile new file mode 100644 index 00000000000..e9218a84790 --- /dev/null +++ b/frameworks/Java/tio-http-server/tio-server.dockerfile @@ -0,0 +1,19 @@ +FROM litongjava/maven:3.8.8-jdk8u391 AS builder +WORKDIR /app + +COPY pom.xml pom.xml +RUN mvn dependency:go-offline -q + +COPY src src +RUN mvn package -Passembly -q +RUN ls -l && ls -l target + +FROM litongjava/jre:8u391-stable-slim + +WORKDIR /app + +COPY --from=builder /app/target/tio-http-server-benchmark-1.0.jar /app/target/tio-http-server-benchmark-1.0.jar + +EXPOSE 8080 + +CMD ["java","-jar", "/app/target/tio-http-server-benchmark-1.0.jar"] \ No newline at end of file diff --git a/frameworks/PHP/flight/composer.json b/frameworks/PHP/flight/composer.json index 87ce7604b0a..0f94353da88 100644 --- a/frameworks/PHP/flight/composer.json +++ b/frameworks/PHP/flight/composer.json @@ -1,5 +1,5 @@ { "require": { - "mikecao/flight": "^2.0" + "mikecao/flight": "^3.0" } -} \ No newline at end of file +} diff --git a/frameworks/PHP/flight/index.php b/frameworks/PHP/flight/index.php index 48c77996905..8d954fa369e 100644 --- a/frameworks/PHP/flight/index.php +++ b/frameworks/PHP/flight/index.php @@ -13,9 +13,8 @@ // Plaintext test Flight::route('/plaintext', function() { Flight::response() - ->header('Content-Type', 'text/plain') - ->write('Hello, World!') - ->send(); + ->header('Content-Type', 'text/plain'); + echo 'Hello, World!'; }); // DB test diff --git a/frameworks/PHP/webman/app/controller/Index.php b/frameworks/PHP/webman/app/controller/Index.php index 1b27503762f..5d40b24b0ed 100644 --- a/frameworks/PHP/webman/app/controller/Index.php +++ b/frameworks/PHP/webman/app/controller/Index.php @@ -5,7 +5,10 @@ use support\bootstrap\Date; use support\bootstrap\db\Raw as Db; use support\Response; -use PDO; +use function json_encode; +use function max; +use function min; +use function mt_rand; class Index { @@ -29,7 +32,7 @@ public function json() public function db() { $statement = Db::$random; - $statement->execute([\mt_rand(1, 10000)]); + $statement->execute([mt_rand(1, 10000)]); return new Response(200, [ 'Content-Type' => 'application/json', @@ -63,14 +66,11 @@ public function queries(Request $request, $q = 1) { $statement = Db::$random; - $query_count = 1; - if ((int) $q > 1) { - $query_count = \min($q, 500); - } + $query_count = min(max((int) $q, 1), 500); $arr = []; while ($query_count--) { - $statement->execute([\mt_rand(1, 10000)]); + $statement->execute([mt_rand(1, 10000)]); $arr[] = $statement->fetch(); } @@ -82,29 +82,31 @@ public function queries(Request $request, $q = 1) public function updates(Request $request, $q = 1) { - $random = Db::$random; + static $updates = []; - $query_count = 1; - if ((int) $q > 1) { - $query_count = \min($q, 500); + $random = Db::$random; + $pdo = Db::$pdo; + $count = min(max((int) $q, 1), 500); + + $worlds = $keys = $values = []; + for ($i = 0; $i < $count; ++ $i) { + $values[] = $keys[] = $id = mt_rand(1, 10000); + $random->execute([$id]); + $row = $random->fetch(); + $values[] = $row['randomNumber'] = mt_rand(1, 10000); + $worlds[] = $row; } - - $worlds = []; - - while ($query_count--) { - $random->execute([\mt_rand(1, 10000)]); - $world = $random->fetch(); - $world['randomNumber'] = \mt_rand(1, 10000); - - $worlds[] = $world; + if (!isset($updates[$count])) { + $sql = 'UPDATE World SET randomNumber = CASE id' . str_repeat(' WHEN ?::INTEGER THEN ?::INTEGER ', $count) . 'END WHERE id IN (' . str_repeat('?::INTEGER,', $count - 1) . '?::INTEGER)'; + $updates[$count] = $pdo->prepare($sql); } - - Db::update($worlds); + $updates[$count]->execute([...$values, ...$keys]); return new Response(200, [ 'Content-Type' => 'application/json', 'Date' => Date::$date - ], \json_encode($worlds)); + ], json_encode($worlds)); + } diff --git a/frameworks/PHP/webman/support/bootstrap/db/Raw.php b/frameworks/PHP/webman/support/bootstrap/db/Raw.php index d27d846bb3c..5c4389c2347 100644 --- a/frameworks/PHP/webman/support/bootstrap/db/Raw.php +++ b/frameworks/PHP/webman/support/bootstrap/db/Raw.php @@ -31,11 +31,6 @@ class Raw implements Bootstrap public static PDOStatement $random; - /** - * @var PDOStatement[] - */ - public static array $update; - /** * @param Worker $worker * @@ -53,32 +48,4 @@ public static function start($worker) self::$pdo = $pdo; } - /** - * Postgres bulk update - * - * @param array $worlds - * @return void - */ - public static function update(array $worlds) - { - $rows = count($worlds); - - if (!isset(self::$update[$rows])) { - $sql = 'UPDATE world SET randomNumber = CASE id' - . str_repeat(' WHEN ?::INTEGER THEN ?::INTEGER ', $rows) - . 'END WHERE id IN (' - . str_repeat('?::INTEGER,', $rows - 1) . '?::INTEGER)'; - - self::$update[$rows] = self::$pdo->prepare($sql); - } - - $val = []; - $keys = []; - foreach ($worlds as $world) { - $val[] = $keys[] = $world['id']; - $val[] = $world['randomNumber']; - } - - self::$update[$rows]->execute([...$val, ...$keys]); - } } diff --git a/frameworks/PHP/workerman/Mysql.php b/frameworks/PHP/workerman/Mysql.php index c8dcd0ff40a..968ffcfef80 100644 --- a/frameworks/PHP/workerman/Mysql.php +++ b/frameworks/PHP/workerman/Mysql.php @@ -34,9 +34,10 @@ function query($request): array { $count = min(max((int) $request->get('q'), 1), 500); $arr = []; + $world = $this->world; while ($count--) { - $this->world->execute([mt_rand(1, 10000)]); - $arr[] = $this->world->fetch(); + $world->execute([mt_rand(1, 10000)]); + $arr[] = $world->fetch(); } return $arr; } @@ -45,11 +46,13 @@ function update($request): array { $count = min(max((int) $request->get('q'), 1), 500); $arr = []; + $world = $this->world; + $update = $this->update; while ($count--) { $id = mt_rand(1, 10000); - $this->world->execute([$id]); - $item = $this->world->fetch(); - $this->update->execute( + $world->execute([$id]); + $item = $world->fetch(); + $update->execute( [$item['randomNumber'] = mt_rand(1, 10000), $id] ); $arr[] = $item; diff --git a/frameworks/PHP/workerman/Pgsql.php b/frameworks/PHP/workerman/Pgsql.php index 4f4be58fe44..637497eb03e 100644 --- a/frameworks/PHP/workerman/Pgsql.php +++ b/frameworks/PHP/workerman/Pgsql.php @@ -31,10 +31,11 @@ function update($request): array $queries = $request->get('q'); $worlds = $keys = $values = []; $count = min(max((int) $queries, 1), 500); + $random = $this->random; for ($i = 0; $i < $count; ++ $i) { $values[] = $keys[] = $id = mt_rand(1, 10000); - $this->random->execute([$id]); - $row = $this->random->fetch(); + $random->execute([$id]); + $row = $random->fetch(); $values[] = $row['randomNumber'] = mt_rand(1, 10000); $worlds[] = $row; } diff --git a/frameworks/PHP/workerman/benchmark_config.json b/frameworks/PHP/workerman/benchmark_config.json index 8e79f1b124c..0d4b57bad54 100644 --- a/frameworks/PHP/workerman/benchmark_config.json +++ b/frameworks/PHP/workerman/benchmark_config.json @@ -1,6 +1,5 @@ { "framework": "workerman", - "maintainers": ["walkor"], "tests": [{ "default": { "dockerfile": "workerman-jit.dockerfile", diff --git a/frameworks/Ruby/rack-sequel/Gemfile.lock b/frameworks/Ruby/rack-sequel/Gemfile.lock index 72c1f6c0d47..77bdf0415e0 100644 --- a/frameworks/Ruby/rack-sequel/Gemfile.lock +++ b/frameworks/Ruby/rack-sequel/Gemfile.lock @@ -3,14 +3,10 @@ GEM specs: base64 (0.2.0) bigdecimal (3.1.8) - json (2.8.2) + json (2.9.1) kgio (2.11.4) mysql2 (0.5.6) nio4r (2.7.4) - oj (3.16.7) - bigdecimal (>= 3.0) - ostruct (>= 0.2) - ostruct (0.6.1) passenger (6.0.23) rack (>= 1.6.13) rackup @@ -42,9 +38,8 @@ DEPENDENCIES base64 jdbc-mysql (~> 5.1) jdbc-postgres (~> 9.4) - json (~> 2.0) + json (~> 2.8) mysql2 (~> 0.4) - oj (~> 3.14) passenger (~> 6.0) pg (~> 1.5) puma (~> 6.4) diff --git a/frameworks/Ruby/rack/Gemfile.lock b/frameworks/Ruby/rack/Gemfile.lock index b3ef3cbda2d..0c5027553b4 100644 --- a/frameworks/Ruby/rack/Gemfile.lock +++ b/frameworks/Ruby/rack/Gemfile.lock @@ -53,7 +53,7 @@ GEM io-endpoint (0.14.0) io-event (1.7.3) io-stream (0.6.1) - json (2.8.2) + json (2.9.1) kgio (2.11.4) language_server-protocol (3.17.0.3) localhost (1.3.1) diff --git a/frameworks/Ruby/rails/Gemfile.lock b/frameworks/Ruby/rails/Gemfile.lock index 010270b9617..8db47000927 100644 --- a/frameworks/Ruby/rails/Gemfile.lock +++ b/frameworks/Ruby/rails/Gemfile.lock @@ -139,7 +139,7 @@ GEM irb (1.14.1) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.8.1) + json (2.9.1) localhost (1.3.1) logger (1.6.2) loofah (2.23.1) diff --git a/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb b/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb index bdd96953ce8..9e9ce8b8327 100644 --- a/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb +++ b/frameworks/Ruby/rails/app/controllers/hello_world_controller.rb @@ -30,6 +30,7 @@ def fortune @fortunes = Fortune.all.to_a @fortunes << Fortune.new(id: 0, message: 'Additional fortune added at request time.') @fortunes.sort_by!(&:message) + render :fortune end def update diff --git a/frameworks/Ruby/roda-sequel/Gemfile.lock b/frameworks/Ruby/roda-sequel/Gemfile.lock index c701d602394..63f88b647fa 100644 --- a/frameworks/Ruby/roda-sequel/Gemfile.lock +++ b/frameworks/Ruby/roda-sequel/Gemfile.lock @@ -4,7 +4,7 @@ GEM base64 (0.2.0) bigdecimal (3.1.8) erubi (1.13.0) - json (2.8.1) + json (2.9.1) kgio (2.11.4) mysql2 (0.5.6) nio4r (2.7.4) diff --git a/frameworks/Ruby/sinatra/Gemfile b/frameworks/Ruby/sinatra/Gemfile index 88720bf547b..c80246d6a35 100644 --- a/frameworks/Ruby/sinatra/Gemfile +++ b/frameworks/Ruby/sinatra/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'activerecord', '~> 7.2', require: 'active_record' +gem 'activerecord', '~> 8.0', require: 'active_record' gem 'json', '~> 2.8' gem 'sinatra', '~> 4.0', require: 'sinatra/base' diff --git a/frameworks/Ruby/sinatra/Gemfile.lock b/frameworks/Ruby/sinatra/Gemfile.lock index ddfcc1fb8be..76b66f8fedd 100644 --- a/frameworks/Ruby/sinatra/Gemfile.lock +++ b/frameworks/Ruby/sinatra/Gemfile.lock @@ -1,14 +1,15 @@ GEM remote: https://rubygems.org/ specs: - activemodel (7.2.1.1) - activesupport (= 7.2.1.1) - activerecord (7.2.1.1) - activemodel (= 7.2.1.1) - activesupport (= 7.2.1.1) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) - activesupport (7.2.1.1) + activesupport (8.0.1) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) @@ -18,63 +19,66 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) 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) drb (2.2.1) i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.8.1) + json (2.9.1) kgio (2.11.4) - logger (1.6.1) - minitest (5.25.1) + logger (1.6.4) + minitest (5.25.4) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) mysql2 (0.5.6) nio4r (2.7.4) - passenger (6.0.23) + passenger (6.0.24) rack (>= 1.6.13) - rackup + rackup (>= 2.0.0) rake (>= 12.3.3) - pg (1.5.8) + pg (1.5.9) puma (6.5.0) nio4r (~> 2.0) rack (3.1.8) - rack-protection (4.0.0) + rack-protection (4.1.1) base64 (>= 0.1.0) + logger (>= 1.6.0) rack (>= 3.0.0, < 4) rack-session (2.0.0) rack (>= 3.0.0) - rackup (2.1.0) + rackup (2.2.1) rack (>= 3) - webrick (~> 1.8) raindrops (0.20.1) rake (13.2.1) ruby2_keywords (0.0.5) - securerandom (0.3.1) - sinatra (4.0.0) + securerandom (0.4.1) + 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) - timeout (0.4.1) + tilt (2.5.0) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) - webrick (1.8.2) + uri (1.0.2) PLATFORMS ruby x86_64-darwin-23 DEPENDENCIES - activerecord (~> 7.2) + activerecord (~> 8.0) agoo json (~> 2.8) mysql2 (~> 0.5) diff --git a/frameworks/Rust/axum/Cargo.lock b/frameworks/Rust/axum/Cargo.lock index 8f756182439..7871df00e8c 100644 --- a/frameworks/Rust/axum/Cargo.lock +++ b/frameworks/Rust/axum/Cargo.lock @@ -1,22 +1,16 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -47,9 +41,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -76,26 +70,15 @@ dependencies = [ "yansi-term", ] -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] @@ -115,15 +98,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.6" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f43644eed690f5374f1af436ecd6aea01cd201f6fbdf0178adaf6907afb2cec" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", @@ -145,18 +128,18 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", - "tower 0.5.1", + "tower", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b8ba012a258d63c9adfa28b9ddcf66149da6f986c5b5452e629d5ee64bf00" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -167,7 +150,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper", "tower-layer", "tower-service", ] @@ -186,39 +169,40 @@ dependencies = [ "futures-util", "hyper", "hyper-util", + "mimalloc", "mime", - "moka", "mongodb", "num_cpus", + "quick_cache", "rand", "serde", "serde_json", "serde_path_to_error", "simd-json", - "socket2 0.5.7", + "socket2", "sqlx", "tokio", "tokio-pg-mapper", "tokio-pg-mapper-derive", "tokio-postgres", - "tower 0.5.1", + "tower", "tower-http", "yarte", ] [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -283,15 +267,15 @@ dependencies = [ [[package]] name = "bson" -version = "2.11.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a88e82b9106923b5c4d6edfca9e7db958d4e98a478ec115022e81b9b38e2c8" +checksum = "068208f2b6fcfa27a7f1ee37488d2bb8ba2640f68f5475d08e1d9130696aba59" dependencies = [ "ahash", "base64 0.13.1", "bitvec", "hex", - "indexmap", + "indexmap 2.7.0", "js-sys", "once_cell", "rand", @@ -316,15 +300,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.1.13" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "jobserver", "libc", @@ -339,13 +323,14 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", + "serde", "windows-targets 0.52.6", ] @@ -378,9 +363,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -409,38 +394,20 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -454,9 +421,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", @@ -464,27 +431,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", - "syn 1.0.109", + "syn 2.0.91", ] [[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.91", ] [[package]] @@ -507,9 +474,9 @@ dependencies = [ [[package]] name = "deadpool-postgres" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab8a4ea925ce79678034870834602a2980f4b88c09e97feb266496dbb4493d2" +checksum = "3d697d376cbfa018c23eb4caab1fd1883dd9c906a8c034e8d9a3cb06a7e0bef9" dependencies = [ "async-trait", "deadpool", @@ -547,17 +514,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", + "serde", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "derive-where" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] @@ -569,8 +537,8 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.75", + "rustc_version", + "syn 2.0.91", ] [[package]] @@ -585,6 +553,17 @@ 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.91", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -614,14 +593,14 @@ 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.91", ] [[package]] @@ -632,12 +611,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -651,12 +630,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.3.1" @@ -668,16 +641,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -686,34 +649,34 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[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", ] [[package]] name = "flume" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", @@ -743,9 +706,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -758,9 +721,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -768,15 +731,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -796,38 +759,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -866,15 +829,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -882,7 +845,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -895,10 +858,16 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", "serde", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.5" @@ -909,23 +878,26 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "hashbrown", + "hashbrown 0.14.5", ] [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -939,6 +911,51 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hickory-proto" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -959,11 +976,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -979,9 +996,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1013,9 +1030,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1025,9 +1042,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -1045,9 +1062,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-util", @@ -1056,15 +1073,14 @@ dependencies = [ "hyper", "pin-project-lite", "tokio", - "tower 0.4.13", "tower-service", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1084,174 +1100,251 @@ 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" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "idna" -version = "0.2.3" +name = "icu_locid" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_locid_transform" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "indexmap" -version = "2.4.0" +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 = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" dependencies = [ - "equivalent", - "hashbrown", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", ] [[package]] -name = "ipconfig" -version = "0.3.2" +name = "icu_normalizer_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" dependencies = [ - "socket2 0.5.7", - "widestring", - "windows-sys 0.48.0", - "winreg", + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", ] [[package]] -name = "ipnet" -version = "2.9.0" +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" [[package]] -name = "itoa" -version = "1.0.11" +name = "icu_provider" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] [[package]] -name = "jobserver" -version = "0.1.32" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "libc", + "proc-macro2", + "quote", + "syn 2.0.91", ] [[package]] -name = "js-sys" -version = "0.3.70" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "wasm-bindgen", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "spin", + "icu_normalizer", + "icu_properties", ] [[package]] -name = "lexical-core" -version = "0.8.5" +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.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" 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", + "widestring", + "windows-sys 0.48.0", + "winreg", ] [[package]] -name = "lexical-util" -version = "0.8.5" +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ - "static_assertions", + "libc", ] [[package]] -name = "lexical-write-float" -version = "0.8.5" +name = "js-sys" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", + "once_cell", + "wasm-bindgen", ] [[package]] -name = "lexical-write-integer" -version = "0.8.5" +name = "lazy_static" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "lexical-util", - "static_assertions", + "spin", ] [[package]] name = "libc" -version = "0.2.158" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libmimalloc-sys" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" +dependencies = [ + "cc", + "libc", +] [[package]] name = "libsqlite3-sys" -version = "0.27.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", @@ -1270,6 +1363,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -1301,12 +1400,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.3" @@ -1329,6 +1422,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "mimalloc" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.17" @@ -1343,70 +1445,36 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", ] -[[package]] -name = "moka" -version = "0.12.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" -dependencies = [ - "async-lock", - "async-trait", - "crossbeam-channel", - "crossbeam-epoch", - "crossbeam-utils", - "event-listener 5.3.1", - "futures-util", - "once_cell", - "parking_lot", - "quanta", - "rustc_version 0.4.0", - "smallvec", - "tagptr", - "thiserror", - "triomphe", - "uuid", -] - [[package]] name = "mongodb" -version = "2.8.2" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef206acb1b72389b49bc9985efe7eb1f8a9bb18e5680d262fac26c07f44025f1" +checksum = "ff1f6edf7fe8828429647a2200f684681ca6d5a33b45edc3140c81390d852301" dependencies = [ "async-trait", "base64 0.13.1", "bitflags 1.3.2", "bson", "chrono", - "derivative", + "derive-where", "derive_more", "flate2", "futures-core", @@ -1414,22 +1482,25 @@ dependencies = [ "futures-io", "futures-util", "hex", + "hickory-proto", + "hickory-resolver", "hmac", - "lazy_static", "md-5", + "mongodb-internal-macros", + "once_cell", "pbkdf2", "percent-encoding", "rand", "rustc_version_runtime", - "rustls", - "rustls-pemfile", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", "serde", "serde_bytes", "serde_with", "sha-1", "sha2", "snap", - "socket2 0.4.10", + "socket2", "stringprep", "strsim", "take_mut", @@ -1437,14 +1508,23 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-util", - "trust-dns-proto", - "trust-dns-resolver", "typed-builder", "uuid", - "webpki-roots", + "webpki-roots 0.25.4", "zstd", ] +[[package]] +name = "mongodb-internal-macros" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b07bfd601af78e39384707a8e80041946c98260e3e0190e294ee7435823e6bf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] + [[package]] name = "nom" version = "7.1.3" @@ -1520,24 +1600,24 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -1557,7 +1637,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -1610,31 +1690,11 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.75", -] - [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1665,9 +1725,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "postgres-protocol" @@ -1689,9 +1749,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02048d9e032fb3cc3413bbf7b83a15d84a5d419778e2628751896d856498eee9" +checksum = "f66ea23a2d0e5734297357705193335e0a957696f34bed2f2faefacb2fec336f" dependencies = [ "bytes", "fallible-iterator", @@ -1725,39 +1785,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] -[[package]] -name = "quanta" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi", - "web-sys", - "winapi", -] - [[package]] name = "quick-error" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick_cache" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d7c94f8935a9df96bb6380e8592c70edf497a643f94bd23b2f76b399385dbf4" +dependencies = [ + "ahash", + "equivalent", + "hashbrown 0.14.5", + "parking_lot", +] + [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1785,42 +1842,24 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "raw-cpuid" -version = "11.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" -dependencies = [ - "bitflags 2.6.0", + "ppv-lite86", + "rand_core", ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "bitflags 1.3.2", + "getrandom", ] [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -1842,14 +1881,14 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1859,9 +1898,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1870,9 +1909,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "resolv-conf" @@ -1901,9 +1940,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" dependencies = [ "const-oid", "digest", @@ -1927,43 +1966,34 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "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 = "rustix" -version = "0.38.34" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1974,10 +2004,24 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.23.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -1987,6 +2031,21 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -1997,11 +2056,22 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -2027,30 +2097,15 @@ dependencies = [ [[package]] name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "semver-parser" -version = "0.7.0" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -2066,22 +2121,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ - "indexmap", + "indexmap 2.7.0", "itoa", "memchr", "ryu", @@ -2112,24 +2167,32 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.14.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.7.0", "serde", + "serde_derive", + "serde_json", "serde_with_macros", + "time", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] @@ -2192,13 +2255,12 @@ dependencies = [ [[package]] name = "simd-json" -version = "0.13.10" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570c430b3d902ea083097e853263ae782dfe40857d93db019a12356c8e8143fa" +checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" dependencies = [ "getrandom", "halfbrown", - "lexical-core", "ref-cast", "serde", "serde_json", @@ -2208,9 +2270,9 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "siphasher" @@ -2232,6 +2294,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "snap" @@ -2241,19 +2306,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.4.10" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2280,9 +2335,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ "nom", "unicode_categories", @@ -2290,9 +2345,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -2303,33 +2358,33 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ - "ahash", "atoi", "byteorder", "bytes", "crc", "crossbeam-queue", "either", - "event-listener 2.5.3", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", - "indexmap", + "indexmap 2.7.0", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls", - "rustls-pemfile", + "rustls 0.23.20", + "rustls-pemfile 2.2.0", "serde", "serde_json", "sha2", @@ -2340,27 +2395,27 @@ dependencies = [ "tokio-stream", "tracing", "url", - "webpki-roots", + "webpki-roots 0.26.7", ] [[package]] name = "sqlx-macros" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] name = "sqlx-macros-core" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", @@ -2376,7 +2431,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 1.0.109", + "syn 2.0.91", "tempfile", "tokio", "url", @@ -2384,12 +2439,12 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "bytes", @@ -2426,12 +2481,12 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "crc", @@ -2464,9 +2519,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", "flume", @@ -2479,17 +2534,17 @@ dependencies = [ "log", "percent-encoding", "serde", + "serde_urlencoded", "sqlx-core", "tracing", "url", - "urlencoding", ] [[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" @@ -2504,9 +2559,9 @@ dependencies = [ [[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" @@ -2527,9 +2582,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -2538,21 +2593,20 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] -name = "tagptr" -version = "0.2.0" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", +] [[package]] name = "take_mut" @@ -2568,9 +2622,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -2581,29 +2635,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -2622,19 +2676,29 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] +[[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.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -2647,9 +2711,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -2658,7 +2722,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -2671,7 +2735,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] @@ -2696,9 +2760,9 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03adcf0147e203b6032c0b2d30be1415ba03bc348901f3ff1cc0df6a733e60c3" +checksum = "3b5d3742945bc7d7f210693b0c58ae542c6fd47b17adbbda0885f3dcb34a6bdb" dependencies = [ "async-trait", "byteorder", @@ -2714,7 +2778,7 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand", - "socket2 0.5.7", + "socket2", "tokio", "tokio-util", "whoami", @@ -2726,15 +2790,15 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -2743,9 +2807,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -2766,29 +2830,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -2796,15 +2845,13 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "bitflags 2.6.0", "bytes", "http", - "http-body", - "http-body-util", "pin-project-lite", "tower-layer", "tower-service", @@ -2824,9 +2871,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -2836,75 +2883,24 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] -[[package]] -name = "triomphe" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" - -[[package]] -name = "trust-dns-proto" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" -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", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto", -] - [[package]] name = "typed-builder" version = "0.10.0" @@ -2924,48 +2920,42 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unicode_categories" @@ -2981,26 +2971,32 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", ] [[package]] -name = "urlencoding" -version = "2.1.3" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +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 = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "serde", @@ -3024,9 +3020,9 @@ checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" [[package]] name = "value-trait" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad8db98c1e677797df21ba03fca7d3bf9bec3ca38db930954e4fe6e1ea27eb4" +checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" dependencies = [ "float-cmp", "halfbrown", @@ -3060,9 +3056,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -3071,24 +3067,23 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3096,28 +3091,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -3129,13 +3124,22 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +[[package]] +name = "webpki-roots" +version = "0.26.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", "web-sys", ] @@ -3335,6 +3339,18 @@ dependencies = [ "windows-sys 0.48.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" @@ -3438,6 +3454,30 @@ 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.91", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -3456,7 +3496,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.91", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.91", + "synstructure", ] [[package]] @@ -3465,6 +3526,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[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.91", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/frameworks/Rust/axum/Cargo.toml b/frameworks/Rust/axum/Cargo.toml index a47514726c7..335a3b7f451 100644 --- a/frameworks/Rust/axum/Cargo.toml +++ b/frameworks/Rust/axum/Cargo.toml @@ -39,48 +39,49 @@ simd-json = [ ] [dependencies] -axum = { version = "0.7.6", default-features = false, features = [ +axum = { version = "0.7.9", default-features = false, features = [ "json", "query", "http1", "tokio", ] } deadpool = { version = "0.12.1", features = ["rt_tokio_1", "serde", "managed"] } -deadpool-postgres = { version = "0.14.0", features = ["rt_tokio_1", "serde"] } +deadpool-postgres = { version = "0.14.1", features = ["rt_tokio_1", "serde"] } dotenv = "0.15.0" -futures = "0.3.30" -futures-util = "0.3.30" -mongodb = { version = "2.8.0", features = [ +futures = "0.3.31" +futures-util = "0.3.31" +mongodb = { version = "3.1.1", features = [ "zstd-compression", "snappy-compression", "zlib-compression", ] } num_cpus = "1.16.0" rand = { version = "0.8.5", features = ["small_rng"] } -serde = { version = "1.0.196", features = ["derive"] } -serde_json = "1.0.127" -sqlx = { version = "0.7.3", features = [ +serde = { version = "1.0.216", features = ["derive"] } +serde_json = "1.0.134" +sqlx = { version = "0.8.2", features = [ "postgres", "macros", "runtime-tokio", "tls-rustls", ] } -tokio = { version = "1.39.3", features = ["full"] } +tokio = { version = "1.42.0", features = ["full"] } tokio-pg-mapper = { version = "0.2.0" } tokio-pg-mapper-derive = { version = "0.2.0" } -tokio-postgres = { version = "0.7.11" } -tower = { version = "0.5.0", features = ["util"] } -tower-http = { version = "0.5.2", features = ["set-header"] } +tokio-postgres = { version = "0.7.12" } +tower = { version = "0.5.2", features = ["util"] } +tower-http = { version = "0.6.2", features = ["set-header"] } yarte = "0.15.7" -simd-json = { version = "0.13.8", optional = true } -axum-core = { version = "0.4.3", optional = true } +simd-json = { version = "0.14.3", optional = true } +axum-core = { version = "0.4.5", optional = true } mime = { version = "0.3.17", optional = true } -bytes = { version = "1.5.0", optional = true } -serde_path_to_error = { version = "0.1.15", optional = true } -moka = { version = "0.12.8", features = ["future"] } -socket2 = "0.5.7" -hyper = { version = "1.4", features = ["server", "http1"] } +bytes = { version = "1.9.0", optional = true } +serde_path_to_error = { version = "0.1.16", optional = true } +socket2 = "0.5.8" +hyper = { version = "1.5", features = ["server", "http1"] } hyper-util = { version = "0.1", features = ["tokio", "server-auto", "http1"] } +quick_cache = "0.6.9" +mimalloc = "0.1.43" [profile.release] diff --git a/frameworks/Rust/axum/README.md b/frameworks/Rust/axum/README.md index 59979fe441d..eb1e4ff594c 100755 --- a/frameworks/Rust/axum/README.md +++ b/frameworks/Rust/axum/README.md @@ -27,10 +27,11 @@ built with Tokio, Tower, and Hyper. ## Notable Points (both performance and build) - Use of `async`. -- Use of most recent versions of Rust, `axum` and dependencies. +- Use of the most recent versions of Rust, `axum` and dependencies. - (Disabled by default) Compile-time swap-in of `simd-json` instead of `serde_json` for faster JSON serialization. - Release binaries are stripped and compiled with CPU native. -- Sockets configured with TCP_NODELAY and to support an increased number of pending connections. +- Sockets configured with `TCP_NODELAY` and to support an increased number of pending connections. +- For very simple benchmarks, use of a separate, single-threaded Tokio runtime for each thread. - Server configured to serve HTTP/1 only, with no need for websockets. - Separation of build and deployment containers using multi-stage builds. - Deployment into Google's minimal `distroless-cc` container. @@ -39,8 +40,5 @@ built with Tokio, Tower, and Hyper. - Use of PostgreSQL prepared statements cache (where supported). - Use of PostgreSQL arrays to execute multi-row database updates with a single `UPDATE` query. - This is permitted by the [test requirements](https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#database-updates), step (ix). -- In version 0.7.6 (as yet unreleased), a native API to set TCP_NODELAY will be included. - - https://github.com/tokio-rs/axum/pull/2653/ - - https://github.com/tokio-rs/axum/issues/2521 - More performance improvements are to be expected in version 0.8: - https://github.com/tokio-rs/axum/issues/1827 diff --git a/frameworks/Rust/axum/axum.dockerfile b/frameworks/Rust/axum/axum.dockerfile index 044e68bbf02..1bfb8fdf9c1 100644 --- a/frameworks/Rust/axum/axum.dockerfile +++ b/frameworks/Rust/axum/axum.dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/rust:1.80-slim-bookworm AS builder +FROM docker.io/rust:1.83-slim-bookworm AS builder RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config libssl-dev \ @@ -18,7 +18,7 @@ ENV POSTGRES_MIN_POOL_SIZE=56 ENV POSTGRES_MAX_POOL_SIZE=56 ENV MONGODB_URL=mongodb://tfb-database:27017 ENV MONGODB_MIN_POOL_SIZE=28 -ENV MONGODB_MAX_POOL_SIZE=14 +ENV MONGODB_MAX_POOL_SIZE=28 COPY --from=builder /build/target/release/axum* /app/ EXPOSE 8000 CMD ["/app/axum"] diff --git a/frameworks/Rust/axum/src/common/mod.rs b/frameworks/Rust/axum/src/common/mod.rs index 808b2a70eeb..cae34d182cf 100644 --- a/frameworks/Rust/axum/src/common/mod.rs +++ b/frameworks/Rust/axum/src/common/mod.rs @@ -17,10 +17,9 @@ pub const SELECT_WORLD_BY_ID: &str = pub const SELECT_ALL_CACHED_WORLDS: &str = "SELECT id, randomnumber FROM world ORDER BY id"; #[allow(dead_code)] -pub const UPDATE_WORLDS: &str = "WITH vals AS (SELECT * FROM UNNEST($1::int[], $2::int[]) AS v(id, rnum)) - UPDATE world SET randomnumber = new.rnum FROM - (SELECT w.id, v.rnum FROM world w INNER JOIN vals v ON v.id = w.id ORDER BY w.id FOR UPDATE) AS new - WHERE world.id = new.id"; +pub const UPDATE_WORLDS: &str = r#"UPDATE world SET randomnumber = new.rnum FROM + (SELECT * FROM UNNEST($1::int[], $2::int[]) AS v(id, rnum) ORDER BY 1) AS new +WHERE world.id = new.id"#; /// Return the value of an environment variable. #[allow(dead_code)] @@ -41,11 +40,10 @@ pub fn random_id(rng: &mut SmallRng) -> i32 { rng.gen_range(1..10_001) } -/// Generate vector of integers in the range 1 to 10,000 (inclusive) +/// Generate an iterator of integers in the range 1 to 10,000 (inclusive) #[allow(dead_code)] #[inline(always)] -pub fn random_ids(rng: &mut SmallRng, count: usize) -> Vec { +pub fn random_ids(rng: &mut SmallRng, count: usize) -> impl Iterator + use<'_> { rng.sample_iter(Uniform::new(1, 10_001)) .take(count) - .collect() -} +} \ No newline at end of file diff --git a/frameworks/Rust/axum/src/main.rs b/frameworks/Rust/axum/src/main.rs index 0b33fb7edcb..ccbb4588eb9 100644 --- a/frameworks/Rust/axum/src/main.rs +++ b/frameworks/Rust/axum/src/main.rs @@ -4,6 +4,10 @@ mod server; use axum::{http::StatusCode, response::IntoResponse, routing::get, Router}; use common::models::Message; use dotenv::dotenv; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; #[cfg(not(feature = "simd-json"))] use axum::Json; diff --git a/frameworks/Rust/axum/src/main_mongo.rs b/frameworks/Rust/axum/src/main_mongo.rs index 6d301189b9a..f15e0f521fb 100644 --- a/frameworks/Rust/axum/src/main_mongo.rs +++ b/frameworks/Rust/axum/src/main_mongo.rs @@ -14,8 +14,7 @@ use axum::Json; #[cfg(feature = "simd-json")] use common::simd_json::Json; use common::{ - models::{FortuneInfo, World}, - random_ids, + models::{FortuneInfo, World}, random_id }; use dotenv::dotenv; use mongodb::{ @@ -24,6 +23,10 @@ use mongodb::{ }; use rand::{rngs::SmallRng, thread_rng, Rng, SeedableRng}; use yarte::Template; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; use common::{ get_env, @@ -58,9 +61,7 @@ async fn queries( let q = parse_params(params); let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); - let ids = random_ids(&mut rng, q); - - let worlds = find_worlds(db, ids).await; + let worlds = find_worlds(db, &mut rng, q).await; let results = worlds.expect("worlds could not be retrieved"); (StatusCode::OK, Json(results)) @@ -73,17 +74,14 @@ async fn updates( let q = parse_params(params); let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); - let ids = random_ids(&mut rng, q); - let worlds = find_worlds(db.clone(), ids) + let worlds = find_worlds(db.clone(), &mut rng, q) .await .expect("worlds could not be retrieved"); let mut updated_worlds: Vec = Vec::with_capacity(q); for mut world in worlds { - let random_number = (rng.gen::() % 10_000 + 1) as i32; - - world.random_number = random_number; + world.random_number = random_id(&mut rng); updated_worlds.push(world); } diff --git a/frameworks/Rust/axum/src/main_mongo_raw.rs b/frameworks/Rust/axum/src/main_mongo_raw.rs index 0d2735ad3bb..b36dd2d8030 100644 --- a/frameworks/Rust/axum/src/main_mongo_raw.rs +++ b/frameworks/Rust/axum/src/main_mongo_raw.rs @@ -2,7 +2,7 @@ mod common; mod mongo_raw; mod server; -use common::{models::World, random_id, random_ids}; +use common::{models::World, random_id}; use mongo_raw::database::{ find_world_by_id, find_worlds, update_worlds, DatabaseConnection, }; @@ -17,6 +17,11 @@ use axum::{ extract::Query, http::StatusCode, response::IntoResponse, routing::get, Router, }; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; + #[cfg(not(feature = "simd-json"))] use axum::Json; #[cfg(feature = "simd-json")] @@ -27,7 +32,7 @@ use mongodb::{ options::{ClientOptions, Compressor}, Client, }; -use rand::{rngs::SmallRng, thread_rng, Rng, SeedableRng}; +use rand::{rngs::SmallRng, thread_rng, SeedableRng}; async fn db(DatabaseConnection(db): DatabaseConnection) -> impl IntoResponse { let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); @@ -48,9 +53,7 @@ async fn queries( let q = parse_params(params); let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); - let ids = random_ids(&mut rng, q); - - let worlds = find_worlds(db, ids).await; + let worlds = find_worlds(db, &mut rng, q).await; let results = worlds.expect("worlds could not be retrieved"); (StatusCode::OK, Json(results)) @@ -64,16 +67,13 @@ async fn updates( let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); - let ids = random_ids(&mut rng, q); - let worlds = find_worlds(db.clone(), ids) + let worlds = find_worlds(db.clone(), &mut rng, q) .await .expect("worlds could not be retrieved"); let mut updated_worlds: Vec = Vec::with_capacity(q); for mut world in worlds { - let random_number = (rng.gen::() % 10_000 + 1) as i32; - - world.random_number = random_number; + world.random_number = random_id(&mut rng); updated_worlds.push(world); } diff --git a/frameworks/Rust/axum/src/main_pg.rs b/frameworks/Rust/axum/src/main_pg.rs index be691f9720c..94788bbd254 100644 --- a/frameworks/Rust/axum/src/main_pg.rs +++ b/frameworks/Rust/axum/src/main_pg.rs @@ -7,6 +7,10 @@ use axum::{ use dotenv::dotenv; use rand::{rngs::SmallRng, thread_rng, SeedableRng}; use yarte::Template; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; #[cfg(not(feature = "simd-json"))] use axum::Json; diff --git a/frameworks/Rust/axum/src/main_pg_pool.rs b/frameworks/Rust/axum/src/main_pg_pool.rs index d4b7754cba8..a6d5764748e 100644 --- a/frameworks/Rust/axum/src/main_pg_pool.rs +++ b/frameworks/Rust/axum/src/main_pg_pool.rs @@ -15,6 +15,10 @@ use dotenv::dotenv; use futures_util::{stream::FuturesUnordered, TryStreamExt}; use rand::{rngs::SmallRng, thread_rng, SeedableRng}; use yarte::Template; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; mod server; diff --git a/frameworks/Rust/axum/src/main_sqlx.rs b/frameworks/Rust/axum/src/main_sqlx.rs index b3a7937841b..7c8f90d6807 100644 --- a/frameworks/Rust/axum/src/main_sqlx.rs +++ b/frameworks/Rust/axum/src/main_sqlx.rs @@ -12,10 +12,14 @@ use axum::{ Router, }; use dotenv::dotenv; -use moka::future::Cache; +use quick_cache::sync::Cache; use rand::{rngs::SmallRng, thread_rng, SeedableRng}; use sqlx::models::World; use yarte::Template; +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; #[cfg(not(feature = "simd-json"))] use axum::Json; @@ -55,10 +59,9 @@ async fn queries( ) -> impl IntoResponse { let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); let count = parse_params(params); - let ids = random_ids(&mut rng, count); let mut worlds: Vec = Vec::with_capacity(count); - for id in &ids { + for id in random_ids(&mut rng, count) { let world: World = ::sqlx::query_as(common::SELECT_WORLD_BY_ID) .bind(id) .fetch_one(&mut *db.acquire().await.unwrap()) @@ -98,10 +101,10 @@ async fn cache( ) -> impl IntoResponse { let count = parse_params(params); let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); - let mut worlds: Vec>> = Vec::with_capacity(count); - + let mut worlds: Vec> = Vec::with_capacity(count); + for id in random_ids(&mut rng, count) { - worlds.push(cache.get(&id).await); + worlds.push(cache.get(&id)); } (StatusCode::OK, Json(worlds)) @@ -115,7 +118,7 @@ async fn preload_cache(AppState { db, cache }: &AppState) { .expect("error loading worlds"); for world in worlds { - cache.insert(world.id, Arc::new(world)).await; + cache.insert(world.id, world); } } @@ -123,7 +126,7 @@ async fn preload_cache(AppState { db, cache }: &AppState) { #[derive(Clone)] struct AppState { db: PgPool, - cache: Cache>, + cache: Arc>, } #[tokio::main] @@ -136,10 +139,7 @@ async fn main() { let state = AppState { db: create_pool(database_url, max_pool_size, min_pool_size).await, - cache: Cache::builder() - .initial_capacity(10000) - .max_capacity(10000) - .build() + cache: Arc::new(Cache::new(10_000)) }; // Prime the cache with CachedWorld objects diff --git a/frameworks/Rust/axum/src/mongo/database.rs b/frameworks/Rust/axum/src/mongo/database.rs index 28c55d25c01..be581e4505c 100644 --- a/frameworks/Rust/axum/src/mongo/database.rs +++ b/frameworks/Rust/axum/src/mongo/database.rs @@ -3,8 +3,9 @@ use std::{convert::Infallible, io}; use axum::{async_trait, extract::FromRequestParts, http::request::Parts}; use futures_util::{stream::FuturesUnordered, StreamExt, TryStreamExt}; use mongodb::{bson::doc, Database}; +use rand::rngs::SmallRng; -use crate::common::models::{Fortune, World}; +use crate::common::{models::{Fortune, World}, random_ids}; pub struct DatabaseConnection(pub Database); @@ -45,17 +46,17 @@ pub async fn find_world_by_id(db: Database, id: i32) -> Result) -> Result, MongoError> { +pub async fn find_worlds(db: Database, rng: &mut SmallRng, count: usize) -> Result, MongoError> { let future_worlds = FuturesUnordered::new(); - for id in ids { + for id in random_ids(rng, count) { future_worlds.push(find_world_by_id(db.clone(), id)); } @@ -67,7 +68,7 @@ pub async fn fetch_fortunes(db: Database) -> Result, MongoError> { let fortune_collection = db.collection::("fortune"); let mut fortune_cursor = fortune_collection - .find(None, None) + .find(doc! {}) .await .expect("fortunes could not be loaded"); @@ -99,8 +100,7 @@ pub async fn update_worlds( } db.run_command( - doc! {"update": "world", "updates": updates, "ordered": false}, - None, + doc! {"update": "world", "updates": updates, "ordered": false} ) .await .expect("could not update worlds"); diff --git a/frameworks/Rust/axum/src/mongo_raw/database.rs b/frameworks/Rust/axum/src/mongo_raw/database.rs index 638c590c9fa..22b113ce68c 100644 --- a/frameworks/Rust/axum/src/mongo_raw/database.rs +++ b/frameworks/Rust/axum/src/mongo_raw/database.rs @@ -6,8 +6,9 @@ use mongodb::{ bson::{doc, RawDocumentBuf}, Database, }; +use rand::rngs::SmallRng; -use crate::common::models::World; +use crate::common::{models::World, random_ids}; pub struct DatabaseConnection(pub Database); @@ -48,7 +49,7 @@ pub async fn find_world_by_id(db: Database, id: i32) -> Result Result) -> Result, MongoError> { +pub async fn find_worlds(db: Database, rng: &mut SmallRng, count: usize) -> Result, MongoError> { let future_worlds = FuturesUnordered::new(); - for id in ids { + for id in random_ids(rng, count) { future_worlds.push(find_world_by_id(db.clone(), id)); } @@ -93,8 +94,7 @@ pub async fn update_worlds( } db.run_command( - doc! {"update": "world", "updates": updates, "ordered": false}, - None, + doc! {"update": "world", "updates": updates, "ordered": false} ) .await .expect("could not update worlds"); diff --git a/frameworks/Rust/viz/Cargo.toml b/frameworks/Rust/viz/Cargo.toml index b2e90cb4836..a1daab27b7f 100644 --- a/frameworks/Rust/viz/Cargo.toml +++ b/frameworks/Rust/viz/Cargo.toml @@ -24,13 +24,16 @@ path = "src/main_diesel.rs" required-features = ["diesel", "diesel-async", "sailfish"] [dependencies] -viz = "0.9" -hyper = "1.4" +viz = "0.10" +hyper = "1.5" hyper-util = "0.1" +http-body-util = "0.1" atoi = "2.0" serde = { version = "1.0", features = ["derive"] } +serde_json = "1" +mime = "0.3" rand = { version = "0.8", features = ["small_rng"] } -thiserror = "1.0" +thiserror = "2.0" futures-util = "0.3" [target.'cfg(not(unix))'.dependencies] @@ -50,7 +53,7 @@ sqlx = { version = "0.8", features = [ diesel = { version = "2.2", default-features = false, features = [ "i-implement-a-third-party-backend-and-opt-into-breaking-changes", ], optional = true } -diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "74867bd", version = "0.4", default-features = false, features = [ +diesel-async = { version = "0.5", default-features = false, features = [ "postgres", "bb8", ], optional = true } diff --git a/frameworks/Rust/viz/src/main.rs b/frameworks/Rust/viz/src/main.rs index 1813ac62a22..0bde892034a 100644 --- a/frameworks/Rust/viz/src/main.rs +++ b/frameworks/Rust/viz/src/main.rs @@ -3,7 +3,7 @@ use serde::Serialize; use viz::{ header::{HeaderValue, SERVER}, - Error, Request, Response, ResponseExt, Result, Router, + Bytes, Error, Request, Response, ResponseExt, Result, Router, }; mod server; @@ -22,9 +22,15 @@ async fn plaintext(_: Request) -> Result { } async fn json(_: Request) -> Result { - let mut res = Response::json(Message { - message: "Hello, World!", - })?; + let mut res = Response::with( + http_body_util::Full::new(Bytes::from( + serde_json::to_vec(&Message { + message: "Hello, World!", + }) + .unwrap(), + )), + mime::APPLICATION_JSON.as_ref(), + ); res.headers_mut() .insert(SERVER, HeaderValue::from_static("Viz")); Ok(res) diff --git a/frameworks/Rust/viz/viz-diesel.dockerfile b/frameworks/Rust/viz/viz-diesel.dockerfile index d37e0af9130..62eec4e7ebd 100644 --- a/frameworks/Rust/viz/viz-diesel.dockerfile +++ b/frameworks/Rust/viz/viz-diesel.dockerfile @@ -1,6 +1,4 @@ -FROM rust:1.79 - -RUN apt-get update -yqq && apt-get install -yqq cmake g++ +FROM rust:1.83 ADD ./ /viz WORKDIR /viz diff --git a/frameworks/Rust/viz/viz-pg.dockerfile b/frameworks/Rust/viz/viz-pg.dockerfile index 326f10a3bc6..e45d0db4402 100644 --- a/frameworks/Rust/viz/viz-pg.dockerfile +++ b/frameworks/Rust/viz/viz-pg.dockerfile @@ -1,6 +1,4 @@ -FROM rust:1.79 - -RUN apt-get update -yqq && apt-get install -yqq cmake g++ +FROM rust:1.83 ADD ./ /viz WORKDIR /viz diff --git a/frameworks/Rust/viz/viz-sqlx.dockerfile b/frameworks/Rust/viz/viz-sqlx.dockerfile index 76104544be0..62bd3cac1d8 100644 --- a/frameworks/Rust/viz/viz-sqlx.dockerfile +++ b/frameworks/Rust/viz/viz-sqlx.dockerfile @@ -1,6 +1,4 @@ -FROM rust:1.79 - -RUN apt-get update -yqq && apt-get install -yqq cmake g++ +FROM rust:1.83 ADD ./ /viz WORKDIR /viz diff --git a/frameworks/Rust/viz/viz.dockerfile b/frameworks/Rust/viz/viz.dockerfile index d6fd457b66e..16abf430a9f 100644 --- a/frameworks/Rust/viz/viz.dockerfile +++ b/frameworks/Rust/viz/viz.dockerfile @@ -1,6 +1,4 @@ -FROM rust:1.79 - -RUN apt-get update -yqq && apt-get install -yqq cmake g++ +FROM rust:1.83 ADD ./ /viz WORKDIR /viz diff --git a/frameworks/TypeScript/ditsmod/benchmark_config.json b/frameworks/TypeScript/ditsmod/benchmark_config.json index 11704b96a53..39c4bce56cf 100755 --- a/frameworks/TypeScript/ditsmod/benchmark_config.json +++ b/frameworks/TypeScript/ditsmod/benchmark_config.json @@ -18,7 +18,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod", + "display_name": "ditsmod v3.0", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "nodejs" }, @@ -41,7 +41,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod [postgres]", + "display_name": "ditsmod v3.0 [postgres]", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "nodejs" }, @@ -64,7 +64,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod [mysql]", + "display_name": "ditsmod v3.0 [mysql]", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "nodejs" }, @@ -84,7 +84,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod on bun", + "display_name": "ditsmod-bun v3.0", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "bun" }, @@ -107,7 +107,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod on bun [postgres]", + "display_name": "ditsmod-bun v3.0 [postgres]", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "bun" }, @@ -130,7 +130,7 @@ "webserver": "None", "os": "Linux", "database_os": "Linux", - "display_name": "ditsmod on bun [mysql]", + "display_name": "ditsmod-bun v3.0 [mysql]", "notes": "Simplified use of Dependency Injection (no request level injector).", "versus": "bun" } diff --git a/frameworks/TypeScript/ditsmod/package.json b/frameworks/TypeScript/ditsmod/package.json index a4d1ec09851..a0a1298ef86 100755 --- a/frameworks/TypeScript/ditsmod/package.json +++ b/frameworks/TypeScript/ditsmod/package.json @@ -14,8 +14,8 @@ "author": "Костя Третяк", "license": "MIT", "dependencies": { - "@ditsmod/core": "~2.55.0", - "@ditsmod/routing": "~2.3.0", + "@ditsmod/core": "^3.0.0-alpha.2", + "@ditsmod/routing": "^3.0.0-alpha.2", "handlebars": "^4.7.8", "lru-cache": "^11.0.0", "mariadb": "^3.3.1", diff --git a/frameworks/TypeScript/ditsmod/src/app/app.module.ts b/frameworks/TypeScript/ditsmod/src/app/app.module.ts index 34bfc4357cf..d50e72d1557 100644 --- a/frameworks/TypeScript/ditsmod/src/app/app.module.ts +++ b/frameworks/TypeScript/ditsmod/src/app/app.module.ts @@ -2,15 +2,13 @@ import { Providers, rootModule } from '@ditsmod/core'; import { PRE_ROUTER_EXTENSIONS, RoutingModule } from '@ditsmod/routing'; import { OneController } from './one.controller.js'; -import { DbService } from './db.service.js'; import { InitExtension } from './init.extension.js'; import { DB_INIT_EXTENSIONS } from './tokens.js'; -import { ModelService } from './types.js'; @rootModule({ imports: [RoutingModule], - providersPerApp: new Providers().passThrough(DbService).passThrough(ModelService).useLogConfig({ level: 'off' }), - extensions: [{ extension: InitExtension, groupToken: DB_INIT_EXTENSIONS, nextToken: PRE_ROUTER_EXTENSIONS }], + providersPerApp: new Providers().useLogConfig({ level: 'off' }), + extensions: [{ extension: InitExtension, group: DB_INIT_EXTENSIONS, beforeGroup: PRE_ROUTER_EXTENSIONS }], controllers: [OneController], }) export class AppModule {} diff --git a/frameworks/TypeScript/ditsmod/src/app/init.extension.ts b/frameworks/TypeScript/ditsmod/src/app/init.extension.ts index 45ae1da68ed..7775328edfa 100644 --- a/frameworks/TypeScript/ditsmod/src/app/init.extension.ts +++ b/frameworks/TypeScript/ditsmod/src/app/init.extension.ts @@ -5,18 +5,12 @@ import { ModelService } from './types.js'; @injectable() export class InitExtension implements Extension { - #inited: boolean; - constructor( private perAppService: PerAppService, private logger: Logger, ) {} - async init(): Promise { - if (this.#inited) { - return; - } - + async stage1(): Promise { const dbType = process.env.DATABASE as 'mysql' | 'postgres'; if (dbType == 'mysql') { @@ -28,13 +22,13 @@ export class InitExtension implements Extension { } else { this.logger.log('warn', `Unknown database "${dbType}"`); } - - this.#inited = true; } protected async setDbService(useClass: Class) { - const injector = this.perAppService.injector.resolveAndCreateChild([{ token: ModelService, useClass }]); - const dbService = injector.pull(DbService) as DbService; + const dbService = this.perAppService.injector + .resolveAndCreateChild([DbService, { token: ModelService, useClass }]) + .get(DbService) as DbService; + await dbService.setWorldsToCache(); this.perAppService.providers.push({ token: DbService, useValue: dbService }); } diff --git a/frameworks/TypeScript/ditsmod/src/app/one.controller.ts b/frameworks/TypeScript/ditsmod/src/app/one.controller.ts index 09615c93598..d4ba84464b0 100644 --- a/frameworks/TypeScript/ditsmod/src/app/one.controller.ts +++ b/frameworks/TypeScript/ditsmod/src/app/one.controller.ts @@ -1,4 +1,5 @@ -import { AnyObj, controller, RequestContext, SingletonRequestContext, route } from '@ditsmod/core'; +import { AnyObj, controller, RequestContext, SingletonRequestContext, optional } from '@ditsmod/core'; +import { route } from '@ditsmod/routing'; import Handlebars from 'handlebars'; import { DbService } from './db.service.js'; @@ -27,9 +28,9 @@ const tmpl = Handlebars.compile( ].join(''), ); -@controller({ isSingleton: true }) +@controller({ scope: 'module' }) export class OneController { - constructor(private dbService: DbService) {} + constructor(@optional() private dbService: DbService) {} @route('GET', 'db') async getSingleQuery(ctx: RequestContext) { @@ -61,28 +62,24 @@ export class OneController { const fortunes = await this.dbService.findAllFortunes(); fortunes.push(additionalFortune); fortunes.sort(compare); - ctx.nodeRes.setHeader('Server', 'Ditsmod'); - ctx.nodeRes.setHeader('Content-Type', 'text/html; charset=utf-8'); - ctx.nodeRes.end(tmpl({ fortunes })); + ctx.rawRes.setHeader('Server', 'Ditsmod'); + ctx.rawRes.setHeader('Content-Type', 'text/html; charset=utf-8'); + ctx.rawRes.end(tmpl({ fortunes })); } @route('GET', 'plaintext') getHello(ctx: SingletonRequestContext) { - ctx.nodeRes.setHeader('Server', 'Ditsmod'); - ctx.nodeRes.setHeader('Content-Type', 'text/plain; charset=utf-8'); - ctx.nodeRes.end('Hello, World!'); + ctx.rawRes.setHeader('Server', 'Ditsmod'); + ctx.rawRes.setHeader('Content-Type', 'text/plain; charset=utf-8'); + ctx.rawRes.end('Hello, World!'); } @route('GET', 'json') getJson(ctx: SingletonRequestContext) { - ctx.nodeRes.setHeader('Server', 'Ditsmod'); - ctx.nodeRes.setHeader('Content-Type', 'application/json; charset=utf-8'); - ctx.nodeRes.end(JSON.stringify({ message: 'Hello, World!' })); + this.sendJson(ctx, { message: 'Hello, World!' }); } protected sendJson(ctx: RequestContext, value: AnyObj) { - ctx.nodeRes.setHeader('Server', 'Ditsmod'); - ctx.nodeRes.setHeader('Content-Type', 'application/json; charset=utf-8'); - ctx.nodeRes.end(JSON.stringify(value)); + ctx.setHeader('Server', 'Ditsmod').sendJson(value); } } diff --git a/frameworks/TypeScript/ditsmod/src/main.ts b/frameworks/TypeScript/ditsmod/src/main.ts index 46f535f2c75..b42ba0a5b64 100644 --- a/frameworks/TypeScript/ditsmod/src/main.ts +++ b/frameworks/TypeScript/ditsmod/src/main.ts @@ -13,6 +13,6 @@ if (numCpus > 1 && cluster.isPrimary) { } } else { const serverOptions: ServerOptions = { keepAlive: true, keepAliveTimeout: 0 }; - const app = await new Application().bootstrap(AppModule, { serverOptions }); + const app = await Application.create(AppModule, { serverOptions }); app.server.listen(8080, '0.0.0.0'); } diff --git a/frameworks/TypeScript/elysia/bun.lockb b/frameworks/TypeScript/elysia/bun.lockb index 5d4cdb0b97a..8b08fa7e91b 100755 Binary files a/frameworks/TypeScript/elysia/bun.lockb and b/frameworks/TypeScript/elysia/bun.lockb differ diff --git a/frameworks/TypeScript/elysia/package.json b/frameworks/TypeScript/elysia/package.json index fa95e553bc3..9d38195023f 100644 --- a/frameworks/TypeScript/elysia/package.json +++ b/frameworks/TypeScript/elysia/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "module": "src/index.js", "devDependencies": { - "typescript": "^5.5.4" + "@types/bun": "^1.1.14", + "typescript": "^5.7.2" }, "scripts": { "dev": "bun run --watch src/index.ts", @@ -12,7 +13,7 @@ "compile": "bun build --compile --minify --target bun --outfile server src/index.ts" }, "dependencies": { - "elysia": "^1.1.16", - "postgres": "^3.4.4" + "elysia": "^1.2.9", + "postgres": "^3.4.5" } } diff --git a/frameworks/TypeScript/elysia/src/db-handlers.ts b/frameworks/TypeScript/elysia/src/db-handlers.ts index b75ccfdea60..6674829bfd9 100644 --- a/frameworks/TypeScript/elysia/src/db-handlers.ts +++ b/frameworks/TypeScript/elysia/src/db-handlers.ts @@ -2,74 +2,66 @@ import { Elysia, t } from "elysia"; import * as db from "./postgres"; import { Fortune } from "./types"; -function rand() { - return Math.ceil(Math.random() * 10000); +export function rand() { + return Math.ceil(Math.random() * 10000); } function parseQueriesNumber(q?: string) { - return Math.min(parseInt(q || "1") || 1, 500); -} - -function renderTemplate(fortunes: Fortune[]) { - const n = fortunes.length; - - let html = ""; - for (let i = 0; i < n; i++) { - html += `${fortunes[i].id}${Bun.escapeHTML( - fortunes[i].message, - )}`; - } - - return `Fortunes${html}
idmessage
`; + // NaN is falsy, fallback to one. + return Math.min(+q! || 1, 500); } export const dbHandlers = new Elysia() - .headers({ - server: "Elysia", - }) - .get("/db", () => db.find(rand())) - .get("/fortunes", async (c) => { - const fortunes = await db.fortunes(); - - fortunes.push({ - id: 0, - message: "Additional fortune added at request time.", - }); - - fortunes.sort((a, b) => { - if (a.message < b.message) return -1; - - return 1; - }); - - c.set.headers["content-type"] = "text/html; charset=utf-8"; - - return renderTemplate(fortunes); - }) - .get("/queries", (c) => { - const num = parseQueriesNumber(c.query.queries); - const worldPromises = new Array(num); - - for (let i = 0; i < num; i++) { - worldPromises[i] = db.find(rand()); - } - - return Promise.all(worldPromises); - }) - .get("/updates", async (c) => { - const num = parseQueriesNumber(c.query.queries); - const worldPromises = new Array(num); - - for (let i = 0; i < num; i++) { - worldPromises[i] = db.find(rand()); - } - - const worlds = await Promise.all(worldPromises); - - for (let i = 0; i < num; i++) { - worlds[i].randomNumber = rand(); - } - - await db.bulkUpdate(worlds); - return worlds; - }); + .headers({ + server: "Elysia", + }) + // ? Mark as async for Promise result to prevent double Elysia's mapResponse execution + .get("/db", async () => db.find(rand())) + .get("/fortunes", async (c) => { + const fortunes = await db.fortunes(); + + fortunes.push({ + id: 0, + message: "Additional fortune added at request time.", + }); + + fortunes.sort((a, b) => { + if (a.message < b.message) return -1; + + return 1; + }); + + c.set.headers["content-type"] = "text/html; charset=utf-8"; + + const n = fortunes.length; + + let html = ""; + for (let i = 0; i < n; i++) { + html += `${fortunes[i].id}${Bun.escapeHTML( + fortunes[i].message, + )}`; + } + + return `Fortunes${html}
idmessage
`; + }) + // ? Mark as async for Promise result to prevent double Elysia's mapResponse execution + .get("/queries", async (c) => { + const num = parseQueriesNumber(c.query.queries); + const worldPromises = new Array(num); + + for (let i = 0; i < num; i++) worldPromises[i] = db.find(rand()); + + return Promise.all(worldPromises); + }) + .get("/updates", async (c) => { + const num = parseQueriesNumber(c.query.queries); + const worldPromises = new Array(num); + + for (let i = 0; i < num; i++) + worldPromises[i] = db.findThenRand(rand()); + + const worlds = await Promise.all(worldPromises); + + await db.bulkUpdate(worlds); + return worlds; + }); diff --git a/frameworks/TypeScript/elysia/src/postgres.ts b/frameworks/TypeScript/elysia/src/postgres.ts index cc6d4389a02..33db0497fcc 100644 --- a/frameworks/TypeScript/elysia/src/postgres.ts +++ b/frameworks/TypeScript/elysia/src/postgres.ts @@ -1,30 +1,39 @@ import postgres from "postgres"; -import { Fortune, World } from "./types"; +import { rand } from "./db-handlers"; +import type { Fortune, World } from "./types"; const sql = postgres({ - host: "tfb-database", - user: "benchmarkdbuser", - password: "benchmarkdbpass", - database: "hello_world", - max: 1, + host: "tfb-database", + user: "benchmarkdbuser", + password: "benchmarkdbpass", + database: "hello_world", + max: 1, }); export const fortunes = () => sql`SELECT id, message FROM fortune`; export const find = (id: number) => - sql`SELECT id, randomNumber FROM world WHERE id = ${id}`.then( - (arr) => arr[0], - ); + sql`SELECT id, randomNumber FROM world WHERE id = ${id}`.then( + (arr) => arr[0], + ); + +export const findThenRand = (id: number) => + sql`SELECT id, randomNumber FROM world WHERE id = ${id}`.then( + (arr) => { + arr[0].randomNumber = rand(); + return arr[0]; + }, + ); export const bulkUpdate = (worlds: World[]) => { - worlds = worlds.toSorted((a, b) => a.id - b.id); + worlds = worlds.toSorted((a, b) => a.id - b.id); - const values = new Array(worlds.length); - for (let i = 0; i < worlds.length; i++) { - values[i] = [worlds[i].id, worlds[i].randomNumber]; - } + const values = new Array(worlds.length); + for (let i = 0; i < worlds.length; i++) { + values[i] = [worlds[i].id, worlds[i].randomNumber]; + } - return sql`UPDATE world SET randomNumber = (update_data.randomNumber)::int - FROM (VALUES ${sql(values)}) AS update_data (id, randomNumber) - WHERE world.id = (update_data.id)::int`; + return sql`UPDATE world SET randomNumber = (update_data.randomNumber)::int + FROM (VALUES ${sql(values)}) AS update_data (id, randomNumber) + WHERE world.id = (update_data.id)::int`; };