RFR: patch to reduce use of many temporary objects in java.util.UUID
mike.duigou at oracle.com
Thu Nov 14 21:29:18 UTC 2013
We were able to get some parts of your UUID patch into Java 8 but I unfortunately didn't get time to get all the pieces in before the Java 8 rampdown began. I was hoping to get the parsing part in next as it seemed to have a bigger payoff than the remaining toString() changes. These changes will likely happen early in Java 9 repo and then can be backported to Java 8.
I will followup with Robert's patch as well.
On Nov 11 2013, at 11:39 , Steven Schlansker <stevenschlansker at gmail.com> wrote:
> On Nov 6, 2013, at 4:19 PM, Robert Stupp <snazy at gmx.de> wrote:
>> 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:
> 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 :)
> Steven Schlansker
More information about the core-libs-dev