XML vs Binary performance for Serialization/Deserialization

前端 未结 6 1845
迷失自我
迷失自我 2020-12-10 15:03

I\'m working on a compact framework application and need to boost performance. The app currently works offline by serializing objects to XML and storing them in a database.

6条回答
  •  庸人自扰
    2020-12-10 15:54

    Is the performance hit in serializing the objects, or writing them to the database? Since writing them is likely hitting some kind of slow storage, I'd imagine it to be a much bigger perf hit than the serialization step.

    Keep in mind that the perf measurements posted by Marc Gravell are testing the performance over 1,000,000 iterations.

    What kind of database are you storing them in? Are the objects serialized in memory or straight to storage? How are they being sent to the db? How big are the objects? When one is updated, do you send all of the objects to the database, or just the one that has changed? Are you caching anything in memory at all, or re-reading from storage each time?

提交回复
热议问题