I very often take screen shots, and have my system configured to save them directly to the desktop, without the intermediate processes.
This question has been asked a lot. For example, see the following:
However, none of the situations and solutions discussed there are applicable.
The questions above talk about 5-6 seconds to save. On my system it takes 15-20 seconds. This is a 2017 iMac; not a slow machine. The delay is very annoying as when one saves to the desktop one usually needs the resulting file immediately, so I have to wait for it to appear.
A lot of the discussion talks about Google Backup and Sync. I have never used these.
Some of the discussion talks about turning off anti-virus. As I test, I turned off Bitdefender. It made no difference.
Any other ideas?
EDIT: as soon as I saved this question, it occurred to me from the solutions based on disabling certain services, that maybe something like that was involved. On a hunch, I decided to disable Spotlight indexing of the Desktop folder, by adding it to the Privacy section. After all, I don't really need Spotlight for the relatively small number of objects I allow on my Desktop.
Interestingly, this worked! Screen shots now save in about 2 seconds.
Putting this as an "edit" rather than answering my own question, because this is a workaround, and there might be a better solution.