KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two. This routine is going to be used millions of times (a usual run is about 60 or 70 million times), so I need it to be as fast as possible. I'm working on C++ (C++Builder 2007, for the record) Right now, I have a simple: matches += array1[0] == array2[0]; repeated 16 times (as profiling it appears to be 30% faster than doing it with a for loop) Is there any other way that could work faster? Some data about the environment and the data itself: I'm using C++Builder, which doesn't have any speed optimizations to take into account. I will try eventually with another compiler, but right now I'm stuck with this one. The data will be different most of the times. 100% equal data is usually very very rare (maybe less than 1%)
Tags (comma-separated)
Save Edits
Cancel