I have a list from 10,000 long value
and I want to compare that data withe 100,000 other long value
compare is a bitwise operation –>
if (a&b==a) count++;
which algoritm I can use for getting best performance?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand your question correctly, you want to check
aagainst eachbwhether some predicate is true. So a naive solution to your problem would be as follows:I’m not sure this can really be sped up for an arbitrary predicate, because you can’t get around checking each
aagainst eachb. What you could try is run the query in parallel:Example:
aList: 10,000 randomlongvalues;bList: 100,000 randomlongvalues.without
AsParallel: 00:00:13.3945187with
AsParallel: 00:00:03.8190386