hbons / SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows.
https://sparkleshare.org
Other
4.88k stars 577 forks source link

Mac FileWatcher - reduce load #1970

Closed markusstoll closed 3 years ago

markusstoll commented 3 years ago

I noticed quite some high load when the Mac version detects changes. As we do get a large amount of notifitions on the .git subfolder which are going to be dropped later in the chain, we can reduce cpu load, if we drop these immediately.

knocte commented 3 years ago

This change should not be Mac specific, though?

markusstoll commented 3 years ago

My change is macOS specific. The underlying issue might affect other platforms as well, but frankly I have no clue how the file system watching is done there. As Mac only user I am quite focused on my part.

knocte commented 3 years ago

My point is:

markusstoll commented 3 years ago

No, the whole point is, in the Mac part the file change info is wrapped into a task which will be executed in a saparate thread before the common code OnFileActivity is being called. So changing this in the Mac part is the only way to reduce the load!

hbons commented 3 years ago

Markus is right. There's a separate file watcher class on Mac as the Mono implementation had huge performance problems.