users@glassfish.java.net

Re: Why are Remote method calls so expensive?

From: <glassfish_at_javadesktop.org>
Date: Fri, 25 Jan 2008 06:54:05 PST

I would try one more tweak to this scheme: wrap your ByteArrayOutputStream with a GZIPOutputStream, then with an ObjectOutputStream. This will probably shrink your 1.6 MB buffer significantly, especially if you have a good bit of text data in the stream. Then on the other end, wrap your ByteArrayInputStream with a GZIPInputStream, then an ObjectInputStream, to decode. I think that even lengthy computation on each end trumps fast network transmission every time, because it will nearly always be faster.
[Message sent by forum member 'jkeatley' (jkeatley)]

http://forums.java.net/jive/thread.jspa?messageID=255784