On Nov 6, 2013, at 4:19 PM, Robert Stupp <[email protected]> wrote: > Hi, > > the current implementation of java.util.UUID.fromName() and > java.util.UUID.toString() unnecessarily produce a lot of temporary objects. > Especially the fromName() method creates some instances of java.lang.Long and > indirectly via "name.split()" many Strings, an ArrayList, etc. > UUID.toString() creates at least 10 String objects plus the implicitly > created char[] instances. > > Here's a hg diff which reduces the temporary object count while still > providing the same functionality. >
Hi Robert, I identified the same problem and submitted a patch earlier this year: http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-January/013494.html http://osdir.com/ml/core-libs-dev/2013-03/msg00403.html Sorry I don’t have the best list message references here, Oracle seems to have decided to break all the links through the old Sun bug database, so all my references are gone. Bummer. :( It’s currently living at CR 8006627 and CR 8007398, although I’m having real trouble finding a public link to the bugs. Last I heard, Mike (CCed) has this in a patch queue somewhere waiting to commit it. Maybe he will take the good parts from my patch and the good parts from your patch and make an even better patch :) Regards, Steven Schlansker
