I tried to post a further reply last week but the Submit button seemed to be disabled. I've just read this thread, which seems to explain that forum bug:
https://developer.apple.com/forums/thread/728466
So here is the post that I tried to send last week, except that I've replaced the string that I'm not allowed to mention with nonsense:
I note that none of your regular expressions actually need to be regular expressions, i.e. they
are just fixed text strings. For example, where you have "non.sense", I think you only want it
to literally match "non.sense", not "non0sense".
Since I like a challenge, I've just tried to do this in C++. Using simple string searching for the
patterns, I can process a 100 MB file in 0.165 seconds. But if I just replace the date search with
a fixed-string regex, the runtime increases to about 3 seconds. (Which I find pretty poor.)
It is interesting that this is about the same as the runtime you are seeing. It would not surprise
me if Swift and Clang's libc++ share the same (poor) regex implementation.