The list lengths were chosen so that the likely hood of actually getting a hit is reasonable (~80%). If we increase the pattern lengths to 10 characters so that failure is almost guaranteed, I get the following:
You get negligible impact from the optimization, and you break your ability to update your array of patterns (potential for bugs). You also potentially confuse people less-sophisticated people who might look at your code. There is a clear improvement over using grep, but if benchmarking shows this step is your bottleneck, then you are probably better off either optimizing your pattern or rethinking your filtering.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.