avoid any extra memory allocation in Version.fromString() 90/76290/2
authorMichael Vorburger <vorburger@redhat.com>
Thu, 20 Sep 2018 03:34:38 +0000 (05:34 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Fri, 21 Sep 2018 15:43:37 +0000 (17:43 +0200)
commit67ab012830be524ac842ebfd41db05a63f62bec5
treef6f11827da765897200ce9e1abd374e9e9097c84
parent67e0895209eba92ecfcc25c4b88936747e97c1a0
avoid any extra memory allocation in Version.fromString()

as this is called a lot, it's (apparently, Java Mission Control on a
scale lab test shows) worth it to avoid the RegExp Matcher and x3
intermediate String object allocations, which we can safe here by
implementing this a little smarter (lower level; feels like 6502!).

JIRA: OVSDB-469
Change-Id: I642e0bfd698e594d3c263f0a335b92f80fbde8c4
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
library/impl/src/main/java/org/opendaylight/ovsdb/lib/notation/Version.java
library/impl/src/test/java/org/opendaylight/ovsdb/lib/notation/VersionTest.java