Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

Speed comparison tests make missing test folders again

gelenmedyadd3cdcb4fc7d
diff --git a/crates/rf-app/src/bench.rs b/crates/rf-app/src/bench.rs
index 7cd9e3dc..736f4a97 100644
--- a/crates/rf-app/src/bench.rs
+++ b/crates/rf-app/src/bench.rs
@@ -249,6 +249,18 @@ fn make_copy_sources(root: &Path, report: &dyn Fn(f32)) -> std::io::Result<(Path
}
/// Writes the benchmark instance's settings: nothing that would stay running or reach out.
+/// The folder an open test lists (empty, files, pictures), made afresh.
+fn make_open_folder(dir: &Path, t: OpenTest, report: &dyn Fn(f32)) -> anyhow::Result<()> {
+ match t {
+ OpenTest::Start => std::fs::create_dir_all(dir)?,
+ OpenTest::Files1k => make_files(dir, 1_000, report)?,
+ OpenTest::Files10k => make_files(dir, 10_000, report)?,
+ OpenTest::Files100k => make_files(dir, 100_000, report)?,
+ OpenTest::Images => make_images(dir, 2_000, report)?,
+ }
+ Ok(())
+}
+
fn prepare_rustyfiles_settings() -> std::io::Result<()> {
let cfg = bench_dir().join("rustyfiles-settings");
std::fs::create_dir_all(&cfg)?;
@@ -425,13 +437,7 @@ pub fn run(plan: &Plan, progress: &dyn Fn(Progress), cancel: &AtomicBool) -> any
let dir = root.join(t.folder());
let label = t.folder().to_string();
let report = |f: f32| progress(Progress::Preparing(label.clone(), f));
- match t {
- OpenTest::Start => std::fs::create_dir_all(&dir)?,
- OpenTest::Files1k => make_files(&dir, 1_000, &report)?,
- OpenTest::Files10k => make_files(&dir, 10_000, &report)?,
- OpenTest::Files100k => make_files(&dir, 100_000, &report)?,
- OpenTest::Images => make_images(&dir, 2_000, &report)?,
- }
+ make_open_folder(&dir, *t, &report)?;
if cancel.load(Ordering::Relaxed) {
anyhow::bail!("cancelled");
}
@@ -753,7 +759,10 @@ directlook_enabled = false
let names = ["rustyfiles, from scratch", "rustyfiles, already running", "File Explorer", "Arke, from scratch", "Arke, already running"];
for t in folders {
let dir = super::bench_dir().join(t.folder());
- assert!(dir.is_dir(), "{} is missing: run the speed test once", dir.display());
+ // (Settings › Speed test removes its folders when it is done: they are made again here)
+ if !dir.is_dir() {
+ super::make_open_folder(&dir, t, &|_| {}).unwrap();
+ }
let mut runs: Vec<Vec<rf_win::bench::OpenResult>> = vec![Vec::new(); names.len()];
for round in 0..=super::RUNS {
for (k, app) in [&ours, &warm, &explorer, &arke, &arke].into_iter().enumerate() {
@@ -879,7 +888,10 @@ mod live_all {
let mut out = serde_json::Map::new();
for t in super::OpenTest::ALL {
let dir = super::bench_dir().join(t.folder());
- assert!(dir.is_dir(), "{} is missing: run the speed test once", dir.display());
+ // (Settings › Speed test removes its folders when it is done: they are made again here)
+ if !dir.is_dir() {
+ super::make_open_folder(&dir, t, &|_| {}).unwrap();
+ }
let mut runs: Vec<Vec<OpenResult>> = vec![Vec::new(); entries.len()];
let mut errors: Vec<Option<String>> = vec![None; entries.len()];
for round in 0..=super::RUNS {