Skip to content

Commit e200243

Browse files
committed
Drop heuristic approach for now
1 parent 09b30be commit e200243

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/main.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ enum Strategy {
4141
MemZero,
4242
Madvise,
4343
PagemapScan,
44-
Heuristic,
4544
}
4645

4746
#[derive(Debug)]
@@ -137,7 +136,6 @@ fn main() -> anyhow::Result<()> {
137136
run_benchmark_memset(&bench_args),
138137
run_benchmark_madvise(&bench_args),
139138
run_benchmark_pagemap_scan(&bench_args),
140-
run_benchmark_heuristic(&bench_args),
141139
]
142140
})
143141
.flatten()
@@ -150,7 +148,6 @@ fn main() -> anyhow::Result<()> {
150148
run_benchmark_memset(&bench_args),
151149
run_benchmark_madvise(&bench_args),
152150
run_benchmark_pagemap_scan(&bench_args),
153-
run_benchmark_heuristic(&bench_args),
154151
]
155152
})
156153
.flatten()
@@ -298,27 +295,3 @@ fn run_benchmark_pagemap_scan(args: &BenchArgs) -> anyhow::Result<BenchResult> {
298295
processes,
299296
})
300297
}
301-
302-
fn run_benchmark_heuristic(args: &BenchArgs) -> anyhow::Result<BenchResult> {
303-
let BenchArgs {
304-
total_size, quiet, ..
305-
}: BenchArgs = *args;
306-
qprintln!(
307-
quiet,
308-
"Scenario 4: Try to do the fastest thing using heuristics"
309-
);
310-
311-
let mut bench_result = if total_size <= 128 * 1024 {
312-
// for small regions, avoid the syscall
313-
run_benchmark_memset(args)?
314-
} else if total_size >= 1 * 1024 * 1024 {
315-
// for large regions, use madvise so we don't keep
316-
// tons of memory resident
317-
run_benchmark_madvise(args)?
318-
} else {
319-
run_benchmark_pagemap_scan(args)?
320-
};
321-
322-
bench_result.strategy = Strategy::Heuristic;
323-
Ok(bench_result)
324-
}

0 commit comments

Comments
 (0)