Skip to content

Commit

Permalink
bench: add @napi-rs/uuid v4 (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Jan 12, 2022
1 parent f425778 commit 8ba2319
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@babel/core": "^7.16.7",
"@logux/eslint-config": "^46.1.1",
"@lukeed/uuid": "^2.0.0",
"@napi-rs/uuid": "^0.2.0",
"@originjs/vite-plugin-commonjs": "^1.0.2",
"@size-limit/dual-publish": "^7.0.5",
"@size-limit/file": "^7.0.5",
Expand Down
128 changes: 128 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

let { uid: uidSecure } = require('uid/secure')
let { v4: lukeed4 } = require('@lukeed/uuid')
let { v4: napiv4 } = require('@napi-rs/uuid')
let { v4: uuid4 } = require('uuid')
let benchmark = require('benchmark')
let shortid = require('shortid')
Expand Down Expand Up @@ -32,6 +33,9 @@ suite
.add('crypto.randomUUID', () => {
crypto.randomUUID()
})
.add('@napi-rs/uuid', () => {
napiv4()
})
.add('uid/secure', () => {
uidSecure(32)
})
Expand Down

0 comments on commit 8ba2319

Please sign in to comment.