I wrote a macro to analyze a document for acronyms, and found that for larger documents the performance seemed to be exponentially worse. I created a simple performance test where I looped through each Word in Words and assigned the text of the word to a variable. Just one line of code inside the loop. I captured the start and end times.

When I tested this on a document with Words.Count = 200, it took under 1 second to run, so better than 200 words per second.

When I tested this on a document with Words.Count = 36,121, it took 1:27:26 to run. That averages about 7 words per second.

Why does the performance degrade so much for large documents? Is there any approach I can take to speed things up?