Skip to content

Commit f2d73e8

Browse files
committed
fix: gc bench
1 parent 3b6c97e commit f2d73e8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

immix/benches/immix_bench.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use libc::malloc;
66
use rand::random;
77

88
fn immix_benchmark_multi_thread(c: &mut Criterion) {
9+
gc_disable_auto_collect();
10+
set_evacuation(false);
911
bench_n_threads(get_threads())(c);
1012
}
1113

@@ -27,6 +29,8 @@ fn bench_n_threads(n: usize) -> impl Fn(&mut Criterion) {
2729
}
2830

2931
fn immix_benchmark_single_thread(c: &mut Criterion) {
32+
gc_disable_auto_collect();
33+
set_evacuation(false);
3034
c.bench_function(
3135
&format!("singlethread gc benchmark--{} small objects", OBJ_NUM),
3236
|b| {
@@ -39,6 +43,8 @@ fn immix_benchmark_single_thread(c: &mut Criterion) {
3943
}
4044

4145
fn immix_benchmark_single_thread_mark(c: &mut Criterion) {
46+
gc_disable_auto_collect();
47+
set_evacuation(false);
4248
c.bench_function(
4349
&format!("singlethread gc mark benchmark--{} small objects", OBJ_NUM),
4450
|b| {
@@ -50,6 +56,8 @@ fn immix_benchmark_single_thread_mark(c: &mut Criterion) {
5056
);
5157
}
5258
fn immix_benchmark_single_thread_sweep(c: &mut Criterion) {
59+
gc_disable_auto_collect();
60+
set_evacuation(false);
5361
c.bench_function(
5462
&format!("singlethread gc sweep benchmark--{} small objects", OBJ_NUM),
5563
|b| {
@@ -62,6 +70,8 @@ fn immix_benchmark_single_thread_sweep(c: &mut Criterion) {
6270
}
6371

6472
fn immix_benchmark_single_thread_alloc(c: &mut Criterion) {
73+
gc_disable_auto_collect();
74+
set_evacuation(false);
6575
let mut g = c.benchmark_group("allocation bench");
6676
if option_env!("PL_IMMIX_HEAP_SIZE").is_none() {
6777
return;

0 commit comments

Comments
 (0)