ljluestc commented on issue #4317: URL: https://github.com/apache/dubbo/issues/4317#issuecomment-1616809502
序列化: 可以在 Kryo 的 Output 类中使用 writeObjectOrNull,而不是使用 writeObject(将类描述与对象一起写入)。 该方法将对象写入输出流,而不包含类描述,假设接收者已经知道类类型。 反序列化: 在反序列化过程中,可以在Kryo的Input类中使用readObjectOrNull,而不是直接使用readObject,并将预期的类类型作为参数传递。 此方法允许 Kryo 使用提供的类类型反序列化对象,而不依赖于序列化数据中存在的类描述。 通过利用 Kryo 中的 writeObjectOrNull 和 readObjectOrNull,当生产者和消费者都明确了解类类型时,可以跳过类描述的序列化。 这可以减少有效负载大小并提高序列化/反序列化性能。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
