Re: faster ByteBuffer comparison

2011-07-02 Thread Jeffrey Kesselman
I'd fetch it all at once into a single byte array and try Arrays.equals() On Sat, Jul 2, 2011 at 12:45 PM, Jeffrey Kesselman wrote: > GetLong has to get it a byte at a time still to support endianess. > > Id have to think about it, but what you really want is to get it all > into a byte array an

Re: faster ByteBuffer comparison

2011-07-02 Thread Jeffrey Kesselman
GetLong has to get it a byte at a time still to support endianess. Id have to think about it, but what you really want is to get it all into a byte array and then process it in 64bits. AIR there are some new array recasting things in Java 5+. Ill need to go look at them more closely... On Fri,

Re: faster ByteBuffer comparison

2011-07-02 Thread dnallsopp
Quoting Yang : I'd guess that getLong() is not faster because get() probably already benefits from processor cache etc. There are two concrete subclasses of ByteBuffer that implement get() - HeapByteBuffer and DirectByteBuffer (for mapped memory). It might be possible to optimise the comparison

Re: faster ByteBuffer comparison

2011-07-01 Thread Peter Chang
unsubscribe

faster ByteBuffer comparison

2011-07-01 Thread Yang
I can see from profiling that a lot of the time in both reading and writing are spend on ByteBuffer compare on the column names (for long rows with many columns) I looked at the ByteBufferUtil.unsignedCompareByteBuffer() , it's basically the same structure as standard JVM ByteBuffer.compare() loop