[infinispan-dev] Double+ buffering during value marshalling

Manik Surtani manik at jboss.org
Mon Aug 13 12:22:33 EDT 2012


Probably a question for David or Galder… but good detective work as always, Sanne.

On 11 Aug 2012, at 21:00, Sanne Grinovero <sanne at infinispan.org> wrote:

> While debugging around the Infinispan/JBMar integration I noticed that
> Infinispan defines in-memory buffers wrapped as byte streams, and uses
> JBoss Marshaller to write to these.
> 
> JBoss Marshaller also buffers writes, and flushes when needed or on
> demand; I did already know of both, but just realized that these two
> levels of buffering are both applied when serializing instances in a
> org.infinispan.marshall.MarshalledValue; I guess we could do better
> avoiding buffering and have JBMAR write straight away? It would also
> mean less array resizing, as we are often able to allocate the right
> size in one shot.
> 
> I gave a look into RiverMarshaller, and this didn't look like a simple
> task as _byte[] buffer_ is the main element around which most of the
> code revolves (in it's superclass SimpleDataOutput).
> 
> I'm wondering if SimpleDataOutput wouldn't be simpler by just writing
> to a org.jboss.marshalling.ByteOutput (and have an optional buffering
> implementation), or if Infinispan should use River in a different way.
> 
> Regards,
> Sanne
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Founder and Project Lead, Infinispan
http://www.infinispan.org

Platform Architect, JBoss Data Grid
http://red.ht/data-grid

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20120813/4cf02c1c/attachment.html 


More information about the infinispan-dev mailing list