Skip to content

Instantly share code, notes, and snippets.

@sdleffler
Created May 29, 2017 00:29
Show Gist options
  • Save sdleffler/00c3c9a20bcb37c31896fd4b166bcdef to your computer and use it in GitHub Desktop.
Save sdleffler/00c3c9a20bcb37c31896fd4b166bcdef to your computer and use it in GitHub Desktop.
#[bench]
fn push_front_arenaalloc_strict_10(b: &mut Bencher) {
let elements = Arena::new();
let branches = Arena::new();
let trees = Arena::new();
let alloc = StrictArena {
elements: &elements,
branches: &branches,
trees: &trees,
};
b.iter(|| {
test::black_box((0..10).fold(StrictArenaTree::<i32>::with_allocator(alloc), |acc, i| acc.push_front(i)));
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment