Skip to content

Commit

Permalink
Add push and pop benches (FuelLabs#1490)
Browse files Browse the repository at this point in the history
FuelLabs#1446

```
poph/poph               time:   [72.373 ns 72.690 ns 73.018 ns]
popl/popl               time:   [66.444 ns 66.724 ns 67.006 ns]
pshh/pshh               time:   [76.584 ns 76.862 ns 77.133 ns]
pshl/pshl               time:   [80.093 ns 80.410 ns 80.774 ns]
```
  • Loading branch information
MitchTurner authored Nov 16, 2023
1 parent 2a3b385 commit df6a206
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Description of the upcoming release here.

### Added

- [#1490](https://github.com/FuelLabs/fuel-core/pull/1490): Add push and pop benchmarks.
- [#1485](https://github.com/FuelLabs/fuel-core/pull/1485): Prepare rc release of fuel core v0.21
- [#1476](https://github.com/FuelLabs/fuel-core/pull/1453): Add the majority of the "other" benchmarks for contract opcodes.
- [#1453](https://github.com/FuelLabs/fuel-core/pull/1453): Add the majority of the "sanity" benchmarks for contract opcodes.
Expand Down
32 changes: 32 additions & 0 deletions benches/benches/vm_set/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,36 @@ pub fn run(c: &mut Criterion) {
);
}
mem_meq.finish();

let full_mask = (1 << 24) - 1;

// poph
let prepare_script = vec![op::pshh(full_mask)];
run_group_ref(
&mut c.benchmark_group("poph"),
"poph",
VmBench::new(op::poph(full_mask)).with_prepare_script(prepare_script),
);

// popl
let prepare_script = vec![op::pshl(full_mask)];
run_group_ref(
&mut c.benchmark_group("popl"),
"popl",
VmBench::new(op::popl(full_mask)).with_prepare_script(prepare_script),
);

// pshh
run_group_ref(
&mut c.benchmark_group("pshh"),
"pshh",
VmBench::new(op::pshh(full_mask)),
);

// pshl
run_group_ref(
&mut c.benchmark_group("pshl"),
"pshl",
VmBench::new(op::pshl(full_mask)),
);
}

0 comments on commit df6a206

Please sign in to comment.