egui icon indicating copy to clipboard operation
egui copied to clipboard

[example file_dialog] may cost too much cpu time

Open TYPEmber opened this issue 2 years ago • 2 comments

Describe the bug

During the system file dialog showing, the cpu cost is really high. Maybe there has a loop try to get the return value from rfd::FileDialog::new().pick_file() ?

To Reproduce Steps to reproduce the behavior:

Just run the file_dialog example and click that button Do nothing Check the cpu cost(About 80% on my device)

Desktop (please complete the following information):

  • OS: MacOS

TYPEmber avatar Sep 03 '22 05:09 TYPEmber

On my macOS Monterey (12.5.1) I have no such CPU problem. pick_file is a blocking call, so if there is a problem it is likely in rfd or how rfd interacts with winit.

emilk avatar Sep 05 '22 10:09 emilk

Thanks for your reply. I meet this problem on the same OS version(12.5.1). And I tried to use rfd in a simple terminal project, pick_file works well without such problem.

TYPEmber avatar Sep 05 '22 11:09 TYPEmber