Martin Mucha has posted comments on this change.

Change subject: utils: performance improvement
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.ovirt.org/#/c/25940/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/MacAddressRangeUtils.java:

Line 32:             return Collections.emptyList();
Line 33:         }
Line 34: 
Line 35:         // Initialize ArrayList for all potential records. (ignore 
that there need not be that many records.
Line 36:         List<String> macAddresses = new 
ArrayList<>(Math.min(stopAfter, (int)(endNum - startNum)));
> in case of a large range defined you won't be able to allocate enough memor
well, I tried to say, that LinkedList consumes MORE memory --> for each record 
there has to be pointer.  At one million records, LinkedList consumes approx 
twice as much memory. And it's worse at a cost of higher cpu complexity. So if 
there is not free ram for arrayList, there won't be for linkedlist either. This 
way, as I get it, it cannot be worse that linked list, due to measurement I 
spoke about earlier.

I'll change it back to requested LinkedList.
Line 37:         for (long i = startNum; i <= endNum; i++) {
Line 38:             if ((MAC_ADDRESS_MULTICAST_BIT & i) != 0) {
Line 39:                 continue;
Line 40:             }


-- 
To view, visit http://gerrit.ovirt.org/25940
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I09f87ebd1ea17d09a974ce6ca3e26bd2454a72fc
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to