deno/bench_util
denobot 4c1cdfc9a4
2.5.1 (#30753)
Bumped versions for 2.5.1

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-09-17 01:58:00 +02:00
..
benches chore: update to edition 2024 (#29923) 2025-07-02 17:59:39 -07:00
Cargo.toml 2.5.1 (#30753) 2025-09-17 01:58:00 +02:00
js_runtime.rs chore: update to edition 2024 (#29923) 2025-07-02 17:59:39 -07:00
lib.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
profiling.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
README.md chore(bench): add missing commas in Extension struct literal (#30206) 2025-07-25 20:39:48 +00:00

Benching utility for deno_core op system

Example:

use deno_bench_util::bench_js_sync;
use deno_bench_util::bench_or_profile;
use deno_bench_util::bencher::Bencher;
use deno_bench_util::bencher::benchmark_group;
use deno_core::Extension;

#[op2]
#[number]
fn op_nop() -> usize {
  9
}

fn setup() -> Vec<Extension> {
  vec![Extension {
    name: "my_ext",
    ops: std::borrow::Cow::Borrowed(&[op_nop::DECL]),
  }]
}

fn bench_op_nop(b: &mut Bencher) {
  bench_js_sync(b, r#"Deno.core.ops.op_nop();"#, setup);
}

benchmark_group!(benches, bench_op_nop);
bench_or_profile!(benches);