<p>I have 2 arrays of 16 elements (chars) that I need to "compare" and see how many elements are equal between the two.</p>

<p>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)</p>

<p>Right now, I have a simple:</p>

<pre><code>matches += array1[0] == array2[0];
</code></pre>

<p>repeated 16 times (as profiling it appears to be 30% faster than doing it with a for loop)</p>

<p>Is there any other way that could work faster?</p>

<p>Some data about the environment and the data itself:</p>

<ul>
<li>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.</li>
<li>The data will be different most of the times. 100% equal data is usually very very    rare (maybe less than 1%)</li>
</ul>

Is it faster as one statement?
```
```
matches += (array1[0] == array2[0]) + (array1[1] == array2[1]) + ...;
```
```