feat(Jprotobuf): Avoid create lot of CodedOutputStream instance! #185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
压测在线3K. 每秒每人发30包 收20包. 每次ygc(11秒). 会创建两千万的CodedOutputStream 和 ByteArrayOutputStream. 和大量的字节数组对象
因为处理序列化和反序列化没有切换线程, 可以使用ThreadLocal做对象缓存优化. 优化后, 几乎可以忽略. 我这固定是160个对象. YGC时间也延长到18秒.
但是使用ByteBuffer构造CodedOutputStream 以及 CodedInputStream ,我没有找到好的优化方案