echonesis commented on code in PR #9427:
URL: https://github.com/apache/ozone/pull/9427#discussion_r2600735894
##########
hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java:
##########
@@ -102,7 +92,7 @@ public static class Builder extends
WithObjectID.Builder<OmPrefixInfo> {
public Builder() {
//Default values
- this.acls = new LinkedList<>();
+ this.acls = new ArrayList<>();
Review Comment:
1. Better performance for our usage pattern: The Builder only performs
clear(), addAll(), and constructs an ImmutableList. ArrayList is more efficient
for all these operations due to contiguous memory layout and better cache
locality.
2. Lower memory overhead: LinkedList requires extra memory for node pointers
(prev/next), while ArrayList uses a simple array with minimal overhead.
3. No LinkedList benefits utilized: LinkedList is mainly useful for frequent
insertions/deletions in the middle of a list. We don't perform any such
operations here.
Besides, we can drop `LinkedList` import.
--
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]