[Android Knowledge Notes] Why is Parcelable faster than Serializable?

Q: Why is Parcelable faster than Serializable?

First of all, talking about technical solutions regardless of the application scenario is playing hooligans, so if you encounter an interviewer asking such a question, you are digging a hole for the interviewer.

insert image description here
insert image description here

Serialization

  • The process of converting the state of an instance into a form that can be stored or transmitted.
    insert image description here

Serializable

  • Implementation method: Serializable belongs to Java , which means that an object can be converted into a state that can be stored or transmitted. The serialized object can be transmitted on the network or stored locally. Serializable is implemented based on file input and output streams.

  • Ease of use: developers only need to implement the Serializable interface, no other work required
    <

Guess you like

Origin blog.csdn.net/lyabc123456/article/details/131266762