Are regular expressions "=~" faster than multiple ==?

Just wondering if anyone has done any testing to determine whether a single regular expression match is faster than multiple equality matches combined with logical or?

In other words, is {GP =~ “(hand|research)”} faster or slower than {GP == “hand” || GP == “research”}? How about if I add a 3rd term?

I’m guessing I’ll just have to do the testing myself, but I suspect the difference won’t be easily noticeable. (I’m trying to find ways to speed up the end-of-generation processing in the Terraforming Mars module–I’ve already added a bunch of Fast Matches to the GKCs, without any appreciable difference, which was both surprising and disappointing).

Regex checks are almost certainly “ever so slightly slower” than ==, because of the overhead of the pattern matching code. You trade that for the convenience and “cleaner looking code”. It seems unlikely you’d ever really notice the performance difference.

The amount of leverage you get with Fast Match depends on how much many pieces are being pre-culled from GKC processing, how many traits are on those pieces, and so forth – so in other words it can vary widely. But the more “incisive” your Fast Matches are at culling the more performance you will get. I got some of my slow For the People commands to run in e.g. ~3 seconds instead of ~5 seconds – which is certainly something although far from instantaneous. Ideally you have both a tight “location match” and a tight “property match”. The tightest location matches of all are “Current Stack / Deck” and “Specific Deck”, though obviously those aren’t always suited to the task at hand.