mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 19:15:46 +00:00
d5f5648b37
We use cargo vendor to generate a .cargo/config file and the vendor directory. Vendoring allows us to lock our dependencies and to modify them easily from the top level Cargo.toml. We vendor all dependencies, including the crates.io ones, which allows for network isolated builds. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
19 lines
383 B
Rust
19 lines
383 B
Rust
#![feature(test)]
|
|
extern crate test;
|
|
extern crate rand_jitter;
|
|
|
|
use test::Bencher;
|
|
use rand_jitter::rand_core::RngCore;
|
|
|
|
#[bench]
|
|
fn bench_add_two(b: &mut Bencher) {
|
|
let mut rng = rand_jitter::JitterRng::new().unwrap();
|
|
let mut buf = [0u8; 1024];
|
|
b.iter(|| {
|
|
rng.fill_bytes(&mut buf[..]);
|
|
test::black_box(&buf);
|
|
});
|
|
b.bytes = buf.len() as u64;
|
|
}
|
|
|