Uuids generating useless benchmark

No, I prefer to use plugins so I want to hear about this.

they are mac only and, UUIDMBS is version 4

lol i renamed my project accordingly :slight_smile:

1 Like

yes calculating uuids is not bottleneck of speed, but i will create millions on linux, or in raspi

the version 7 introduced the date time retrieval, so it’s big progress, afaik mongo was first to introduce such info in their ids years ago

using your code i got rounding problem on first test

Var EndTime As DateTime = DateTime.Now
Var d As DateInterval = EndTime - startTime
Var duration As Double = d.Nanoseconds / 1000000
TextField2.Text = "Duration: " + duration.ToString + " ms" 

There is also Einhugur v4 in the UtilsLib if you want for completeness of the test. The v4 one uses the OS provided API’s I guess.

1 Like


it’s slower than your new v 7
btw thank you and congrats for the new free plug in 40 ms !

can we ask for feature request ? it misses it to able to read date time, version, will be perfect!!
thanks again

Method Time
m1 4
m2 5
m3 6
m4 7
| **Method** | **Time** |
|:----------:|:--------:|
| m1         | 4        |
| m2         | 5        |
| m3         | 6        |
| m4         | 7        |
1 Like
UTM M4 mini ms Mac M4
M_UUID 7.736 1.607
Xojo system 1.426 791
Einhugur V7 125 47
Einhugur v4 66 141
MBS uuid v4 466 222
MBS uuid v7 436 209
more pedantic useless test !

virtualisation is on UTM Ubuntu

to test MBS uuid v7

the problem with MBS uuid v7 is it doesn’t return time like eingihur, or M_uuid, and it return version 4 of uuid

uuid4.xojo_xml_project.zip (7.7 KB)

Did I mess something up?

I run it here:

Var u1 As UUIDMBS = UUIDMBS.UUIDv7
Var u2 As UUIDMBS = UUIDMBS.UUID

Var c As New Clipboard
c.settext u1.ValueFormattedString(False) + EndOfLine +  u2.ValueFormattedString(False)

and get e.g.

0199F323-F8CB-79DD-9746-F7ACBDE69F9E
9A16BD7B-0CBE-4C8F-AF7F-C7790F1C8222

the first one has the time stamp on front and 7 on the beginning of the third block. Isn’t that right?

Oh, yes, could you change your project?

Var u as UUIDMBS = UUIDMBS.UUIDv7

System.Random.Seed = 17327
for i = 1 to 200000
  u = UUIDMBS.UUIDv7
next
TextField1.text =  u.ValueFormattedString(false)

So you don’t call .UUID.randomUUID, which makes two UUIDs in v4 format!?

AI strikes again!

i read somewhere in doc, to make random more random ?

why did i use system.random.seed ? useless no in ? maybe copied from some example

You need to think critically about the code you just posted.

1 Like

sorry i’m retarded, doing too many things same time as usual

mbs v7 is sligthy faster than v 4

sorry for the noise

1 Like