Homemade vs. Java Serialization

前端 未结 14 739
离开以前
离开以前 2021-02-04 06:16

I have a certain POJO which needs to be persisted on a database, current design specifies its field as a single string column, and adding additional fields to the table is not a

14条回答
  •  失恋的感觉
    2021-02-04 06:56

    If you are using a delimiter you could use a character which you know would never occur in your text such as \0, or special symbols http://unicode.org/charts/symbols.html

    However the time spent sending the data to the database and persisting it is likely to be much larger than the cost of serialization. So I would suggest starting with some thing simple and easy to read (like XStream) and look at where your application is spending most of its time and optimise that.

提交回复
热议问题