UUID.randomUUID() performance
807580Jul 30 2008 — edited Apr 19 2010Hello 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