Skip to content
Myr

Add uid to benchmark

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 067192e · Browse files · 4 files+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+16 added−0 removed

  • tests:+4 added−0 removed
  • other:+12 added−0 removed

4 files+16 added−0 removed

modified:test/benchmark+4 added
1 unmodified line
2var benchmark = require('benchmark')3var shortid = require('shortid')4var uuid4 = require('uuid/v4')5var chalk = require('chalk')6var uid = require('uid-safe')78var nonSecure = require('../non-secure')9var generate = require('../generate')10var nanoid = require('../')
15 unmodified lines
26 })27 .add('nanoid/generate', function () {28 generate('1234567890abcdef-', 10)29 })30 .add('uid.sync', function () {31 uid.sync(21)32 })33 .add('uuid/v4', function () {34 uuid4()35 })36 .add('shortid', function () {
8 unmodified lines
modified:package.json+1 added
modified:README.md+1 added
81 unmodified lines
82$ ./test/benchmark83nanoid 353,737 ops/sec84nanoid/non-secure 2,043,665 ops/sec85nanoid/generate 348,442 ops/sec86uid.sync 325,680 ops/sec87uuid/v4 350,075 ops/sec88shortid 85,107 ops/sec89```90
127 unmodified lines
modified:yarn.lock+10 added
5058 unmodified lines
5059querystringify@^2.0.0:5060 version "2.0.0"5061 resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755"50625063random-bytes@~1.0.0:5064 version "1.0.0"5065 resolved "https://registry.yarnpkg.com/random-bytes/-/random-bytes-1.0.0.tgz#4f68a1dc0ae58bd3fb95848c30324db75d64360b"50665067randomatic@^3.0.0:5068 version "3.0.0"5069 resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923"5070 dependencies:
1190 unmodified lines
6261 uglify-es "^3.3.4"6262 webpack-sources "^1.1.0"6263 worker-farm "^1.5.2"62646265uid-safe@^2.1.5:6266 version "2.1.5"6267 resolved "https://registry.yarnpkg.com/uid-safe/-/uid-safe-2.1.5.tgz#2b3d5c7240e8fc2e58f8aa269e5ee49c0857bd3a"6268 dependencies:6269 random-bytes "~1.0.0"62706271underscore-contrib@~0.3.0:6272 version "0.3.0"6273 resolved "https://registry.yarnpkg.com/underscore-contrib/-/underscore-contrib-0.3.0.tgz#665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7"6274 dependencies:
592 unmodified lines