rfd icon indicating copy to clipboard operation
rfd copied to clipboard

Rfd, uses 100% of one CPU core on Windows

Open qarmin opened this issue 1 month ago • 1 comments

Project czkawka/krokiet uses the following dependency:

rfd = { version = "0.15", default-features = false, features = ["xdg-portal", "async-std"] }

rfd version "0.15.4"

rfd usage

        let file_dialog = FileDialog::new().set_directory(directory);

        let Some(folders) = file_dialog.pick_folders() else {
            return;
        };

One user reported that opening the file-chooser dialog on Windows causes a single CPU core to spike to 100%. After closing the dialog, CPU usage returns to normal.

Issue link: https://github.com/qarmin/czkawka/issues/1641

Open krokiet and click "Add folder" button in lower left corner. Then the CPU usage will be high and the folder-picking dialog is very laggy.

After I close the dialog, CPU usage will go back down to 2%.

Image

qarmin avatar Nov 17 '25 05:11 qarmin

Can not reproduce:

fn main() {
    let path = std::env::current_dir().unwrap();

    let res = rfd::FileDialog::new()
        .set_directory(&path)
        .pick_folders();

    println!("The user choose: {:#?}", res);
}

Dialog is responsive, and uses barely any CPU.

PolyMeilex avatar Nov 17 '25 21:11 PolyMeilex