jchambers/fast-uuid

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

doom369 opened this issue Β· 5 comments

First of all - thanks for this library. I always had in my head idea to do the same, but now... you did it πŸ‘.

Do you have any plans for implementing

String randomUUID() instead of JDK UUID randomUUID()

that will not allocate additional UUID object?

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

l15k4 commented

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

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.

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!

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