Re: Efficient hashmap serialization?



> I have a a hash map full of objects that contain references to other
> objects in that map, grouped in a threaded message fashion. There's a
> linked list style previous messages and next message.
>
> I serialize this map to send it over RMI, but it seems quite slow.
>
> Does anyone have any recommendations on efficiently serializing it? I
> know I will have to write a function to serialize the objects manually
> but not much beyond that.

Can you give us the types of the keys and values of your Map? Are the
messages plain Strings, or are you using a proper message abstraction type?

If you understand what Serialization does for you, maybe you will change
your opinion on it being quite slow... it's got a lot to do, and it does
everything through reflection.

If you really, really need to speed things up, then consider writing custom
private readObject()/writeObject() methods for your Map's value objects...
though you should profile the serialization step to see what really is
causing the whole thing to eat time.


.



Relevant Pages

  • std::map and serialization
    ... MFC n00b here, I'm trying to serialize a std::map obj into disk. ... code above is inside a for loop that loops through the elements in the map). ...
    (microsoft.public.vc.mfc)
  • Efficient hashmap serialization?
    ... I have a a hash map full of objects that contain references to other ... grouped in a threaded message fashion. ... linked list style previous messages and next message. ... I serialize this map to send it over RMI, ...
    (comp.lang.java.programmer)
  • YAML Problem
    ... I would like to serialize a hash, ... but deserialize say: Invalid element in map ...
    (comp.lang.perl.misc)
  • Help! Mapper - do not show empty nodes
    ... Is there a way to not serialize or show empty destination nodes in the ... BizTalk mapper? ... I output a large file, map it, then send it somewhere. ...
    (microsoft.public.biztalk.general)