Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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: 22684
128
Eclipse IDE Spring VI Editor 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.
 
money grubbing section goes here:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic