deno/bench_util
denobot ddebcc01d9
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
2.5.0 (#30673)
Bumped versions for 2.5.0

Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2025-09-10 09:17:46 +05:30
..
benches chore: update to edition 2024 (#29923) 2025-07-02 17:59:39 -07:00
Cargo.toml 2.5.0 (#30673) 2025-09-10 09:17:46 +05:30
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);