It's a well known factor that direct bytebuffer allocation is much slower than non
direct byte buffers.
If you think about it when you allocate a non direct byte buffer then it basically just
needs to dereference a pointer to some memory on the Java heap, which is very quick. But
for a direct buffer, it has to malloc real memory from the OS, and do a bunch of other
house keeping.
So yes, if you're using direct byte buffers it pays to re-use them.
You should speak to Trustin about this. I believe Netty uses non direct buffers for
exactly this reason.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214413#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...