Skip to content

Instantly share code, notes, and snippets.

@abner
Last active August 25, 2017 10:22
Show Gist options
  • Save abner/6e1f8ada411549207aebd83559016f91 to your computer and use it in GitHub Desktop.
Save abner/6e1f8ada411549207aebd83559016f91 to your computer and use it in GitHub Desktop.
UUID GENERATION
package io.abner.vertx.errors;
import java.util.UUID;
import org.junit.Test;
import com.fasterxml.jackson.annotation.ObjectIdGenerators.UUIDGenerator;
import io.vertx.core.json.JsonObject;
public class UUIDTest {
@Test
public void test() {
JsonObject t = new JsonObject();
UUIDGenerator gen = new UUIDGenerator();
for (int i = 0; i < 10000000; i++) {
UUID uuid = gen.generateId(t);
}
}
}
@abner
Copy link
Author

abner commented Aug 25, 2017

in my laptop, 10 Mi in 4.1 seconds.
Pretty fast!
And i was just afraid it would be slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment