Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UUID.randomUUID() performance

807580Jul 30 2008 — edited Apr 19 2010
Hello All,

I am using UUID.randomUUID(); in Java 5 to generate a UUID, when running locally in unit tests run from maven this call takes 250ms, when we run this on our Bamboo server - same maven build - this sometimes takes 136594ms ! , and on some builds (only a few) it will run very quickly.

The bamboo build server is windows , as is dev environment.
Code is being run in a loop with one request in, and the test uses easymock to mock out the classes that this class calls.

Has anyone seen this behaviour before, or can anyone think of a reason for this ?

for (CorrespondenceRequest request : requests) {
long lt1 = System.currentTimeMillis();
uuid = UUID.randomUUID();
long lt2 = System.currentTimeMillis();

Thanks
James
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2010
Added on Jul 30 2008
6 comments
1,849 views