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
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,14 @@ opt-level = 's'
[profile.dev.package.tokio]
overflow-checks = false

# Some CI jobs (e.g. QEMU) build everything in the `dev` profile with
# optimizations via `CARGO_PROFILE_DEV_OPT_LEVEL`. That's not worth it for this
# crate though: its `tests/all` binary is huge and expensive to optimize but is
# mostly glue around the (still optimized) runtime. This is a no-op by default
# since `dev` is already unoptimized.
[profile.dev.package.wasmtime-cli]
opt-level = 0

[profile.profiling]
inherits = "bench"
debug = "line-tables-only"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ struct Component;
test_programs::p3::export!(Component);

fn bytes(offset: &mut usize, len: usize) -> Vec<u8> {
const PATTERN_LEN: usize = 251;
let pattern: [u8; PATTERN_LEN] = core::array::from_fn(|i| i as u8);
let mut buf = Vec::with_capacity(len);
for i in 0..len {
buf.push(((*offset + i) % 251) as u8);
let mut start = *offset % PATTERN_LEN;
while buf.len() < len {
let n = (PATTERN_LEN - start).min(len - buf.len());
buf.extend_from_slice(&pattern[start..][..n]);
start = 0;
}
*offset += len;
buf
Expand Down
Loading