Add @lukeed/uuid to benchmark and fix uid length
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Andrey Sitnik · committed by Andrey Sitnik · parent 5870ed0 · Browse files · 6 files·+20 added−5 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+20 added−5 removed
- tests:+6 added−2 removed
- other:+14 added−3 removed
Provenance
- Commit
464bc82- Tree
345d474- Author
Andrey Sitnik <andrey@sitnik.ru>- Committer
Andrey Sitnik <andrey@sitnik.ru>- Parent
5870ed0
6 files changed+20 added−5 removed
modified:test/benchmark.js+6 added-2 removed
1234567823 unmodified lines323334353536373839404142434446 unmodified lines9192939491959697989914 unmodified lines#!/usr/bin/env node
let { uid: uidSecure } = require('uid/secure')let { v4: lukeed4 } = require('@lukeed/uuid')let { v4: uuid4 } = require('uuid')let benchmark = require('benchmark')let shortid = require('shortid')let uidSafe = require('uid-safe')23 unmodified lines .add('crypto.randomUUID', () => { crypto.randomUUID() }) .add('uid/secure', () => { uidSecure(21) uidSecure(32) }) .add('@lukeed/uuid', () => { lukeed4() }) .add('nanoid', () => { nanoid() }) .add('customAlphabet', () => {46 unmodified lines }) } }) .add('uid', () => { uid(21) uid(32) }) .add('nanoid/non-secure', () => { nonSecure() })14 unmodified linesmodified:package.json+1 added
31 unmodified lines32 "devDependencies": {33 "@babel/core": "^7.15.5",34 "@logux/eslint-config": "^45.4.8",35 "@logux/sharec-config": "^0.12.2",36+ "@lukeed/uuid": "^2.0.0",37 "@parcel/optimizer-cssnano": "^2.0.0-rc.0",38 "@parcel/optimizer-htmlnano": "^2.0.0-rc.0",39 "@parcel/packager-css": "^2.0.0-rc.0",40 "@parcel/packager-html": "^2.0.0-rc.0",200 unmodified linesmodified:README.md+2 added-1 removed
81 unmodified lines82 83 ```rust84 $ node ./test/benchmark.js85 crypto.randomUUID 28,387,114 ops/sec86-uid/secure 11,994,801 ops/sec86+uid/secure 8,633,795 ops/sec87+@lukeed/uuid 6,888,704 ops/sec88 nanoid 6,166,399 ops/sec89 customAlphabet 3,290,342 ops/sec90 uuid v4 1,662,373 ops/sec91 secure-random-string 415,340 ops/sec434 unmodified linesmodified:README.ru.md+2 added-1 removed
87 unmodified lines88 89 ```rust90 $ node ./test/benchmark.js91 crypto.randomUUID 28,387,114 ops/sec92-uid/secure 11,994,801 ops/sec92+uid/secure 8,633,795 ops/sec93+@lukeed/uuid 6,888,704 ops/sec94 nanoid 6,166,399 ops/sec95 customAlphabet 3,290,342 ops/sec96 uuid v4 1,662,373 ops/sec97 secure-random-string 415,340 ops/sec420 unmodified linesmodified:README.zh-CN.md+2 added-1 removed
81 unmodified lines82 83 ```rust84 $ node ./test/benchmark.js85 crypto.randomUUID 28,387,114 ops/sec86-uid/secure 11,994,801 ops/sec86+uid/secure 8,633,795 ops/sec87+@lukeed/uuid 6,888,704 ops/sec88 nanoid 6,166,399 ops/sec89 customAlphabet 3,290,342 ops/sec90 uuid v4 1,662,373 ops/sec91 secure-random-string 415,340 ops/sec423 unmodified linesmodified:yarn.lock+7 added
568 unmodified lines569 version "1.0.0"570 resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.0.0.tgz#733a122382749d27e2e46ec38f8c71c9d53a9636"571 integrity sha512-ruuGHsnabmObBdeMg3vKdGRmh06Oog3eFpf/Tk6X0kDSJDpJTDCj2dqdp1+0VjzIUgHlFF9GBm7uFqfYhhdX9g==572 573+"@lukeed/uuid@^2.0.0":574+ version "2.0.0"575+ resolved "https://registry.yarnpkg.com/@lukeed/uuid/-/uuid-2.0.0.tgz#1c0f33c071cb6902bc3b9e475782ada7314ef9bd"576+ integrity sha512-dUz8OmYvlY5A9wXaroHIMSPASpSYRLCqbPvxGSyHguhtTQIy24lC+EGxQlwv71AhRCO55WOtgwhzQLpw27JaJQ==577+ dependencies:578+ "@lukeed/csprng" "^1.0.0"579+580 "@nodelib/fs.scandir@2.1.5":581 version "2.1.5"582 resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"583 integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==8797 unmodified lines