Yevgeny Zaspitsky has posted comments on this change. Change subject: utils: performance improvement ......................................................................
Patch Set 5: -Code-Review (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))); > yes and no. With great number of elements linked list a) takes more memory in case of a large range defined you won't be able to allocate enough memory even for an empty ArrayList. Here the CPU efficiency isn't an issue. 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