Skip to content
Myr

3x speed up ID generation

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 486009f · Browse files · 3 files+19 added−1 removed
This commit

State

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

Diff stats

3 files+19 added−1 removed

  • other:+19 added−1 removed

3 files+19 added−1 removed

modified:.npmignore+2 added
11 unmodified lines
12.travis.yml1314.yaspellerrc15docs/1617benchmark
added:benchmark+13 added
1#!/usr/bin/env node23var nanoid = require('./')4var generate = require('./generate')56var start = Date.now()7for (var i = 0; i < 100000; i++) {8 nanoid()9 generate('1234567890abcdef', 10)10}11var end = Date.now()1213process.stdout.write(end - start + ' ms\n')
modified:format.js+4 added-1 removed