views:

226

answers:

1

I need to increase the performance of a compact framework application which uses a SQLCe database to persist cached objects between sessions of the application. Currently, objects are serialized into XML and stored in a SQLCe database, but having run a profiling tool it seems that there is quite an overhead in doing this. I was thinking of changing this to a binary serializer but does anyone know of any more efficient ways of storing these object for quick retrieval? Thanks.

Update: Just found out there's no binary serialization support in compact framework so not an option.

+2  A: 

First you need to characterize where the time is spent. Is it in the serialization or the actual data insert? Without knowing that, you can't effectively try to improve the action. And, FYI, proto-buf provides binary serialization.

ctacke
It is the actual serialization itself which is causing the overhead, the inserts and selects are relatively quick. I'm using EQATEC Profiler (http://www.eqatec.com/tools/profiler) which breaks execution times down. I'll take a look at proto-buf, thanks.
Charlie
So really the question isn't about how to efficiently store the data, it's how to speed up serialization.
ctacke
Well, not necessarily. My problem is that I need to persist data between sessions. Serializing the objects and sticking them in a data store is one way, but I didn't ask specifically about serialization because maybe people have some better suggestions. I beginning to think that the current implentation is the wrong way, and perhaps there should be a proper schema in the db rather than storing a serialized blob?
Charlie