@@ -81,27 +81,28 @@ There are three main differences between Nano ID and UUID v4:
81
81
82
82
``` rust
83
83
$ node . / test / benchmark . js
84
- crypto . randomUUID 28 ,387 ,114 ops / sec
85
- uid / secure 8 ,633 ,795 ops / sec
86
- @ lukeed / uuid 6 ,888 ,704 ops / sec
87
- nanoid 6 ,166 ,399 ops / sec
88
- customAlphabet 3 ,290 ,342 ops / sec
89
- uuid v4 1 ,662 ,373 ops / sec
90
- secure - random - string 415 ,340 ops / sec
91
- uid - safe . sync 400 ,875 ops / sec
92
- cuid 212 ,669 ops / sec
93
- shortid 53 ,453 ops / sec
84
+ crypto . randomUUID 25 ,603 ,857 ops / sec
85
+ @ napi - rs / uuid 9 ,973 ,819 ops / sec
86
+ uid / secure 8 ,234 ,798 ops / sec
87
+ @ lukeed / uuid 7 ,464 ,706 ops / sec
88
+ nanoid 5 ,616 ,592 ops / sec
89
+ customAlphabet 3 ,115 ,207 ops / sec
90
+ uuid v4 1 ,535 ,753 ops / sec
91
+ secure - random - string 388 ,226 ops / sec
92
+ uid - safe . sync 363 ,489 ops / sec
93
+ cuid 187 ,343 ops / sec
94
+ shortid 45 ,758 ops / sec
94
95
95
96
Async :
96
- nanoid / async 102 , 823 ops / sec
97
- async customAlphabet 101 , 574 ops / sec
98
- async secure - random - string 96 , 540 ops / sec
99
- uid - safe 93 , 395 ops / sec
97
+ nanoid / async 96 , 094 ops / sec
98
+ async customAlphabet 97 , 184 ops / sec
99
+ async secure - random - string 92 , 794 ops / sec
100
+ uid - safe 90 , 684 ops / sec
100
101
101
102
Non - secure :
102
- uid 70 , 055 , 975 ops / sec
103
- nanoid / non - secure 2 ,985 , 368 ops / sec
104
- rndm 2 ,800 , 961 ops / sec
103
+ uid 67 , 376 , 692 ops / sec
104
+ nanoid / non - secure 2 ,849 , 639 ops / sec
105
+ rndm 2 ,674 , 806 ops / sec
105
106
```
106
107
107
108
Test configuration: ThinkPad X1 Carbon Gen 9, Fedora 34, Node.js 16.10.
0 commit comments