• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

In-memory java object compression ...

 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a client/server based application in which the client sends a huge number of objects to the server to process and send the results back to the client.

The network layer is built using RMI.

I'm in the process to do some optimizations in the network layer.

One of the things i was thinking about was to compress each object on the client side before sending it to the server (the same process to be done on the server side after finishing processing on the object and just before sending back to the client).

So, is there a way to compress the object (just in memory) in Java ?

Otherwise if not, what other things do you recommend to accomplish RMI optimization ?

Please advice ...

Regards,
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a little old article but so is RMI
So, it may help you.

Usually, using externalizable instead of serializable saves some cost but sure it is a little cumbersome to maintain as you need to update your methods whenever you modify the object or add/remove fields.
 
Sheriff
Posts: 22816
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also use compression on the streams:

Next you use instances of these factory classes in your UnicastRemoteObject (subclass) constructor or however you start your RMI application.


Now all your communcation is compressed when sending and decompressed when receiving. It does have a performance hit in your application itself (both client and server need to (de)compress) but the network traffic itself will be compressed.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic