OK. I tried removing the IntBuffer rps = s.asIntBuffer(), and
IntBuffer rpd = d.asIntBuffer() and access the data using the original
ByteBuffer getInt and putInt code as follows.
i0=I0; j0=J0; u0=U0; v0=V0;
int TS1 = TILE_SIZE-1;
di0=(I2-I0)/TS1; dj0=(J2-J0)/TS1;
du0=(U2-U0)/TS1; dv0=(V2-V0)/TS1;
di=(I1-I0)/TS1; dj=(J1-J0)/TS1;
du=(U1-U0)/TS1; dv=(V1-V0)/TS1;
for (k0=(TILE_SIZE-1);k0>=0;k0--)
{
i=i0; j=j0; u=u0; v=v0;
for (k=k0;k>=0;k--)
{
rpd.putInt(((v>>1)*TILE_SIZE+(u>>1))<<2, rps.getInt((j*TILE_SIZE+i)
<<2));
i+=di; j+=dj; u+=du; v+=dv;
}
i0+=di0; j0+=dj0; u0+=du0; v0+=dv0;
}
Strange thing is it took longer. The average original benchmark was
161 microseconds, while the code above gave an average of 182
microseconds.
Could this be the bounds checking is worse in the bytebuffer mode for
getInt and putInt than the asIntBuffer mode. Also are u sure there is
a copy when using asIntBuffer. The tile_size in my case is 128.
I didn't try the -server flag and the application is run via java
webstart.
John
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---