Skip to content

Commit 2805a05

Browse files
committed
Add bench_typed_arena_clear_100 bench
1 parent daccd17 commit 2805a05

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler/rustc_arena/src/tests.rs

+11
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ pub fn bench_typed_arena_clear(b: &mut Bencher) {
121121
})
122122
}
123123

124+
#[bench]
125+
pub fn bench_typed_arena_clear_100(b: &mut Bencher) {
126+
let mut arena = TypedArena::default();
127+
b.iter(|| {
128+
for _ in 0..100 {
129+
arena.alloc(Point { x: 1, y: 2, z: 3 });
130+
}
131+
arena.clear();
132+
})
133+
}
134+
124135
// Drop tests
125136

126137
struct DropCounter<'a> {

0 commit comments

Comments
 (0)