Martin Mucha has posted comments on this change. Change subject: core: performance improvement ......................................................................
Patch Set 7: (3 comments) answers. http://gerrit.ovirt.org/#/c/25940/7//COMMIT_MSG Commit Message: Line 5: CommitDate: 2014-05-12 12:06:46 +0200 Line 6: Line 7: core: performance improvement Line 8: Line 9: * initialized ArrayList to avoid copying arrays (tradeof is > No longer accurate.. no longer accurate. yevgeny is fine with ArrayList now, so I'm changing it back to ArrayList, so this will become right again. Line 10: bigger memory footprint during initialization) Line 11: Line 12: * changed transforming macAddress stored in 'long' to Line 13: String; loop is used instead of regex. Line 12: * changed transforming macAddress stored in 'long' to Line 13: String; loop is used instead of regex. Line 14: Line 15: --- Line 16: this changes cuts CPU time approx to 50% of original. > Is this still true with the LinkedList? same Line 17: --- Line 18: Note: code can be suboptimal when looking for LOT OF macs but range Line 19: offers to little of them: in that case unneccesarily big Line 20: array alocated and then trown away for no reason. But this should http://gerrit.ovirt.org/#/c/25940/7/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 47: Line 48: return macAddresses; Line 49: } Line 50: Line 51: private static String macAddressToString(long macAddress) { > Perhaps a simpler name is macToString, to align with method name you later renamed, will add test in following commit, where it's easier to do it (see "few fixes in MacAddressRangeUtils") Line 52: String value = String.format("%012x", macAddress); Line 53: char[] chars = value.toCharArray(); Line 54: Line 55: final StringBuilder stringBuilder = new StringBuilder(); -- 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: 7 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
