Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyg committed Dec 13, 2024
1 parent ebf5161 commit 776ea03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
24 changes: 16 additions & 8 deletions test/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ use wasmer::Store;
pub fn wasm_module_compile(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_module_compile");

for wasm in [TestWasm::Empty,
for wasm in [
TestWasm::Empty,
TestWasm::Io,
TestWasm::Test,
TestWasm::Memory] {
TestWasm::Memory,
] {
group.bench_function(BenchmarkId::new("wasm_module_compile", wasm.name()), |b| {
b.iter(|| {
Module::from_binary(&Store::default(), wasm.bytes()).unwrap();
Expand All @@ -29,10 +31,12 @@ pub fn wasm_module_compile(c: &mut Criterion) {
pub fn wasm_module_deserialize_from_file(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_module_deserialize_from_file");

for wasm in [TestWasm::Empty,
for wasm in [
TestWasm::Empty,
TestWasm::Io,
TestWasm::Test,
TestWasm::Memory] {
TestWasm::Memory,
] {
let tmpdir = TempDir::new().unwrap();
let path = tmpdir.path().join(wasm.name());
let module = Module::from_binary(&Store::default(), wasm.bytes()).unwrap();
Expand All @@ -52,10 +56,12 @@ pub fn wasm_module_deserialize_from_file(c: &mut Criterion) {
pub fn wasm_module(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_module");

for wasm in [TestWasm::Empty,
for wasm in [
TestWasm::Empty,
TestWasm::Io,
TestWasm::Test,
TestWasm::Memory] {
TestWasm::Memory,
] {
group.bench_function(BenchmarkId::new("wasm_module", wasm.name()), |b| {
b.iter(|| {
wasm.module(false);
Expand All @@ -70,10 +76,12 @@ pub fn wasm_module(c: &mut Criterion) {
pub fn wasm_instance(c: &mut Criterion) {
let mut group = c.benchmark_group("wasm_instance");

for wasm in [TestWasm::Empty,
for wasm in [
TestWasm::Empty,
TestWasm::Io,
TestWasm::Test,
TestWasm::Memory] {
TestWasm::Memory,
] {
group.bench_function(BenchmarkId::new("wasm_instance", wasm.name()), |b| {
b.iter(|| {
let _drop = wasm.unmetered_instance();
Expand Down
4 changes: 2 additions & 2 deletions test/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ pub mod tests {
fn process_string_test() {
// use a "crazy" string that is much longer than a single wasm page to show that pagination
// and utf-8 are both working OK
let starter_string = "╰▐ ✖ 〜 ✖ ▐╯"
.repeat(usize::try_from(10_u32 * u32::from(u16::MAX)).unwrap());
let starter_string =
"╰▐ ✖ 〜 ✖ ▐╯".repeat(usize::try_from(10_u32 * u32::from(u16::MAX)).unwrap());
let InstanceWithStore { store, instance } = TestWasm::Test.instance();
let result: StringType = guest::call(
&mut store.lock().as_store_mut(),
Expand Down

0 comments on commit 776ea03

Please sign in to comment.