aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js
new file mode 100644
index 00000000..c2a9e548
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/lru-cache/s.js
@@ -0,0 +1,25 @@
+var LRU = require('lru-cache');
+
+var max = +process.argv[2] || 10240;
+var more = 1024;
+
+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));