Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions frameworks/Rust/ntex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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 = []

Expand All @@ -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"
Expand All @@ -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"] }
Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions frameworks/Rust/ntex/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"notes": "",
"versus": ""
},
"compio": {
"neon": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
Expand All @@ -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,
Expand All @@ -51,7 +51,7 @@
"webserver": "ntex",
"os": "Linux",
"database_os": "Linux",
"display_name": "ntex [neon]",
"display_name": "ntex [neon(io-uring)]",
"notes": "",
"versus": ""
},
Expand All @@ -75,7 +75,7 @@
"notes": "",
"versus": ""
},
"db-compio": {
"db-neon": {
"fortune_url": "/fortunes",
"db_url": "/db",
"query_url": "/query?q=",
Expand All @@ -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=",
Expand All @@ -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": ""
},
Expand All @@ -133,7 +133,7 @@
"notes": "",
"versus": ""
},
"plt-compio": {
"plt-neon": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
Expand All @@ -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,
Expand All @@ -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": ""
}
Expand Down
41 changes: 41 additions & 0 deletions frameworks/Rust/ntex/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 = ""
16 changes: 16 additions & 0 deletions frameworks/Rust/ntex/ntex-db-neon-uring.dockerfile
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions frameworks/Rust/ntex/ntex-neon-uring.dockerfile
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions frameworks/Rust/ntex/ntex-plt-neon-uring.dockerfile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion frameworks/Rust/ntex/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
}
Loading