diff --git a/frameworks/Rust/ntex/Cargo.toml b/frameworks/Rust/ntex/Cargo.toml index bfc44e1e408..ba3133f31b8 100755 --- a/frameworks/Rust/ntex/Cargo.toml +++ b/frameworks/Rust/ntex/Cargo.toml @@ -15,6 +15,10 @@ path = "src/main.rs" name = "ntex-neon" path = "src/main.rs" +[[bin]] +name = "ntex-neon-uring" +path = "src/main.rs" + [[bin]] name = "ntex-db" path = "src/main_db.rs" @@ -27,6 +31,10 @@ path = "src/main_db.rs" name = "ntex-db-neon" path = "src/main_db.rs" +[[bin]] +name = "ntex-db-neon-uring" +path = "src/main_db.rs" + [[bin]] name = "ntex-plt" path = "src/main_plt.rs" @@ -39,6 +47,10 @@ path = "src/main_plt.rs" name = "ntex-plt-neon" path = "src/main_plt.rs" +[[bin]] +name = "ntex-plt-neon-uring" +path = "src/main_plt.rs" + [features] default = [] @@ -51,6 +63,9 @@ compio = ["ntex/compio"] # neon runtime neon = ["ntex/neon"] +# neon runtime +neon-uring = ["ntex/neon-uring"] + [dependencies] ntex = "2.12" ntex-compio = "0.2" @@ -63,7 +78,7 @@ env_logger = "0.11" nanorand = { version = "0.7", default-features = false, features = ["std", "wyrand", "tls"] } atoi = "2.0" futures = "0.3" -sonic-rs = "0.3.16" +sonic-rs = "0.4.0" serde = { version = "1", features = ["derive"] } serde_json = "1" log = { version = "0.4", features = ["release_max_level_off"] } @@ -78,7 +93,6 @@ ntex = { git = "https://github.com/ntex-rs/ntex.git" } ntex-io = { git = "https://github.com/ntex-rs/ntex.git" } ntex-net = { git = "https://github.com/ntex-rs/ntex.git" } ntex-rt = { git = "https://github.com/ntex-rs/ntex.git" } -ntex-neon = { git = "https://github.com/ntex-rs/ntex.git" } [profile.release] opt-level = 3 diff --git a/frameworks/Rust/ntex/benchmark_config.json b/frameworks/Rust/ntex/benchmark_config.json index 44e54843e8e..16615823f11 100755 --- a/frameworks/Rust/ntex/benchmark_config.json +++ b/frameworks/Rust/ntex/benchmark_config.json @@ -19,7 +19,7 @@ "notes": "", "versus": "" }, - "compio": { + "neon": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -33,11 +33,11 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio]", + "display_name": "ntex [neon]", "notes": "", "versus": "" }, - "neon": { + "neon-uring": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -51,7 +51,7 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [neon]", + "display_name": "ntex [neon(io-uring)]", "notes": "", "versus": "" }, @@ -75,7 +75,7 @@ "notes": "", "versus": "" }, - "db-compio": { + "db-neon": { "fortune_url": "/fortunes", "db_url": "/db", "query_url": "/query?q=", @@ -91,11 +91,11 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio,db]", + "display_name": "ntex [neon,db]", "notes": "", "versus": "" }, - "db-neon": { + "db-neon-uring": { "fortune_url": "/fortunes", "db_url": "/db", "query_url": "/query?q=", @@ -111,7 +111,7 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [neon,db]", + "display_name": "ntex [neon(io-uring),db]", "notes": "", "versus": "" }, @@ -133,7 +133,7 @@ "notes": "", "versus": "" }, - "plt-compio": { + "plt-neon": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -147,11 +147,11 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [compio,platform]", + "display_name": "ntex [neon,platform]", "notes": "", "versus": "" }, - "plt-neon": { + "plt-neon-uring": { "json_url": "/json", "plaintext_url": "/plaintext", "port": 8080, @@ -165,7 +165,7 @@ "webserver": "ntex", "os": "Linux", "database_os": "Linux", - "display_name": "ntex [neon,platform]", + "display_name": "ntex [neon(io-uring),platform]", "notes": "", "versus": "" } diff --git a/frameworks/Rust/ntex/config.toml b/frameworks/Rust/ntex/config.toml index 75e7832f73b..ad8a0276411 100644 --- a/frameworks/Rust/ntex/config.toml +++ b/frameworks/Rust/ntex/config.toml @@ -40,6 +40,19 @@ platform = "None" webserver = "ntex" versus = "" +[neon-uring] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + [db] urls.db = "/db" urls.query = "/query?q=" @@ -85,6 +98,21 @@ platform = "None" webserver = "ntex" versus = "" +[db-neon-uring] +urls.db = "/db" +urls.query = "/query?q=" +urls.update = "/update?q=" +urls.fortune = "/fortunes" +approach = "Realistic" +classification = "Micro" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" + [plt] urls.plaintext = "/plaintext" urls.json = "/json" @@ -123,3 +151,16 @@ orm = "Raw" platform = "None" webserver = "ntex" versus = "" + +[plt-neon-uring] +urls.plaintext = "/plaintext" +urls.json = "/json" +approach = "Realistic" +classification = "Platform" +database = "Postgres" +database_os = "Linux" +os = "Linux" +orm = "Raw" +platform = "None" +webserver = "ntex" +versus = "" diff --git a/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile new file mode 100644 index 00000000000..2b65aaa1556 --- /dev/null +++ b/frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-db-neon-uring diff --git a/frameworks/Rust/ntex/ntex-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-neon-uring.dockerfile new file mode 100644 index 00000000000..f69e45e7f8d --- /dev/null +++ b/frameworks/Rust/ntex/ntex-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-neon-uring diff --git a/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile b/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile new file mode 100644 index 00000000000..943c6ef2373 --- /dev/null +++ b/frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile @@ -0,0 +1,16 @@ +FROM rust:latest + +# Disable simd at jsonescape +# ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD= + +RUN apt-get update -yqq && apt-get install -yqq cmake g++ + +ADD ./ /ntex +WORKDIR /ntex + +RUN cargo clean +RUN RUSTFLAGS="-C target-cpu=native" cargo build --release --features="neon-uring" + +EXPOSE 8080 + +CMD ./target/release/ntex-plt-neon-uring diff --git a/frameworks/Rust/ntex/src/utils.rs b/frameworks/Rust/ntex/src/utils.rs index b8a9010237f..6fd48e6e265 100644 --- a/frameworks/Rust/ntex/src/utils.rs +++ b/frameworks/Rust/ntex/src/utils.rs @@ -57,10 +57,11 @@ impl WriteExt for BytesWriter<'_> { } #[inline(always)] - unsafe fn flush_len(&mut self, additional: usize) { + unsafe fn flush_len(&mut self, additional: usize) -> io::Result<()> { unsafe { let new_len = self.0.len() + additional; self.0.set_len(new_len); } + Ok(()) } }