use std::rc::Rc; use brunch::Bench; use ref_arena::{RcRef, RefArena}; fn seed_rc() -> Vec> { let mut v = Vec::new(); for i in 0..10_000 { v.push(Rc::new(i)); } v } fn seed_arena() -> (RefArena, Vec>) { let mut arena = RefArena::new(); let mut v = Vec::new(); for i in 0..10_000 { v.push(arena.insert(i)); } (arena, v) } brunch::benches! { Bench::new("std::rc::Rc drop 10_000") .run_seeded_with(seed_rc, |v| { drop(v) }), Bench::new("RefArena drop 10_000") .run_seeded_with(seed_arena, |(arena, v)| { drop((arena, v)) }) }