1
0
Fork 0
forked from svrjs/svrjs
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs/node_modules/simple-lru-cache/benckmark/engine.bench.js

34 lines
602 B
JavaScript
Raw Permalink Normal View History

2023-07-29 20:33:28 +02:00
module.exports = function(count, engineFactory) {
var cache = engineFactory();
return (
{ '#set()': function() {
for (var i = 0; i < count; i++) {
cache.set('key' + i, i);
}
}
, '#get() with populated cache': function() {
for (var i = 0; i < count; i++) {
cache.get('key' + i, i);
}
}
, '#del()': function() {
for (var i = 0; i < count; i++) {
cache.del('key' + i, i);
}
}
, 'end': function() {
if (cache.close) {
cache.close();
}
}
}
);
};