Hi all guys,

I was recently involved in the realization of a simple prototypal
server  based on NIO APIs, so had the chance of thinking more on few
doubts I've had in DM, hopefully sharing my experience will benefit DM
:)

SO, this a list of thoughts:

 * a single ByteBuffer _could_ be NOT enough to handle a single
object: despite how good the serializer you've chosen is, there'll be
always an object that, once serialized, has a dimension that is bigger
that the ByteBuffer maximum capacity - ByteBuffer size is an int, it
could be a long (and types cast are bad jokes! :P) - my proposal is
that a single DM entry point _could_ be split in a sequence of
ByteBuffers;

 * Objects can be serialized directly to ByteBuffers: ATM we are
wrapping the produced byte[], which still is an object in the Heap, so
we can optimize that step simply by implementing (Input|Output)Streams
wrapping the target sequence of ByteBuffers - Benoit already did some
work on it, but I don't see it committed, please correct me if I am
wrong!

 * We didn't think to apply a GZip compression - it is true that we
are working off-heap, but hopefully the allocated space can handle
more objects by compressing them

WDYT? does it make sense or there is something we want to speak more carefully?

Thanks and best,
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

Reply via email to