Awesome. I don't know if this will help, but I seem to have resolved the problem on my M4Pro Mini running these two commands:
# Quit apps that might use iCloud Drive
osascript -e 'tell application "Finder" to quit'
# Kill iCloud daemons
killall bird cloudd fileproviderd
# Remove local iCloud metadata cache (NOT your files)
rm -rf ~/Library/Application\ Support/CloudDocs
rm -rf ~/Library/Caches/CloudKit
rm -rf ~/Library/Caches/com.apple.CloudDocs
rm -rf ~/Library/Preferences/MobileMeAccounts.plist
# Restart the system
sudo shutdown -r now
and this one:
osascript -e 'tell application "Finder" to quit'
killall fileproviderd bird cloudd
# Move the offending FileProvider container aside
mv ~/Library/Application\ Support/FileProvider/723EBBFF-303E-471D-924D-C7D140F50B49 \
~/Library/Application\ Support/FileProvider/723EBBFF-303E-471D-924D-C7D140F50B49.old
# Let macOS rebuild a fresh one on reboot
sudo shutdown -r now
The strange thing is, my Macbook Air the same commands didn't do anything. There were two instances where I resolved the lag on my Air.
I removed a specific folder from the ROOT directory of my iCloud drive. Unfortunately the problem came back
I then took everything out of my drive (including desktop and documents), made a backup of it. Then screen shared into my M4 Mini and from that backup, restored it to documents on my Mini. Even after the Air was done syncing, it was perfect for a little bit.
Macbook Air, I deleted everything. Lag. Turned OFF desktop/documents. Lag.
I hope this MAYBE helps.