Skip to content

Commit 4580dcc

Browse files
authored
remove wasm bench (#10154)
1 parent b5b7ff5 commit 4580dcc

14 files changed

+350
-445
lines changed

frameworks/Rust/xitca-web/Cargo.lock

Lines changed: 317 additions & 302 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/Rust/xitca-web/Cargo.toml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ name = "xitca-web-unrealistic"
1313
path = "./src/main_unrealistic.rs"
1414
required-features = ["perf", "pg", "template"]
1515

16-
[[bin]]
17-
name = "xitca-web-wasm"
18-
path = "./src/main_wasm.rs"
19-
required-features = ["web"]
20-
2116
[[bin]]
2217
name = "xitca-web-orm"
2318
path = "./src/main_orm.rs"
@@ -70,24 +65,22 @@ xitca-postgres = { version = "0.3", optional = true }
7065
diesel = { version = "2", features = ["postgres"], optional = true }
7166

7267
# orm async optional
73-
diesel-async = { version = "0.5", features = ["bb8", "postgres"], optional = true }
74-
xitca-postgres-diesel = { version = "0.1", optional = true }
68+
diesel-async = { version = "0.7", features = ["bb8", "postgres"], optional = true }
69+
xitca-postgres-diesel = { version = "0.2", optional = true }
7570
futures-util = { version = "0.3", default-features = false, optional = true }
7671

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

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

8378
# perf optional
8479
core_affinity = { version = "0.8.1", optional = true }
8580
mimalloc = { version = "0.1", default-features = false, optional = true }
86-
simd-json = { version = "0.14", optional = true }
87-
simd-json-derive = { version = "0.15", default-features = false, optional = true }
81+
simd-json = { version = "0.17", optional = true }
82+
simd-json-derive = { version = "0.18", default-features = false, optional = true }
8883

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

10194
[patch.crates-io]
102-
xitca-postgres-diesel = { git = "https://github.com/fakeshadow/xitca-postgres-diesel", rev = "ae93ee9" }
103-
104-
diesel-async = { git = "https://github.com/weiznich/diesel_async", rev = "5b8262b" }
105-
mio = { git = "https://github.com/fakeshadow/mio", rev = "9bae6012b7ecfc6083350785f71a5e8265358178" }
106-
107-
xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
108-
xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
109-
xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
110-
xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
111-
xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
112-
xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "915b14d" }
95+
xitca-postgres-diesel = { git = "https://github.com/fakeshadow/xitca-postgres-diesel", rev = "8ce4e5b" }
96+
97+
xitca-codegen = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
98+
xitca-http = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
99+
xitca-postgres = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
100+
xitca-server = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
101+
xitca-service = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }
102+
xitca-web = { git = "http://github.com/HFQR/xitca-web", rev = "7c22b4a" }

frameworks/Rust/xitca-web/benchmark_config.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,6 @@
4646
"notes": "",
4747
"versus": ""
4848
},
49-
"wasm": {
50-
"json_url": "/json",
51-
"plaintext_url": "/plaintext",
52-
"port": 8080,
53-
"approach": "Realistic",
54-
"classification": "Micro",
55-
"database": "none",
56-
"framework": "xitca-web",
57-
"language": "rust",
58-
"orm": "raw",
59-
"platform": "none",
60-
"webserver": "xitca-server",
61-
"os": "linux",
62-
"database_os": "linux",
63-
"display_name": "xitca-web [wasm]",
64-
"notes": "",
65-
"versus": ""
66-
},
6749
"orm": {
6850
"json_url": "/json",
6951
"plaintext_url": "/plaintext",

frameworks/Rust/xitca-web/config.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,3 @@ orm = "Raw"
4747
platform = "None"
4848
webserver = "xitca-server"
4949
versus = ""
50-
51-
[wasm]
52-
urls.json = "/json"
53-
urls.plaintext = "/plaintext"
54-
approach = "Realistic"
55-
classification = "Micro"
56-
os = "wasi"
57-
platform = "wasm"
58-
webserver = "xitca-server"
59-
versus = ""

frameworks/Rust/xitca-web/src/db_unrealistic.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ impl Client {
7272
let mut worlds = Vec::with_capacity(len);
7373

7474
while let Some(mut item) = res.try_next().await? {
75-
let row = item.try_next().await?.ok_or_else(not_found)?;
76-
worlds.push(World::new(row.get(0), row.get(1)));
75+
while let Some(row) = item.try_next().await? {
76+
worlds.push(World::new(row.get(0), row.get(1)));
77+
}
7778
}
7879

7980
Ok(worlds)

frameworks/Rust/xitca-web/src/db_util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ pub mod pg {
6464
.into_boxed_str()
6565
}
6666

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

71+
#[derive(Clone)]
7172
struct ParamIter<I>(I);
7273

7374
impl<I> Iterator for ParamIter<I>

frameworks/Rust/xitca-web/src/main_unrealistic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn main() -> io::Result<()> {
4141

4242
tokio::runtime::Builder::new_current_thread()
4343
.enable_all()
44-
.build_local(&Default::default())
44+
.build_local(Default::default())
4545
.unwrap()
4646
.block_on(async {
4747
let socket = tokio::net::TcpSocket::new_v4()?;

frameworks/Rust/xitca-web/src/main_wasm.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

frameworks/Rust/xitca-web/src/util.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,19 @@ impl<DB> State<DB> {
4545
}
4646
}
4747

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

52-
pub struct Rand(SmallRng);
50+
pub struct Rand(SmallRng);
5351

54-
impl Default for Rand {
55-
fn default() -> Self {
56-
Self(SmallRng::from_os_rng())
57-
}
52+
impl Default for Rand {
53+
fn default() -> Self {
54+
Self(SmallRng::from_os_rng())
5855
}
56+
}
5957

60-
impl Rand {
61-
#[inline]
62-
pub fn gen_id(&mut self) -> i32 {
63-
self.0.random_range(1..=10000)
64-
}
58+
impl Rand {
59+
#[inline]
60+
pub fn gen_id(&mut self) -> i32 {
61+
self.0.random_range(1..=10000)
6562
}
6663
}
67-
68-
#[cfg(not(target_arch = "wasm32"))]
69-
pub use non_wasm::*;

frameworks/Rust/xitca-web/xitca-web-orm.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.85
1+
FROM rust:1.90
22

33
ADD ./ /xitca-web
44
WORKDIR /xitca-web

0 commit comments

Comments
 (0)