Optimize toArray (#1060)#1061
Optimize toArray (#1060)#1061re-thc wants to merge 2 commits intojava-native-access:masterfrom re-thc:master
Conversation
replace toArray(new T[size]) with toArray(new T[0]) for better performance
|
I'm not sure, that we are seeing the hotpaths here, but then the code get smaller and thus more readable. I'm inclined to merge this. For user facing changes we require an entry into CHANGES.md documenting the change. You can opt-in to do it for this case, I would consider it a feature. Please refer to the other entries as a reference. In anycase, I'd like to see the commit message updated to reflect the reasoning (the "why") - short summary of the results Aleksey Shipilёv presents, with the link. That way, when someone looks at the history/annotated file, he/she can understand why the change was done. You can update it by doing an "amend" commit and force-push the change (that could also include the change to CHANGES.md, if you decide to add one). |
Performance: replace toArray(new T[size]) with toArray(new T[0]) [Benchmarks / documentation](https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_conclusion)
|
I've made changes to CHANGES.md. Hope it's ok now. Thanks for reviewing. |
|
Merged via 07f3ce0, I updated CHANGES.md and the commit messages and squashed it into one commit. Thank you for your work. |
replace toArray(new T[size]) with toArray(new T[0]) for better performance