On Fri, 2006-11-17 at 14:47 -0600, Greg Duffy wrote: > Direct buffers are, AFAIK, the only kind that can be accessed with JNI, > which I use extensively. Just my $0.02.
I agree. I got tired of waiting for JSR 203 so I have been experimenting with the POSIX aio library in JNI. I currently have asynchronous file reads working and my initial experiments indicate that direct buffers are significantly faster than heap buffers when used with JNI. Heap buffers can be used in JNI but you have to jump through hoops to create a Java byte array and pass the byte array into the buffer or vice-versa if you want to read the contents of a buffer. Once/if my AIO framework stabilizes, I'll run some additional experiments comparing performance between heap/direct buffers in standalone mode and with MINA. If anyone's interested, I would be happy to post my AIO code in my sandbox once it's in a state that others might find useful. -Mike
