Compare commits
3 Commits
fix/m23-si
...
97a2c6a925
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97a2c6a925 | ||
|
|
e6e0e2cc90 | ||
|
|
ffaf462bae |
@@ -101,11 +101,15 @@ fn bench_scroll_rss<B: FileReaderBackend>(
|
|||||||
let sample_interval = 100_000;
|
let sample_interval = 100_000;
|
||||||
let max_lines = if config.quick_mode { 100_000 } else { total };
|
let max_lines = if config.quick_mode { 100_000 } else { total };
|
||||||
|
|
||||||
|
let upper = max_lines.min(total);
|
||||||
let mut rss_samples = Vec::new();
|
let mut rss_samples = Vec::new();
|
||||||
let mut hwm_samples = Vec::new();
|
let mut hwm_samples = Vec::new();
|
||||||
|
let mut lines_read = 0usize;
|
||||||
|
|
||||||
for i in (0..max_lines).step_by(sample_interval) {
|
for i in (0..upper).step_by(sample_interval) {
|
||||||
let _ = reader.get_line(i);
|
if reader.get_line(i).is_some() {
|
||||||
|
lines_read += 1;
|
||||||
|
}
|
||||||
let rss = MetricsCollector::read_rss();
|
let rss = MetricsCollector::read_rss();
|
||||||
rss_samples.push(rss.vm_rss_kb);
|
rss_samples.push(rss.vm_rss_kb);
|
||||||
hwm_samples.push(rss.vm_hwm_kb);
|
hwm_samples.push(rss.vm_hwm_kb);
|
||||||
@@ -124,7 +128,7 @@ fn bench_scroll_rss<B: FileReaderBackend>(
|
|||||||
"max_hwm_kb".into(),
|
"max_hwm_kb".into(),
|
||||||
hwm_samples.iter().copied().fold(0u64, u64::max) as f64,
|
hwm_samples.iter().copied().fold(0u64, u64::max) as f64,
|
||||||
);
|
);
|
||||||
extra.insert("lines_read".into(), max_lines.min(total) as f64);
|
extra.insert("lines_read".into(), lines_read as f64);
|
||||||
|
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ fn bench_truncate_safety_mmap(
|
|||||||
dir: &std::path::Path,
|
dir: &std::path::Path,
|
||||||
) -> Vec<BenchmarkResult> {
|
) -> Vec<BenchmarkResult> {
|
||||||
let sub_dir = dir.join("trunc_mmap");
|
let sub_dir = dir.join("trunc_mmap");
|
||||||
let path = data_gen::generate_growable_file(&sub_dir).expect("Failed to create file");
|
|
||||||
let iterations: usize = if _config.quick_mode { 3 } else { 10 };
|
let iterations: usize = if _config.quick_mode { 3 } else { 10 };
|
||||||
|
|
||||||
let mut latencies = Vec::with_capacity(iterations);
|
let mut latencies = Vec::with_capacity(iterations);
|
||||||
let mut sigbus_detected = 0usize;
|
let mut sigbus_detected = 0usize;
|
||||||
|
|
||||||
for _ in 0..iterations {
|
for _ in 0..iterations {
|
||||||
|
let path = data_gen::generate_growable_file(&sub_dir).expect("Failed to create file");
|
||||||
|
|
||||||
mmap_reader::reset_sigbus_flag();
|
mmap_reader::reset_sigbus_flag();
|
||||||
|
|
||||||
let reader = MmapReaderPlain::open(&path).expect("Failed to open file");
|
let reader = MmapReaderPlain::open(&path).expect("Failed to open file");
|
||||||
@@ -48,12 +49,6 @@ fn bench_truncate_safety_mmap(
|
|||||||
sigbus_detected += 1;
|
sigbus_detected += 1;
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
let mut f = std::fs::File::create(&path).expect("Failed to recreate file");
|
|
||||||
use std::io::Write;
|
|
||||||
for i in 0..1000u64 {
|
|
||||||
writeln!(f, "restored line {i}").unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let rss = MetricsCollector::read_rss();
|
let rss = MetricsCollector::read_rss();
|
||||||
@@ -82,13 +77,14 @@ fn bench_truncate_safety_pread(
|
|||||||
dir: &std::path::Path,
|
dir: &std::path::Path,
|
||||||
) -> Vec<BenchmarkResult> {
|
) -> Vec<BenchmarkResult> {
|
||||||
let sub_dir = dir.join("trunc_pread");
|
let sub_dir = dir.join("trunc_pread");
|
||||||
let path = data_gen::generate_growable_file(&sub_dir).expect("Failed to create file");
|
|
||||||
let iterations: usize = if _config.quick_mode { 3 } else { 10 };
|
let iterations: usize = if _config.quick_mode { 3 } else { 10 };
|
||||||
|
|
||||||
let mut latencies = Vec::with_capacity(iterations);
|
let mut latencies = Vec::with_capacity(iterations);
|
||||||
let mut error_count = 0usize;
|
let mut error_count = 0usize;
|
||||||
|
|
||||||
for _ in 0..iterations {
|
for _ in 0..iterations {
|
||||||
|
let path = data_gen::generate_growable_file(&sub_dir).expect("Failed to create file");
|
||||||
|
|
||||||
let reader = PreadReaderPlain::open(&path).expect("Failed to open file");
|
let reader = PreadReaderPlain::open(&path).expect("Failed to open file");
|
||||||
let original_size = reader.file_size();
|
let original_size = reader.file_size();
|
||||||
|
|
||||||
@@ -104,12 +100,6 @@ fn bench_truncate_safety_pread(
|
|||||||
error_count += 1;
|
error_count += 1;
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
let mut f = std::fs::File::create(&path).expect("Failed to recreate file");
|
|
||||||
use std::io::Write;
|
|
||||||
for i in 0..1000u64 {
|
|
||||||
writeln!(f, "restored line {i}").unwrap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let rss = MetricsCollector::read_rss();
|
let rss = MetricsCollector::read_rss();
|
||||||
|
|||||||
Reference in New Issue
Block a user