Thanks to all for the replies. I could learn a thing or two about searching algorithms and complexities of algorithms through the replies. I figured out the easiest and quickest way would be to not use arrays at all. Instead I used hashes to store both lists. Then just did 'exists' on each of these hashes. Now the script completes in about 10 seconds.
Thanks,
In reply to Re^2: performance issues with grepping large sorted arrays
by HarshaHegde
in thread performance issues with grepping large sorted arrays
by HarshaHegde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |