Browse Source

Upgrade hyperlane (#9901)

* feat: update & fortune

* feat: randomNumber

* feat: max row 500

* feat: update

* feat: Fortune

* feat: fortunes

* feat: update

* feat: update

* feat: update

* feat: update

* feat: fortunes

* feat: fortunes

* feat: fortunes

* feat: fortunes

* feat: fortunes

* feat: fortunes

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: cache

* feat: cache

* feat: config

* feat: config

* feat: config

* feat: v4.36.1

* docs: readme

* feat: remove dyn

* docs: readme

* feat: lock

* feat: lock

* feat: lock

* feat: lock

* feat: db pool

* feat: db pool

* feat: lock

* feat: lock

* feat: db

* feat: db

* feat: db

* feat: db

* feat: db

* feat: db

* feat: db

* feat: db

* feat: rand

* feat: rand

* feat: rand

* feat: rand

* feat: rand

* feat: port

* feat: port

* feat: port

* feat: db

* feat: db

* feat: db

* feat: lock

* feat: lock

* feat: v4.41.0

* feat: v4.42.0

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'

* feat: inline

* feat: dockerfile

* feat: v4.52.1

* feat: remove key

* remove: log

* remove: log

* feat: async

* remove: empty loop

* feat: utf8

* change: pool_size

* remove: utf8

* feat: log

* feat: log

* feat: v3.14.1

* feat: 4.56.3

* feat: 4.56.4

* feat: 4.56.5

* feat:  rename

* Merge branch 'master' of github.com:TechEmpower/FrameworkBenchmarks

* feat: speed

* feat: speed

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* feat: runtime

* feat: runtime

* feat: runtime

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* lock: toml

* feat: update

* Merge remote-tracking branch 'upstream/master'

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* Merge remote-tracking branch 'upstream/master'

* feat: hyperlane

* feat: update

* docs: readme

* feat: update

* Merge remote-tracking branch 'upstream/master'

* feat: update

* feat: update

* feat: update

* Merge remote-tracking branch 'upstream/master'

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: update

* feat: lock

---------

Co-authored-by: 尤雨东 <[email protected]>
尤雨东 2 months ago
parent
commit
ac5a83e843

+ 47 - 99
frameworks/Rust/hyperlane/Cargo.lock

@@ -95,9 +95,9 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
 
 [[package]]
 name = "bitflags"
-version = "2.9.0"
+version = "2.9.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
 dependencies = [
  "serde",
 ]
@@ -158,15 +158,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 [[package]]
 name = "clonelicious"
-version = "1.1.1"
+version = "2.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc3dfae702af156917c65f4ccc70687088331f0b694e5e687453e4d68a16b496"
+checksum = "b7d51b119ca46e37c21508debf8d9823521be05a70e32ee5afc7695ae1cfb4ec"
 
 [[package]]
 name = "color-output"
-version = "6.6.1"
+version = "6.6.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47a70e27f954a060626fdba6829cdded6c3dae6376d0e03822363114aaead8a8"
+checksum = "ed260583bcafb40922925d447c098fd5b94e7b2eb8679e87dae2632da0a01357"
 dependencies = [
  "hyperlane-time",
 ]
@@ -313,16 +313,6 @@ version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
 
-[[package]]
-name = "errno"
-version = "0.3.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
-dependencies = [
- "libc",
- "windows-sys 0.59.0",
-]
-
 [[package]]
 name = "etcetera"
 version = "0.8.0"
@@ -345,17 +335,11 @@ dependencies = [
  "pin-project-lite",
 ]
 
-[[package]]
-name = "fastrand"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
-
 [[package]]
 name = "file-operation"
-version = "0.5.9"
+version = "0.5.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78548b84eac71fe0f185f2169fa960f65af6e49ae2b63fdb729e81cacdf7b5da"
+checksum = "b1b81e9a35a431f57f3304aec4ed6a59c7f1fb82af62b02e18afe197e8e3769d"
 dependencies = [
  "tokio",
 ]
@@ -407,12 +391,9 @@ dependencies = [
 
 [[package]]
 name = "future-fn"
-version = "0.1.0"
+version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "001452c736697c8f96e4689dc5ab6a89f175981417139a44f1dd1f7c20d430a5"
-dependencies = [
- "tokio",
-]
+checksum = "61a60fa5df978d3b02f58da08ae2e47d2bb8b19f765a693eaa9e5e8045b3925d"
 
 [[package]]
 name = "futures"
@@ -638,9 +619,9 @@ dependencies = [
 
 [[package]]
 name = "http-compress"
-version = "2.13.1"
+version = "2.13.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42e8fe2367f50ba59314488b240828c518c17f3b19d48d2555c62d947925d6ac"
+checksum = "7f1e04c8ee442e52dfbf7e4003f614d8e35ff4e4f6ea9271871abcec8a6d7c85"
 dependencies = [
  "brotli",
  "flate2",
@@ -649,15 +630,15 @@ dependencies = [
 
 [[package]]
 name = "http-constant"
-version = "1.42.1"
+version = "1.42.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1292cbdcf2588d15f8bf14cac381785c11ca7634d6a088cad9eebb5068d2652b"
+checksum = "1808d8983c7ca1d289188767327a24d3e6c0c6a741257745fd7fea9f8f7a7635"
 
 [[package]]
 name = "http-type"
-version = "3.69.0"
+version = "3.69.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaf5da8da331a56ba2e5b0a8a70432471ecba536d7ad1d9837fa530a357d0979"
+checksum = "03e242a3c26c3365128c36a3cc803a4d3299cdf466dff723acbdee7a3911d045"
 dependencies = [
  "ahash",
  "dashmap",
@@ -682,9 +663,9 @@ dependencies = [
 
 [[package]]
 name = "hyperlane"
-version = "4.94.0"
+version = "4.99.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3729f28d6eabc3106bff87c6d22e948234edc58cac893ad0b886f9edf6460759"
+checksum = "ee442e23cfd5aa7a08992fdb58e4ae18281bae51a5ee6907e7cd5344f758a81b"
 dependencies = [
  "clonelicious",
  "color-output",
@@ -699,9 +680,9 @@ dependencies = [
 
 [[package]]
 name = "hyperlane-log"
-version = "1.16.1"
+version = "1.16.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17a47938bb5388e2428ebbe02098c485c2a596b4aae4cc909320394dede527bb"
+checksum = "dc2fea42cc7c83f7c8436ee6db372fc043a034065d94f9ac6dbbc28e00302d14"
 dependencies = [
  "file-operation",
  "hyperlane-time",
@@ -711,13 +692,13 @@ dependencies = [
 
 [[package]]
 name = "hyperlane-time"
-version = "0.5.1"
+version = "0.5.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f69051b8978d37eb5a3d8f700a39159d40d7646f1aef8d2f3e441279f4dfa1"
+checksum = "8e7dd4a0e7011c2909328b695546ef47a520969d619d6f0542a56d8f3ef84470"
 
 [[package]]
 name = "hyperlane_techempower"
-version = "0.0.1"
+version = "0.1.0"
 dependencies = [
  "hyperlane",
  "rand 0.9.1",
@@ -889,12 +870,6 @@ dependencies = [
  "vcpkg",
 ]
 
-[[package]]
-name = "linux-raw-sys"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
-
 [[package]]
 name = "litemap"
 version = "0.8.0"
@@ -919,9 +894,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
 
 [[package]]
 name = "lombok-macros"
-version = "1.10.1"
+version = "1.11.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ffb76637e1a834f7ad93d96b8be0bcfa6673f08fdcab6c9fbeabc1cb0e8c379"
+checksum = "89a6c00f977434776490d523145f6de60b6b7d9ce1096c011449484c80100a40"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1222,9 +1197,9 @@ dependencies = [
 
 [[package]]
 name = "recoverable-spawn"
-version = "3.7.2"
+version = "3.7.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57702670d1a6eb7e02bbd6c2fafe3587c42eb2ce4e5012ae8632171aa58c21b6"
+checksum = "6740e68c7a92ceec820bb9e62ade93377b631ee1d4e8252a34a3815446e59f64"
 dependencies = [
  "once_cell",
  "tokio",
@@ -1232,9 +1207,9 @@ dependencies = [
 
 [[package]]
 name = "recoverable-thread-pool"
-version = "2.3.1"
+version = "2.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03a8924916abfed76681374565d505b59b2c8bc17f03e3693be2243c324433ed"
+checksum = "629c4dafeade0bd46f1f9ce78dcb8336ba912b2544d028a8cf714a32a0ffa29f"
 dependencies = [
  "lombok-macros",
  "recoverable-spawn",
@@ -1296,19 +1271,6 @@ version = "0.1.24"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
 
-[[package]]
-name = "rustix"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
-dependencies = [
- "bitflags",
- "errno",
- "libc",
- "linux-raw-sys",
- "windows-sys 0.59.0",
-]
-
 [[package]]
 name = "ryu"
 version = "1.0.20"
@@ -1379,9 +1341,9 @@ dependencies = [
 
 [[package]]
 name = "server-manager"
-version = "3.2.1"
+version = "3.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7be400c8b4c701205cf9415f5463845319fbaeea0964750cb94f830224145d86"
+checksum = "d6936d74a2263590ed722bdf27315b693b8a84a5dffdb3b47a9b7c0a7b50396b"
 dependencies = [
  "tokio",
 ]
@@ -1497,9 +1459,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3c3a85280daca669cfd3bcb68a337882a8bc57ec882f72c5d13a430613a738e"
+checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc"
 dependencies = [
  "sqlx-core",
  "sqlx-macros",
@@ -1510,9 +1472,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx-core"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f743f2a3cea30a58cd479013f75550e879009e3a02f616f18ca699335aa248c3"
+checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6"
 dependencies = [
  "base64",
  "bytes",
@@ -1544,9 +1506,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx-macros"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f4200e0fde19834956d4252347c12a083bdcb237d7a1a1446bffd8768417dce"
+checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1557,9 +1519,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx-macros-core"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "882ceaa29cade31beca7129b6beeb05737f44f82dbe2a9806ecea5a7093d00b7"
+checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b"
 dependencies = [
  "dotenvy",
  "either",
@@ -1576,16 +1538,15 @@ dependencies = [
  "sqlx-postgres",
  "sqlx-sqlite",
  "syn",
- "tempfile",
  "tokio",
  "url",
 ]
 
 [[package]]
 name = "sqlx-mysql"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0afdd3aa7a629683c2d750c2df343025545087081ab5942593a5288855b1b7a7"
+checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526"
 dependencies = [
  "atoi",
  "base64",
@@ -1625,9 +1586,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx-postgres"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0bedbe1bbb5e2615ef347a5e9d8cd7680fb63e77d9dafc0f29be15e53f1ebe6"
+checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46"
 dependencies = [
  "atoi",
  "base64",
@@ -1662,9 +1623,9 @@ dependencies = [
 
 [[package]]
 name = "sqlx-sqlite"
-version = "0.8.5"
+version = "0.8.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c26083e9a520e8eb87a06b12347679b142dc2ea29e6e409f805644a7a979a5bc"
+checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea"
 dependencies = [
  "atoi",
  "flume",
@@ -1692,9 +1653,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
 
 [[package]]
 name = "std-macro-extensions"
-version = "0.23.0"
+version = "0.23.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a607e0efa86ea0eaa1985e254fd8412d8d2d2aa5e46af96b67a6b188677dcbeb"
+checksum = "aa17898d2c4216a85ad32abd51101b6eab0adef954ed1393c4557ba378625ade"
 
 [[package]]
 name = "stringprep"
@@ -1735,19 +1696,6 @@ dependencies = [
  "syn",
 ]
 
-[[package]]
-name = "tempfile"
-version = "3.19.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
-dependencies = [
- "fastrand",
- "getrandom 0.3.3",
- "once_cell",
- "rustix",
- "windows-sys 0.59.0",
-]
-
 [[package]]
 name = "thiserror"
 version = "1.0.69"

+ 5 - 5
frameworks/Rust/hyperlane/Cargo.toml

@@ -1,12 +1,12 @@
 [package]
 name = "hyperlane_techempower"
-version = "0.0.1"
+version = "0.1.0"
 edition = "2024"
-authors = ["ltpp-universe <[email protected]>"] 
+authors = ["[email protected]"] 
 license = "MIT"
 description = """Hyperlane is a lightweight and high-performance Rust HTTP server library designed to simplify network service development. It supports HTTP request parsing, response building, and TCP communication, making it ideal for building modern web services. Additionally, it provides support for request and response middleware, WebSocket, and Server-Sent Events (SSE), enabling flexible and efficient real-time communication."""
 keywords = ["http", "request", "response", "tcp", "redirect"]
-repository = "https://github.com/ltpp-universe/hyperlane.git"
+repository = "https://github.com/eastspire/hyperlane.git"
 categories = ["network-programming", "web-programming"]
 exclude = [
     "target",
@@ -18,10 +18,10 @@ exclude = [
 ]
 
 [dependencies]
-hyperlane = "4.94.0"
+hyperlane = "4.99.2"
 rand = "0.9.1"
 serde = "1.0.219"
-sqlx = { version = "0.8.5", features = ["runtime-tokio", "postgres"] }
+sqlx = { version = "0.8.6", features = ["runtime-tokio", "postgres"] }
 
 [profile.dev]
 incremental = false

+ 1 - 1
frameworks/Rust/hyperlane/README.md

@@ -1,4 +1,4 @@
-# [hyperlane](https://github.com/ltpp-universe/hyperlane) web framework
+# [hyperlane](https://github.com/eastspire/hyperlane) web framework
 
 ## Description
 

+ 6 - 6
frameworks/Rust/hyperlane/src/db.rs

@@ -8,7 +8,7 @@ pub fn get_db_connection() -> &'static DbPoolConnection {
 pub async fn create_database() {
     let db_pool: &DbPoolConnection = get_db_connection();
     let _ = query(&format!("CREATE DATABASE {};", DATABASE_NAME))
-        .execute(&db_pool)
+        .execute(db_pool)
         .await;
 }
 
@@ -21,7 +21,7 @@ pub async fn create_table() {
         );",
         TABLE_NAME_WORLD
     ))
-    .execute(&db_pool)
+    .execute(db_pool)
     .await;
     let _ = query(&format!(
         "CREATE TABLE IF NOT EXISTS {} (
@@ -29,7 +29,7 @@ pub async fn create_table() {
         );",
         TABLE_NAME_FORTUNE
     ))
-    .execute(&db_pool)
+    .execute(db_pool)
     .await;
 }
 
@@ -37,7 +37,7 @@ pub async fn create_table() {
 pub async fn insert_records() {
     let db_pool: &DbPoolConnection = get_db_connection();
     let row: PgRow = query(&format!("SELECT COUNT(*) FROM {}", TABLE_NAME_WORLD))
-        .fetch_one(&db_pool)
+        .fetch_one(db_pool)
         .await
         .unwrap();
     let count: i64 = row.get(0);
@@ -56,7 +56,7 @@ pub async fn insert_records() {
         TABLE_NAME_WORLD,
         values.join(",")
     );
-    let _ = query(&sql).execute(&db_pool).await;
+    let _ = query(&sql).execute(db_pool).await;
     let mut values: Vec<String> = Vec::new();
     for _ in 0..missing_count {
         let random_number: i32 = get_random_id();
@@ -67,7 +67,7 @@ pub async fn insert_records() {
         TABLE_NAME_FORTUNE,
         values.join(",")
     );
-    let _ = query(&sql).execute(&db_pool).await;
+    let _ = query(&sql).execute(db_pool).await;
 }
 
 pub async fn init_cache() -> Vec<QueryRow> {

+ 4 - 2
frameworks/Rust/hyperlane/src/main.rs

@@ -12,12 +12,16 @@ pub(crate) mod utils;
 
 pub(crate) use r#const::*;
 pub(crate) use db::*;
+pub(crate) use r#type::*;
+pub(crate) use utils::*;
+
 pub(crate) use hyperlane::{
     futures::{executor::block_on, future::join_all},
     once_cell::sync::Lazy,
     serde::*,
     serde_json::{Value, json},
     tokio::{
+        runtime::{Builder, Runtime},
         spawn,
         sync::{AcquireError, OwnedSemaphorePermit, Semaphore},
         task::JoinHandle,
@@ -32,8 +36,6 @@ pub(crate) use sqlx::{
     *,
 };
 pub(crate) use std::{fmt, hint::black_box, sync::Arc};
-pub(crate) use r#type::*;
-pub(crate) use utils::*;
 
 fn main() {
     run_server();

+ 2 - 3
frameworks/Rust/hyperlane/src/server.rs

@@ -1,12 +1,11 @@
 use crate::*;
-use tokio::runtime::{Builder, Runtime};
 
 fn runtime() -> Runtime {
     Builder::new_multi_thread()
         .worker_threads(get_thread_count())
         .thread_stack_size(1_048_576)
-        .max_blocking_threads(10240)
-        .max_io_events_per_tick(10240)
+        .max_blocking_threads(1_024_000)
+        .max_io_events_per_tick(1024000)
         .enable_all()
         .build()
         .unwrap()