It dawned on me that this may be processing redundant strings, so I changed the string list to a set, and now it runs in about 2 seconds, vs 30.  So that's good.