jchambers / fast-uuid

A Java library for quickly and efficiently parsing and writing UUIDs
MIT License
162 stars 18 forks source link

Any plans to implement 'String randomUUID()' without creating intermediate UUID object? #1

Closed doom369 closed 6 years ago

doom369 commented 6 years ago

First of all - thanks for this library. I always had in my head idea to do the same, but now... you did it :+1:.

Do you have any plans for implementing

String randomUUID() instead of JDK UUID randomUUID()

that will not allocate additional UUID object?

jchambers commented 6 years ago

Hadn't really thought about it, but sure! Why not?

l15k4 commented 6 years ago

@jchambers hey, would you please publish it to sonatype or to some publicly available repo?

jchambers commented 6 years ago

hey, would you please publish it to sonatype or to some publicly available repo?

I'm traveling right now, and so don't have access to my signing keys. I'll publish as soon as I'm back at home this weekend.

jchambers commented 6 years ago

I took a shot at this in #2, but the performance gains were minimal. I think most users will be just fine with:

String uuidString = FastUUID.toString(UUID.randomUUID());

I've closed #2 as a result (and will close this, too), but I remain open to arguments that this would still be helpful!

jchambers commented 6 years ago

…and I've opened #6 for publishing to Maven Central so we can track that separately.