Yes, the Word Count filter seems inexplicably slow. I looked at the code, and it's actually very trivial:
- Replace all single apostrophes with nothing
- Replace all sequences of word characters with “x”
- Replace all non-word characters with nothing
- Return the length of the string.
But that second step is inexplicably slow. I guess the endless mutation of the mutable string is resulting in the text being copied entirely for each word.
I will look in to why it is so slow and resolve it, at least for the word count case, though I'll also see if I can resolve it for the general regex search & replace, but that may be impossible as this looks to be the system API that is just really poorly implemented in this case.