Solve the perf issues of grep -v -f with some python.