Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add bench_typed_arena_clear_100 bench
  • Loading branch information
est31 committed Sep 18, 2020
1 parent daccd17 commit 2805a05
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions compiler/rustc_arena/src/tests.rs
Expand Up @@ -121,6 +121,17 @@ pub fn bench_typed_arena_clear(b: &mut Bencher) {
})
}

#[bench]
pub fn bench_typed_arena_clear_100(b: &mut Bencher) {
let mut arena = TypedArena::default();
b.iter(|| {
for _ in 0..100 {
arena.alloc(Point { x: 1, y: 2, z: 3 });
}
arena.clear();
})
}

// Drop tests

struct DropCounter<'a> {
Expand Down

0 comments on commit 2805a05

Please sign in to comment.