Skip to content

switch from async to rayon [v3] #2173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/v3
Choose a base branch
from
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
404 changes: 1 addition & 403 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions testing/conformance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ cid = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
lazy_static = "1.5.0"
log = "0.4.27"
futures = "0.3.31"
async-std = { version = "1.13", features = ["attributes"] }
wasmtime = { workspace = true }
base64 = "0.22.1"
flate2 = { version = "1.1" }
Expand All @@ -44,7 +42,8 @@ m2-native = []

[dev-dependencies]
env_logger = "0.11.8"
criterion = { version = "0.5", features = ["async_std"] }
criterion = { version = "0.5" }
rayon = "1.10.0"

[[bin]]
name = "perf-conformance"
Expand Down
2 changes: 1 addition & 1 deletion testing/conformance/benches/bench_drivers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn bench_vector_file(
name: &str,
engines: &MultiEngine,
) -> anyhow::Result<()> {
let (bs, _) = async_std::task::block_on(vector.seed_blockstore()).unwrap();
let (bs, _) = vector.seed_blockstore().unwrap();

for variant in vector.preconditions.variants.iter() {
let name = format!("{} | {}", name, variant.id);
Expand Down
6 changes: 1 addition & 5 deletions testing/conformance/src/actors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021-2023 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT
use std::io::Read;
use std::sync::Mutex;

use fvm_ipld_blockstore::{Blockstore, MemoryBlockstore};
Expand All @@ -20,10 +19,7 @@ fn load_bundles(bundles: &[&[u8]]) -> anyhow::Result<MemoryBlockstore> {
for bundle in bundles {
let mut reader = tar::Archive::new(zstd::Decoder::with_buffer(*bundle)?);
for entry in reader.entries()? {
// We need to read it to a vec first as we can't send it between threads (async issues).
let mut car = Vec::new();
entry?.read_to_end(&mut car)?;
load_car(&bs, &*car)?;
load_car(&bs, entry?)?;
}
}
Ok(bs)
Expand Down
2 changes: 1 addition & 1 deletion testing/conformance/src/bin/perf-conformance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() {
)
.expect("failed to construct engine");

let (bs, _) = async_std::task::block_on(vector.seed_blockstore()).unwrap();
let (bs, _) = vector.seed_blockstore().unwrap();
for variant in vector.preconditions.variants.iter() {
run_variant_for_perf(bs.clone(), &vector, variant, &engine, itt_info)
}
Expand Down
6 changes: 6 additions & 0 deletions testing/conformance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ macro_rules! report {
($status:expr, $path:expr, $id:expr) => {
println!("[{}] vector: {} | variant: {}", $status, $path, $id);
};
($status:expr, $path:expr, $id:expr, $reason:expr) => {
println!(
"[{}] vector: {} | variant: {}\n\t|> reason: {:#}",
$status, $path, $id, $reason
);
};
}
2 changes: 1 addition & 1 deletion testing/conformance/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl MessageVector {
impl MessageVector {
/// Seeds a new blockstore with the CAR encoded in the test vector and all available bundled
/// actors. Returns the blockstore and the root CID.
pub async fn seed_blockstore(&self) -> anyhow::Result<(MemoryBlockstore, Vec<Cid>)> {
pub fn seed_blockstore(&self) -> anyhow::Result<(MemoryBlockstore, Vec<Cid>)> {
let blockstore = MemoryBlockstore::new();
load_actors(&blockstore)?;

Expand Down
Loading
Loading