On Fri, Jun 15, 2012 at 8:25 AM, Simone Tripodi <[email protected]>wrote:

> 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;
>
Don't forget that int are 32bits in Java so this give a 2Gb size for a
single object. I see more a cache used for storing large number of objects
but we never know, with Moore's law.


>
>  * 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!
>
+1

>
>  * 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
>
+1

>
> 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/
>



-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Reply via email to