Sha256: 91607f4be46f524b824fdc2b9919b54648badda77fe2db4a10257e6616a50d9c

Contents?: true

Size: 460 Bytes

Versions: 13

Compression:

Stored size: 460 Bytes

Contents

var LRU = require('lru-cache');

var max = +process.argv[2] || 10240;
var more = 102400;

var cache = LRU({
  max: max, maxAge: 86400e3
});

// fill cache
for (var i = 0; i < max; ++i) {
  cache.set(i, {});
}

var start = process.hrtime();

// adding more items
for ( ; i < max+more; ++i) {
  cache.set(i, {});
}

var end = process.hrtime(start);
var msecs = end[0] * 1E3 + end[1] / 1E6;

console.log('adding %d items took %d ms', more, msecs.toPrecision(5));

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/bower-registry-client/node_modules/lru-cache/bench.js
stylus-source-0.38.0 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js
stylus-source-0.37.0 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js
stylus-source-0.36.1 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js
stylus-source-0.36.0 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js
stylus-source-0.35.1 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js
stylus-source-0.35.0 vendor/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js