in reply to Searching first array in second array.

The only thing I'll add to the "use a hash" advice, is don't read the data into two arrays first. You'll likely to run out of memory because of the duplication.

Far better to build a hash directly from the smaller set as you read it in. And the read the second set one-by-one and test it against the hash. For datasets of this size, that likely to save you a large amount of memory, and quite a bit of time.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"
  • Comment on Re: Searching first array in second array.