It should take no more than 1 sec per item.
Symptom 1: It was taking about 20 sec per item.
Symptom 2: I checked Activity Monitor and found that the Finder was at 100.1% CPU time.
(Which explains the rainbow wheel of inactivity I was getting.)
Symptom 3: The CPU temperature, which is usually less than 140 deg F, was at 170 deg F.
(This can be really dangerous. I suspect that this
is the cause of a dead logic board a year ago.
Which is why I monitor the CPU temperature.)
After inserting a timing diagnostic at various locations, I found the offending line of code ...
some file of entire contents of the result whose name is msgFileName
It has been known for some time that Symptom 1 is a problem with entire contents.
... at least in its current implementation. If this can be fixed, it ought to be.