开发者

Fastest serialization/deserialization scheme for a Datastructure

I have an android application that uses a datastructure consisting couple of binary trees and other structures like list and arrays all linked to each other. i would like you all to suggest a scheme for saving and retriving this data structure. the data structure is created through a SAX parses (the source is XML file). i have tried java serialization/de-serialization but find it atleast twice as slow as using the original SAX parser to build the structure. the serailzation(RAM to storage) time is not of high importance has it will take place as a background process, but i want a faster deserialisation(storage to RAM) scheme.

i dont want any type checking features etc. all i want is a fast serailization and faster deserialization scheme. also is Google's Protocol Buffer a good candidate? please suggest ..

(note: my app will be show a blank window(Activity) untill the datastructure is deserialised, so speed is of highest importance and i have skinned down my DS to the utmost possible)

Thanks in advanc开发者_StackOverflow中文版e


Default de/serialization is usually quite slow for it relies on reflection extensively (which is slow). You can try to implement it manually by redefining readObject/writeObject on your class, it usually gives noticeable performance boost.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜