Recently, my mac started exhibiting a strange behavior...
Accessing some files, even from the terminal, was extremely slow.
Finder was stuck when opening some folders.
Uploading some files from my terminal through Firefox made Finder hang forever.
I enabled syncing of Documents and Desktop to iCloud. Also, storage optimization was enabled (somehow) on my Mac. I think that it causes the filesystem to ping iCloud each time I want to access a file.
- Go into your settings
- Click on "Stock in iCloud" (sorry, my UI is in french, so translation won't be perfect)
- Disable it!
It won't disable iCloud; rather, it will disable storage optimisation.
Thankfully, I still had space left on my device... it looks like everything is still available locally.