bench larger allocations
This commit is contained in:
parent
fd16202e36
commit
e1151844fa
@ -504,10 +504,10 @@ fn bench_in_place_recycle(b: &mut test::Bencher) {
|
||||
|
||||
#[bench]
|
||||
fn bench_in_place_zip_recycle(b: &mut test::Bencher) {
|
||||
let mut data = vec![0u8; 256];
|
||||
let mut data = vec![0u8; 1000];
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut subst = (0..=255u8).collect::<Vec<_>>();
|
||||
subst.shuffle(&mut rng);
|
||||
let mut subst = vec![0u8; 1000];
|
||||
rng.fill_bytes(&mut subst[..]);
|
||||
|
||||
b.iter(|| {
|
||||
let tmp = std::mem::replace(&mut data, Vec::new());
|
||||
@ -517,7 +517,7 @@ fn bench_in_place_zip_recycle(b: &mut test::Bencher) {
|
||||
.enumerate()
|
||||
.map(|(i, (d, s))| d.wrapping_add(i as u8) ^ s)
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(mangled.len(), 256);
|
||||
assert_eq!(mangled.len(), 1000);
|
||||
std::mem::replace(&mut data, black_box(mangled));
|
||||
});
|
||||
}
|
||||
@ -526,8 +526,8 @@ fn bench_in_place_zip_recycle(b: &mut test::Bencher) {
|
||||
fn bench_in_place_zip_iter_mut(b: &mut test::Bencher) {
|
||||
let mut data = vec![0u8; 256];
|
||||
let mut rng = rand::thread_rng();
|
||||
let mut subst = (0..=255u8).collect::<Vec<_>>();
|
||||
subst.shuffle(&mut rng);
|
||||
let mut subst = vec![0u8; 1000];
|
||||
rng.fill_bytes(&mut subst[..]);
|
||||
|
||||
b.iter(|| {
|
||||
data.iter_mut().enumerate().for_each(|(i, d)| {
|
||||
|
Loading…
Reference in New Issue
Block a user