XML vs Binary performance for Serialization/Deserialization

前端 未结 6 1848
迷失自我
迷失自我 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:50

    Have you tried creating custom serialization classes for your classes? Instead of using XmlSerializer which is a general purpose serializer (it creates a bunch of classes at runtime). There's a tool for doing this (sgen). You run it during your build process and it generates a custom assembly that can be used in pace of XmlSerializer.

    If you have Visual Studio, the option is available under the Build tab of your project's properties.

提交回复
热议问题