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))); > Isn't LinkedList is more appropriate here? yes and no. With great number of elements linked list a) takes more memory than array list b) is slower that array list despite of its algorithmic complexity. 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 <[email protected]> Gerrit-Reviewer: Martin Mucha <[email protected]> Gerrit-Reviewer: Mike Kolesnik <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
