Sha256: 8a8f6efde5cce23363aee3f30aa57cbf40f38309fd4e7565a9e3d6a66a8bee52

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 Bytes

Contents

var nodeuuid = require('../uuid'),
    uuidjs = require('uuid').generate,
    N = 5e5;

function rate(msg, t) {
  console.log(msg + ': ' +
    (N / (Date.now() - t) * 1e3 | 0) +
    ' uuids/second');
}

// node-uuid - string form
for (var i = 0, t = Date.now(); i < N; i++) nodeuuid();
rate('nodeuuid()', t);

for (var i = 0, t = Date.now(); i < N; i++) nodeuuid('binary');
rate('nodeuuid(\'binary\')', t);

var buffer = new nodeuuid.BufferClass(16);
for (var i = 0, t = Date.now(); i < N; i++) nodeuuid('binary', buffer);
rate('nodeuuid(\'binary\', buffer)', t);

// node-uuid - string form
for (var i = 0, t = Date.now(); i < N; i++) uuidjs();
rate('uuidjs()', t);

for (var i = 0, t = Date.now(); i < N; i++) uuidjs('binary');
rate('uuidjs(\'binary\')', t);

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vulcan-0.3.0 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.6 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.5 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.4 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.3 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.2 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.1 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.1.0 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.0.3 server/node_modules/node-uuid/test/benchmark.js
vulcan-0.0.2 server/node_modules/node-uuid/test/benchmark.js