Hi Simo, really good points!
2012/6/15 Simone Tripodi <[email protected]> > 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; > +1, we may either use a Composite pattern for that and/or explicitly use ByteBuffer[] or collections. > > * 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 > do you mean as an intermediate step before "going off-heap" ? I think that'd be good but we should be able to read both GZipped and not GZipped data thus we may need some kind of markers/headers for that (or just a try / catch block). > > WDYT? does it make sense or there is something we want to speak more > carefully? > What I think is missing, apart a release, is documentation. As far as I can remember different users asked for architecture and design diagrams or just how to do X/Y/Z in the past so we should definitely try to plan some work on that too. My 2 cents, Tommaso > > Thanks and best, > -Simo > > http://people.apache.org/~simonetripodi/ > http://simonetripodi.livejournal.com/ > http://twitter.com/simonetripodi > http://www.99soft.org/ >
