Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: provider a watch multiple files api to instead of multiple call Watcher#watch #653

Open
underfin opened this issue Nov 12, 2024 · 1 comment

Comments

@underfin
Copy link

underfin commented Nov 12, 2024

System details

  • OS/Platform name and version: MacOS 14.4.1 (M3 pro)
  • Rust version (if building from source): rustc --version: rustc 1.77.2
  • Notify version (or commit hash if building from git): 7.0.0
  • If you're coming from a project that makes use of Notify, what it is, and a link to the downstream issue if there is one:
  • Filesystem type and options:
  • On Linux: Kernel version:
  • On Windows: version and if you're running under Windows, Cygwin (unsupported), Linux Subsystem:
  • If you're running as a privileged user (root, System):
  • If you're running in a container, details on the runtime and overlay:
  • If you're running in a VM, details on the hypervisor:

What you did (as detailed as you can)

The performance has more overhead if multiple call Watcher#watch, watching 158 files take 88 ms at my local. The overhead look like the FsEventWatcher#stop and FsEventWatcher#run is call multiple times. It could be improve like this.


fn watch_multiple(&mut self, path: Vec<&Path>, recursive_mode: RecursiveMode) -> Result<()> {
        self.stop();
        for path in path {
                   let result = self.append_path(path, recursive_mode);
       }
        // ignore return error: may be empty path list
        let _ = self.run();
        result
    }

The Watcher#unwatch API is also need to give similar API.

If here provide a API to do it, it could be nice. Thank you.

@wanyt
Copy link

wanyt commented Nov 14, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants