Skip to content
Open
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
619 changes: 317 additions & 302 deletions frameworks/Rust/xitca-web/Cargo.lock

Large diffs are not rendered by default.

36 changes: 13 additions & 23 deletions frameworks/Rust/xitca-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ name = "xitca-web-unrealistic"
path = "./src/main_unrealistic.rs"
required-features = ["perf", "pg", "template"]

[[bin]]
name = "xitca-web-wasm"
path = "./src/main_wasm.rs"
required-features = ["web"]

[[bin]]
name = "xitca-web-orm"
path = "./src/main_orm.rs"
Expand Down Expand Up @@ -70,24 +65,22 @@ xitca-postgres = { version = "0.3", optional = true }
diesel = { version = "2", features = ["postgres"], optional = true }

# orm async optional
diesel-async = { version = "0.5", features = ["bb8", "postgres"], optional = true }
xitca-postgres-diesel = { version = "0.1", optional = true }
diesel-async = { version = "0.7", features = ["bb8", "postgres"], optional = true }
xitca-postgres-diesel = { version = "0.2", optional = true }
futures-util = { version = "0.3", default-features = false, optional = true }

# template optional
sailfish = { version = "0.9", default-features = false, features = ["perf-inline"], optional = true }
sailfish = { version = "0.10", default-features = false, features = ["perf-inline"], optional = true }

# io-uring optional
tokio-uring = { version = "0.5", optional = true }

# perf optional
core_affinity = { version = "0.8.1", optional = true }
mimalloc = { version = "0.1", default-features = false, optional = true }
simd-json = { version = "0.14", optional = true }
simd-json-derive = { version = "0.15", default-features = false, optional = true }
simd-json = { version = "0.17", optional = true }
simd-json-derive = { version = "0.18", default-features = false, optional = true }

# stuff can not be used or not needed in wasi target
[target.'cfg(not(target_family = "wasm"))'.dependencies]
futures-core = { version = "0.3", default-features = false }
rand = { version = "0.9", features = ["os_rng", "small_rng"], default-features = false }
tokio = "1.41"
Expand All @@ -99,14 +92,11 @@ codegen-units = 1
panic = "abort"

[patch.crates-io]
xitca-postgres-diesel = { git = "https://github.com/fakeshadow/xitca-postgres-diesel", rev = "ae93ee9" }

diesel-async = { git = "https://github.com/weiznich/diesel_async", rev = "5b8262b" }
mio = { git = "https://github.com/fakeshadow/mio", rev = "9bae6012b7ecfc6083350785f71a5e8265358178" }

xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
xitca-postgres-diesel = { git = "https://github.com/fakeshadow/xitca-postgres-diesel", rev = "8ce4e5b" }

xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
18 changes: 0 additions & 18 deletions frameworks/Rust/xitca-web/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,6 @@
"notes": "",
"versus": ""
},
"wasm": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"database": "none",
"framework": "xitca-web",
"language": "rust",
"orm": "raw",
"platform": "none",
"webserver": "xitca-server",
"os": "linux",
"database_os": "linux",
"display_name": "xitca-web [wasm]",
"notes": "",
"versus": ""
},
"orm": {
"json_url": "/json",
"plaintext_url": "/plaintext",
Expand Down
10 changes: 0 additions & 10 deletions frameworks/Rust/xitca-web/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,3 @@ orm = "Raw"
platform = "None"
webserver = "xitca-server"
versus = ""

[wasm]
urls.json = "/json"
urls.plaintext = "/plaintext"
approach = "Realistic"
classification = "Micro"
os = "wasi"
platform = "wasm"
webserver = "xitca-server"
versus = ""
5 changes: 3 additions & 2 deletions frameworks/Rust/xitca-web/src/db_unrealistic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ impl Client {
let mut worlds = Vec::with_capacity(len);

while let Some(mut item) = res.try_next().await? {
let row = item.try_next().await?.ok_or_else(not_found)?;
worlds.push(World::new(row.get(0), row.get(1)));
while let Some(row) = item.try_next().await? {
worlds.push(World::new(row.get(0), row.get(1)));
}
}

Ok(worlds)
Expand Down
3 changes: 2 additions & 1 deletion frameworks/Rust/xitca-web/src/db_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ pub mod pg {
.into_boxed_str()
}

pub fn sort_update_params(params: &[[i32; 2]]) -> impl ExactSizeIterator<Item = i32> {
pub fn sort_update_params(params: &[[i32; 2]]) -> impl ExactSizeIterator<Item = i32> + Clone {
let mut params = params.to_owned();
params.sort_by(|a, b| a[0].cmp(&b[0]));

#[derive(Clone)]
struct ParamIter<I>(I);

impl<I> Iterator for ParamIter<I>
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/xitca-web/src/main_unrealistic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() -> io::Result<()> {

tokio::runtime::Builder::new_current_thread()
.enable_all()
.build_local(&Default::default())
.build_local(Default::default())
.unwrap()
.block_on(async {
let socket = tokio::net::TcpSocket::new_v4()?;
Expand Down
33 changes: 0 additions & 33 deletions frameworks/Rust/xitca-web/src/main_wasm.rs

This file was deleted.

26 changes: 10 additions & 16 deletions frameworks/Rust/xitca-web/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,19 @@ impl<DB> State<DB> {
}
}

#[cfg(not(target_arch = "wasm32"))]
pub mod non_wasm {
use rand::{Rng, SeedableRng, rngs::SmallRng};
use rand::{Rng, SeedableRng, rngs::SmallRng};

pub struct Rand(SmallRng);
pub struct Rand(SmallRng);

impl Default for Rand {
fn default() -> Self {
Self(SmallRng::from_os_rng())
}
impl Default for Rand {
fn default() -> Self {
Self(SmallRng::from_os_rng())
}
}

impl Rand {
#[inline]
pub fn gen_id(&mut self) -> i32 {
self.0.random_range(1..=10000)
}
impl Rand {
#[inline]
pub fn gen_id(&mut self) -> i32 {
self.0.random_range(1..=10000)
}
}

#[cfg(not(target_arch = "wasm32"))]
pub use non_wasm::*;
2 changes: 1 addition & 1 deletion frameworks/Rust/xitca-web/xitca-web-orm.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85
FROM rust:1.90

ADD ./ /xitca-web
WORKDIR /xitca-web
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/xitca-web/xitca-web-sync.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85
FROM rust:1.90

ADD ./ /xitca-web
WORKDIR /xitca-web
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Rust/xitca-web/xitca-web-unrealistic.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85
FROM rust:1.90

ADD ./ /xitca-web
WORKDIR /xitca-web
Expand Down
35 changes: 0 additions & 35 deletions frameworks/Rust/xitca-web/xitca-web-wasm.dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion frameworks/Rust/xitca-web/xitca-web.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85
FROM rust:1.90

ADD ./ /xitca-web
WORKDIR /xitca-web
Expand Down
Loading