sum: read ahead for perf for 1st run

This commit is contained in:
oech3
2026-06-03 09:39:36 +02:00
committed by Daniel Hofstetter
parent c5ee3852fd
commit 9da057e558
3 changed files with 4 additions and 0 deletions
Generated
+1
View File
@@ -4185,6 +4185,7 @@ version = "0.9.0"
dependencies = [
"clap",
"fluent",
"rustix",
"uucore",
]
+1
View File
@@ -21,6 +21,7 @@ doctest = false
[dependencies]
clap = { workspace = true }
rustix = { workspace = true }
uucore = { workspace = true }
fluent = { workspace = true }
+2
View File
@@ -89,6 +89,8 @@ fn open(name: &OsString) -> UResult<Box<dyn Read>> {
));
}
let f = File::open(path).map_err_context(String::new)?;
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
let _ = rustix::fs::fadvise(&f, 0, None, rustix::fs::Advice::Sequential);
Ok(Box::new(f) as Box<dyn Read>)
}
}