Yes instead of using grep, why aren't you using hashes to determine whether there is anything new in the file? You can build up a hash of all the terms (machines) in file1 and then check the hash to see whether an entry exists for each line of file2.
This would be much quicker than using grep for what you seem to be doing.
A Monk aims to give answers to those who have none, and to learn from those who know more.