The Problem: A large static list of strings is provided as A, A long string is provided as B, strings in A are all very short (a keywords
A
B
I don't know if this would be any quicker, but it's a lot more pythonic:
result = [x for x in A if x in B]