Open
Conversation
Signed-off-by: MikkiYang <hecy7@asiainfo.com>
wenyuanhust
reviewed
Jul 23, 2025
Collaborator
wenyuanhust
left a comment
There was a problem hiding this comment.
请问有实际测试性能提升的幅度吗?如果提升不明显,不建议修改。原有代码更简洁
Contributor
Author
具体性能提升幅度未测试,因为secretPad本身只是属于隐语全栈技术(pad -> kuscia -> flow -> spu)的产品层,此处的性能影响较之全链路近乎于没有; 该修改主要关注点不在于性能,也跟简洁无关,而在于代码统一,当前项目多处代码分别出现过于随意的数组预分配处理方式,有的按照0,有的按照.size()取大小,建议统一为一种。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
多处代码中分别出现随意的数组预分配处理(有的按照0,有的按照.size()取大小),较为不统一,当前修复采用性能较高的数组预分配同size()处理,理由见如下代码分析:
预分配同样大小数组可直接调用jvm实现的native方法system.arraycopy,可进行性能提升;
给0值则需要newInstance一个对象后再调用native方法。