Hey,
> So I repeat the question, does anyone know how fast is a
> mo1.equals(mo2)
> (byte[] equals ) if that is fast then we are safe.
did a little test, see code below. In my machine (laptop PII300 128MB win
jdk 1.3) several tests took 440-480 ms for a 10MB array.
What about the second question ?
> > And why InstanceCache.remove gets a PK object instead of
> the CacheKey
> > (didn't understood the javadoc comment) ?
Regards,
Simon
public class Test
{
public static void main(String[] args)
{
int n = 10000000;
byte[] b1 = new byte[n];
for (int i = 0; i < n; ++i)
{
b1[i] = (byte)(Math.random() * 256);
}
byte[] b3 = (byte[])b1.clone();
int c = 0;
long start = System.currentTimeMillis();
for (int j = 0; j < n; ++j)
{
if (b1[j] != b3[j]) break;
++c;
}
long end = System.currentTimeMillis();
System.out.println("equals on equal byte arrays: " + c + "
in " + (end - start));
}
}